Anthropic's official CLI. A Claude model (Opus 4.7 by default) running in your terminal with Read/Write/Edit/Bash tools, MCP integrations, a hook system, and project-scoped skills + memory. Ships on macOS, Linux, Windows (WSL2). Integrates with VS Code + JetBrains.
| Key | Value |
|---|---|
| Default model | claude-opus-4-7 (1M context) |
| Fast mode | claude-opus-4-6 (same class, faster streaming) |
| Install | npm install -g @anthropic-ai/claude-code |
| Project config | .claude/settings.json |
| User config | ~/.claude/settings.json |
| Session store | ~/.claude/projects/<encoded-path>/*.jsonl |
| Docs | docs.claude.com |
| Source | anthropics/claude-code |
Two minutes from blank machine to a running session.
| Platform | Notes |
|---|---|
| macOS | First-class. Apple Silicon preferred for local-model interop. |
| Linux | First-class. Any distro with Node 20+. |
| Windows | Via WSL2. Native Windows is experimental. |
| Docker | Official image for sandboxed runs. Good with --dangerously-skip-permissions. |
ANTHROPIC_API_KEY in the environment or via claude login.CLAUDE_CODE_USE_BEDROCK=1 + your AWS credentials.CLAUDE_CODE_USE_VERTEX=1 + ADC credentials.Every flag worth knowing, grouped by what they do.
| Flag | Effect |
|---|---|
| One-shot mode. Read prompt from args or stdin, write response to stdout, exit. Ideal for scripting. | |
| --continue | Resume the most recent session in the current directory. |
| --resume <id> | Resume a specific session by id. |
| --model <name> | Pin the session's model. Aliases: opus, sonnet, haiku. |
| --dangerously-skip-permissions | Bypass the runtime permission prompt entirely. For sandboxed or CI runs. |
| --mcp-config <path> | Load MCP servers from a file instead of settings.json. |
| --cwd <path> | Run with a specific working directory (overrides auto-detection). |
! prefix — run a shell command in-band (output lands in the conversation).~/.claude/keybindings.json.Built-in slashes + how to author your own.
| Command | Purpose |
|---|---|
| /help | Inline help — built-ins + registered user commands |
| /clear | Wipe the visible transcript + context; settings + MCP stay loaded |
| /compact | Summarise + compact the conversation to reclaim tokens |
| /fast | Toggle Claude Opus 4.6 (faster streaming, same weight class) |
| /model <name> | Switch model mid-session |
| /init | Bootstrap a CLAUDE.md for the current repo |
| /review | Review a pull request or the current diff |
| /security-review | Scan pending changes for security issues |
| /loop [interval] <cmd> | Run a command on a recurring interval (or self-paced) |
| /schedule | Create/manage scheduled remote triggers |
| /statusline | Configure the status line above the input |
| /resume | Open the session picker |
Any .claude/skills/<name>/SKILL.md registers as /<name>. Minimum shape:
/<name>.
Markdown files that teach Claude how to do something specific. Lazy-loaded, versioned with the repo.
./.claude/skills/<name>/SKILL.md — versioned with the repo. Shared across contributors.
~/.claude/skills/<name>/SKILL.md — per-user, cross-project. Personal shortcuts + preferences.
Installed via the plugin system; pinned in skills-lock.json. Shared across repos; reproducible across machines.
Shell commands that fire at well-defined points inside the agent loop. Gate, rewrite, notify, log.
Edit|Write running Biome / Prettier / ruff.Bash checking the command against an approved pattern list.git status into context when a prompt mentions commits.say / flashes the Dock.Built-in tools ship with the CLI. MCP servers extend the surface to anything with an integration.
Read · Write · Edit · NotebookEdit · Glob · Grep. The core loop for touching code.
Bash (with run_in_background) + Monitor for tailing async processes.
Agent (spawn subagents) · SendMessage (continue a named agent) · TaskCreate/List/Update (progress tracking).
WebFetch (specific URL) · WebSearch (query). Distilled results, not raw HTML.
ScheduleWakeup for /loop dynamic pacing. CronCreate/List/Delete for persistent schedules.
Invoke a user-authored skill by name. Registered automatically from .claude/skills/.
Fetch schemas for deferred MCP tools so they become callable in the current session.
AskUserQuestion (structured question) · ExitPlanMode (leave plan mode) · Config (get/set a subset of settings).
Large MCP tool libraries (100+ tools) use deferred registration — names appear in the system reminder but schemas load on demand via ToolSearch. Keeps the initial prompt small. Call ToolSearch "select:<name>" before invoking a deferred tool.
Spawn scoped agents. Isolate risky work in a git worktree. Run in the background with Monitor.
| Type | Use |
|---|---|
| general-purpose | Catch-all. Can use any tool. Default choice for open-ended tasks. |
| Explore | Codebase search — Glob / Grep / Read with no write tools. Cheap reconnaissance. |
| Plan | Read-only planning. Produces an implementation plan without touching files. |
| statusline-setup | Configure the status line. |
| keybindings-help | Edit ~/.claude/keybindings.json. |
| (project-defined) | Drop .claude/agents/<name>.md to register a custom persona + tool allowlist. |
isolation: "worktree" creates a temporary git worktree on a new branch, runs the subagent there, cleans up if no changes are made, and returns the worktree path + branch name if changes land. Use for any mutation you might need to throw away.
Background agents notify on completion automatically — don't poll. The Monitor tool streams stdout line-by-line if you need tail-style visibility. For one-shot waits ("run this, block until done"), use Bash run_in_background=true + Monitor instead of Agent.
Three files, a merge order, and the blocks that matter.
| File | Scope | Commits? |
|---|---|---|
| ~/.claude/settings.json | User · machine-wide | No (outside repo) |
| .claude/settings.json | Project | Yes — shared with contributors |
| .claude/settings.local.json | Project-local overrides | No — gitignored |
Merge order: local > project > user. Most-specific wins on scalar keys; arrays concatenate.
allow / deny rules for tools. Glob-pattern match. Most restrictive wins.
Per-event arrays of {matcher, hooks: [{type:"command", command}]}. See the Hooks tab.
Map of server-name → transport config. See the MCP tab.
Environment variables injected into the Claude Code process.
Default model for the project. Override with --model or /model.
Script or template that produces the line above the input.
Tool names to hide for this scope. Useful to disable WebFetch in offline/secure workflows.
Formatting preset for model output — concise, verbose, etc.
Separate file: ~/.claude/keybindings.json. Configurable via the keybindings-help subagent — just ask Claude Code to remap something, and it'll write the JSON.
Runtime mode + allowlist rules. Two layers that compose.
--dangerously-skip-permissions.Tie-break: deny wins over allow. Most-specific wins when both match.
Great for high-trust planning before touching code. Claude Code can Read, Grep, Glob, WebFetch — it cannot Write, Edit, or run a destructive Bash command. Exit plan mode with the ExitPlanMode tool after user approves the plan.
--dangerously-skip-permissions bypasses the runtime prompt but does not bypass settings.json deny rules. Use both if you really want unfettered access.deny list for anything you never want the model touching.CLAUDE.md + auto-memory. What Claude Code remembers between sessions and between projects.
Repo root. Auto-loaded into every session in that project. Overview · stack · commands · conventions · invariants. /init bootstraps one.
~/.claude/CLAUDE.md. Loaded into every session across every project. Tone, idioms, global preferences.
~/.claude/projects/<path>/memory/. Agent-managed notes keyed by type (user / feedback / project / reference). Grows over time.
| Type | Purpose |
|---|---|
| user | Your role, responsibilities, knowledge level. Informs how Claude frames answers. |
| feedback | Corrections + confirmed approaches. Survives across sessions so you don't re-correct. |
| project | Facts about the current project — who's doing what, deadlines, decisions. |
| reference | Pointers to external systems — Linear project, Slack channel, Grafana dashboard. |
MEMORY.md under the project memory dir is an index — one line per memory file, under ~150 chars: - [Title](file.md) — one-line hook. Always loaded into context. Keep it tight (lines past ~200 get truncated).