Slash Commands

Type / in a session to see available commands1:

CommandDescription
/helpShow available commands
/resumePick a previous conversation to continue
/continueContinue most recent session (also -c flag)
/contextSee what’s consuming context space
/memoryView and manage CLAUDE.md files and auto memory
/initGenerate a CLAUDE.md for your project
/agentsCreate and manage custom sub-agents
/permissionsView and manage tool permissions
/hooksCreate and manage automation hooks
/mcpConnect MCP servers
/compactManually compress context
/modelSwitch between Claude models
/fastToggle fast output mode
/statusView session info
/doctorDiagnose common issues
/costTrack token usage and costs
/clearClear conversation history
/loginSwitch accounts mid-session

Bundled skills (invoke like slash commands): /simplify, /batch, /debug, /loop, /claude-api

Custom Slash Commands (Skills)2

Users can create custom commands by placing markdown files in:

  • .claude/skills/<name>/SKILL.md — Project-scoped (shared via git)
  • ~/.claude/skills/<name>/SKILL.md — Global (personal)

These become available as /<name> and support:

  • $ARGUMENTS placeholders for parameters
  • !command“ syntax for dynamic context injection (shell output)
  • Frontmatter for model, tools, and behavior control
  • Supporting files organized in the skill directory

Example:

---
name: fix-issue
description: Fix a GitHub issue
allowed-tools: Bash, Read, Edit, Write, Grep, Glob
---
 
Fix GitHub issue $ARGUMENTS following project standards.
1. Read the issue: !`gh issue view $0`
2. Implement the fix
3. Run tests
4. Commit with descriptive message

Invoke with /fix-issue 123.

Permissions Model

Claude Code has a layered permissions system3 controlling what actions require user approval.

Permission Modes

ModeBehavior
defaultAsks on first use of each tool type
acceptEditsAuto-accepts file edits, asks for shell commands
planRead-only analysis only (no modifications)
dontAskAuto-denies unless pre-approved in rules
bypassPermissionsSkips all checks (use with extreme caution)

Permission Rules

Configured in settings files with allow/deny/ask lists:

{
  "permissions": {
    "allow": [
      "Bash(npm run test *)",
      "Bash(git commit *)",
      "Read(~/.zshrc)"
    ],
    "deny": [
      "Bash(git push *)",
      "Read(./.env)",
      "Read(./secrets/**)"
    ],
    "ask": [
      "WebFetch"
    ]
  }
}

Rule Syntax

PatternMatches
BashAll bash commands
Bash(npm run build)Exact command
Bash(npm run *)Commands starting with npm run
Bash(* --help)Commands ending with --help
Read(./.env)Specific file
Read(/src/**)Directory patterns
WebFetch(domain:github.com)Specific domain
Edit(/docs/**)Edit operations on pattern
Agent(Explore)Specific sub-agent type
mcp__github__*All tools from an MCP server

Tool Safety Tiers

TierToolsDefault Behavior
Read-onlyGlob, Grep, ReadNo approval needed
File modificationsEdit, WriteAsk on first use per session
Shell executionBashAsk every time (unless pre-approved)

Memory

CLAUDE.md Files (Explicit Memory)

CLAUDE.md files serve as persistent instructions4 loaded automatically at the start of each session:

LocationScopeUse Case
./CLAUDE.mdProject rootProject conventions, architecture, build commands
.claude/rules/*.mdProject rules dirScoped rules (e.g., testing.md, api-design.md)
./CLAUDE.local.mdProject (gitignored)Personal project overrides
~/.claude/CLAUDE.mdGlobalPersonal preferences across all projects

What to include:

  • Build and test commands (npm test, cargo build)
  • Code style conventions (naming, formatting, indentation)
  • Architecture overview and key abstractions
  • “Never do X” rules
  • Frequently used workflows

Best practices:

  • Keep under 200 lines (every line costs tokens on every request)
  • Use markdown headers and bullets for structure
  • Be specific: “Use 2-space indentation” not “Format code properly”
  • Move detailed reference material to skills (loaded on-demand)
  • Use @path/to/file imports for additional context files
  • Scope rules to file types with YAML frontmatter paths: field

Auto Memory

Claude automatically saves learnings across sessions without explicit user action:

  • What it saves: Build commands, debugging insights, architecture notes, code style preferences, workflow habits
  • Storage: ~/.claude/projects/<project>/memory/MEMORY.md
  • Loading: First 200 lines load every session; full directory available on-demand
  • Scope: Machine-local only (not shared across devices)
  • Control: Enable/disable with /memory command or autoMemoryEnabled setting

Sessions

  • Independent: Each new session starts with fresh context (no conversation history from prior sessions).
  • Directory-tied: Resume only shows sessions from the current directory.
  • Resume: claude --continue resumes the most recent session; claude -r <session-id> resumes a specific one; /resume lets you pick interactively.
  • Fork: --fork-session creates a new session with preserved history context.
  • Cross-branch: When you switch git branches, files update but conversation history stays.
  • Parallel: Use git worktrees to run parallel Claude Code sessions in separate directories.

IDE Integration5

VS Code

  • Official extension from the Marketplace (search “Claude Code”)
  • Embedded chat panel alongside the editor
  • @file mentions to reference files
  • Inline diffs and plan review
  • Resume past conversations
  • Full keyboard shortcuts

JetBrains IDEs

  • Plugin for IntelliJ, PyCharm, WebStorm, etc.
  • Interactive diff viewing
  • Selection context sharing
  • WSL and remote development support

Desktop App

  • Visual diff review
  • Multiple sessions side-by-side
  • Schedule recurring tasks
  • Cloud session management
  • Remote Control support

Browser (VS Code Web)

  • No local setup needed
  • Cloud execution
  • /teleport to move between web and terminal

All interfaces share the same CLAUDE.md files, settings, MCP servers, skills, and sub-agents.

Git Integration

Claude Code has deep git awareness:

  • Reads git status, diffs, and logs to understand current state
  • Creates commits with descriptive messages
  • Creates branches and pull requests via gh CLI
  • Respects uncommitted work and avoids destructive operations by default
  • Supports code review workflows (/review, PR comment analysis)
  • Checkpoints every file edit for easy rollback

Chrome Extension

claude --chrome

Enables browser control for web testing, form filling, and debugging web applications.

Footnotes

References

Footnotes

  1. Claude Code Slash Commands

  2. Claude Code Skills

  3. Claude Code Permissions

  4. Claude Code Memory (CLAUDE.md)

  5. Claude Code IDE Integrations