| Feature | How |
|---|---|
| Import other files | @path/to/import syntax (max depth 5) |
| Path-specific rules | YAML frontmatter with paths: glob |
| Additive loading | All levels contribute simultaneously |
| Child dirs | Load on-demand when files accessed |
./CLAUDE.md (committed), personal prefs in CLAUDE.local.md.claude/rules/*.md for modular, topic-specific rulesCLAUDE.md — it's loaded into context/name.
| Field | Purpose |
|---|---|
name | Slash command name |
description | Intent matching for auto-invocation |
allowed-tools | Skip permission prompts |
context: fork | Run in isolated subagent |
model | Override model when active |
hooks | Skill-scoped lifecycle hooks |
disable-model-invocation | Only user can trigger |
description — Claude uses it for auto-invocation intent matchingcontext: fork for heavy skills to avoid polluting the main context.claude/commands/ for new work — skills are the replacement| Area | Keys |
|---|---|
| Permissions | allow, deny, ask, defaultMode |
| Hooks | hooks object (event → handler map) |
| Environment | env object (injected into all sessions) |
| Model | model, availableModels |
| MCP | enableAllProjectMcpServers |
| Sandbox | sandbox.enabled, network allowlists |
| Plugins | enabledPlugins, marketplaces |
.claude/settings.local.json for personal prefs that shouldn't be committedallow to reduce permission promptsbypassPermissions outside containers — it disables all safety checkstype: "prompt" or "agent"). Can block actions (exit 2).
| Event | When | Can Block? |
|---|---|---|
SessionStart | Session begins/resumes | No |
UserPromptSubmit | User sends prompt | No |
PreToolUse | Before tool executes | Yes |
PostToolUse | After tool succeeds | No |
Stop | Claude finishes responding | No |
SubagentStart/Stop | Agent spawned/finished | No |
Notification | Attention needed | No |
PreCompact | Before context compaction | No |
SessionEnd | Session terminates | No |
| Type | Description |
|---|---|
command | Shell script (default). stdin=JSON, exit code=action |
prompt | Single-turn LLM eval (Haiku by default) |
agent | Multi-turn subagent with tool access |
PreToolUse hooks to block dangerous commands (exit 2 = block)type: "agent" for multi-step verification| Shortcut | Action |
|---|---|
Ctrl+C/D | Cancel / Exit |
Ctrl+G | Open prompt in editor |
Ctrl+O | Toggle verbose output |
Ctrl+B | Background running task |
Ctrl+T | Toggle task list |
Shift+Tab | Cycle permission modes |
Alt+P | Switch model |
/ | Commands & skills |
! | Bash mode (direct exec) |
@ | File path autocomplete |
Ctrl+O to debug — verbose mode shows hook output and tool detailsShift+Tab to quickly switch to plan mode for explorationCtrl+B — background long tasks instead of waiting| Aspect | Detail |
|---|---|
| Input | Script receives CLAUDE_PROJECT_DIR and other env vars |
| Output | Script's stdout becomes the status line content |
| Refresh | Runs on each prompt cycle — keep it fast (<100ms) |
| Default info | Model name, permission mode, token usage, cost |
| Custom info | Git branch, test status, build state, project context |
| Feature | Detail |
|---|---|
| Tool Search | Lazy-loads tools, reduces context up to 95% |
| OAuth | Built-in OAuth 2.0 for remote servers |
| Resources | @server:protocol://path mentions |
| Prompts → Commands | Become /mcp__server__prompt |
| Env vars | ${VAR:-default} in config |
.mcp.json in project root for team-shared tool configs${VAR} in config for secrets — never hardcode API keysENABLE_TOOL_SEARCH=auto) to lazy-load@ for files, ! for bash, / for commands.
| Tool | Purpose | You trigger via |
|---|---|---|
Bash | Shell commands | ! prefix or ask for terminal work |
Read | Files, images, PDFs | @path mention or "read this file" |
Edit | Modify files | "change X to Y in file" |
Write | Create files | "create a new file with..." |
Glob | Find files by pattern | "find all *.ts files" |
Grep | Search content | "search for X in the codebase" |
WebFetch | Fetch URLs | Paste a URL or "fetch this page" |
WebSearch | Web search | "search the web for..." |
Task | Subagents | Claude delegates automatically |
Skill | Invoke skills | /skill-name in prompt |
@path/to/file to reference files — Claude will read them automatically! prefix for direct bash execution without Claude's interpretation| Source | Example |
|---|---|
github | GitHub repository |
npm | npm package |
directory | Local file path |
url | Direct URL |
MEMORY.md (first 200 lines loaded at session start). Topic files loaded on demand.
| Env Var | Effect |
|---|---|
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 | Disable auto-memory |
/memory command | Open memory files in editor |
MEMORY.md under 200 lines — only the first 200 are auto-loadeddebugging.md, patterns.md) for detailed notes--resume to continue a previous session with full context preservedPreCompact hook fires before this happens.
| Aspect | Detail |
|---|---|
| Trigger | Automatic when context window fills (configurable %) |
| Behavior | Summarizes older messages, preserves recent context |
| Hook | PreCompact fires before — save state or inject reminders |
| Manual | Esc Esc to rewind/summarize on demand |
| Override | CLAUDE_AUTOCOMPACT_PCT_OVERRIDE sets trigger % |
PreCompact hook to inject critical context that must survive compactionCLAUDE.md instructions concise — they reload after compaction| Built-in Type | Model | Purpose |
|---|---|---|
Explore | Haiku | Fast, read-only codebase exploration |
Plan | Inherit | Research during plan mode |
general-purpose | Inherit | Complex multi-step tasks |
Bash | Inherit | Terminal commands in separate context |
Explore (Haiku) for cheap, fast codebase searches — save Opus for complex work| Feature | Subagents | Teams |
|---|---|---|
| Context | Own window, returns to caller | Fully independent |
| Communication | Reports to main only | Peer-to-peer |
| Coordination | Main manages | Shared task list |
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 — it's off by defaulttools lists — an analyst doesn't need Edit or Writememory: project for agents that should remember across sessionspermissionMode: plan for read-only work| Mode | Behavior |
|---|---|
default | Prompt for first use of each tool |
acceptEdits | Auto-accept file edits |
plan | Read-only (analyze, don't modify) |
delegate | Coordination-only for team leads |
dontAsk | Auto-deny unless pre-approved |
bypassPermissions | Skip all checks (containers only) |
default mode, then add specific allow rules as you learn your patternsdeny rules for commands that should never run (e.g., Bash(rm -rf /))allow — Bash(*) defeats the entire purpose| Setting | Purpose |
|---|---|
sandbox.enabled | Toggle sandboxing |
sandbox.network.allowedDomains | Network allowlist |
sandbox.permissions.additionalDirectories | Extra FS access |
allowedDomains| Control | Effect |
|---|---|
allowedMcpServers | Whitelist specific MCP servers |
deniedMcpServers | Block specific MCP servers |
defaultMode | Force a permission mode for all users |
deny rules | Block specific tools/commands org-wide |
model | Restrict available models |
CLAUDE.md for coding standards all teams must followCLAUDE.md → always-on instructionsSKILL.md → domain expertisesettings.json → configuration.mcp.json → external toolsagents/*.md → custom agentshooks → lifecycle triggersPreToolUse → security gatespermissions → allow/deny/asksandbox → OS isolationauto-memory → learn & persistMCP servers → external APIsplugins → packaged bundlessubagents → parallel workersagent teams → coordinationkeybindings → custom shortcuts| Variable | Purpose | Default |
|---|---|---|
ANTHROPIC_MODEL | Model override | claude-sonnet-4-5-20250929 |
CLAUDE_CODE_MAX_OUTPUT_TOKENS | Max output tokens | 32768 (max 65536) |
BASH_DEFAULT_TIMEOUT_MS | Bash command timeout | 600000 (10 min) |
CLAUDE_CODE_DISABLE_AUTO_MEMORY | Toggle auto-memory | 0 (enabled) |
CLAUDE_CODE_EFFORT_LEVEL | Reasoning effort (Opus 4.6) | high |
MAX_THINKING_TOKENS | Extended thinking budget | — |
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE | Auto-compaction trigger % | — |
ENABLE_TOOL_SEARCH | MCP lazy tool loading | auto |
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS | Enable agent teams | 0 (off) |