Claude Code
Anthropic Claude Code
- claude
Headless -p mode, an advisor without tools, JSONL transcripts per project.
- Invoke
- 6 of 6 · official
- Models
- no listing
- MCP
- json · standard
- Agents file
- ~/.claude/CLAUDE.md
Access
- Get
getHarness("claude") - CLI
harnesses paths claude --json - Tryclaude in the explorer
Claude Code is the harness most of the others borrow from: Cursor, Copilot, OpenCode and Mastra Code read .claude/skills/, Grok loads CLAUDE.md. Its own layout is settings in JSON at user, project, local and managed scopes, transcripts under ~/.claude/projects/ in a directory named after the dash-encoded working directory, and MCP servers in ~/.claude.json rather than in the settings file, which surprises everyone once.
--tools "" removes every built-in tool, and --strict-mcp-config drops the configured MCP servers that --tools leaves alone, so the advisor mode is real. Without it, an advisor still sees every MCP tool from the user and project config. --tools Read,Glob,Grep with --strict-mcp-config is the read-only mode: three inspection tools and no MCP servers, so nothing is left that writes. Plan mode is not it. It refuses Write and MCP calls, but a shell redirect went through the auto mode classifier and landed on disk.
What --tools "" won't do is tell the model. A Claude that doesn't know its tools are gone writes <invoke> blocks as text. Then it reads results off runs that never happened. So advisor runs add --append-system-prompt saying there's nothing to call. Sonnet did it in 3 of 3 runs without that prompt and in none with it.
Capabilities and invocation
- mcp: yes
- vision: yes
- audio: no
- video: no
- tools: yes
- streaming: yes
Binary claude, evidence official. Headless print mode; add --output-format json for structured output. Plain text runs stream events instead and fold them back, since text mode prints nothing until the answer is complete and a timeout would lose all of it; --include-partial-messages streams a single long answer too, checked on 2.1.280. --tools only covers the built-in set, so every mode without the full agent adds --strict-mcp-config to drop configured MCP servers too; without it an advisor still sees every user and project MCP tool, checked on 2.1.280. Read-only runs keep the built-in Read, Glob and Grep tools, so no write tool exists whatever permission mode the settings carry; verified on 2.1.175 and 2.1.268. --permission-mode plan does not qualify: its shell commands run through the auto mode classifier, which let a file write through. Advisor runs append a system prompt saying no tools exist: without it Sonnet wrote `<invoke>` blocks as text in 3 of 3 runs on 2.1.289, with it in none. Model selection appends --model {model}.
- advisor{}
-p {prompt} --append-system-prompt This run has no tools: nothing can be called, run or read, and no tool output will come back. Never write a tool call as text, such as an <invoke> or <function_calls> block. Answer from reasoning alone, and mark any value you did not derive in the answer itself as unverified. --strict-mcp-config --tools - advisor · json{ structured: true }
-p --output-format json {prompt} --append-system-prompt This run has no tools: nothing can be called, run or read, and no tool output will come back. Never write a tool call as text, such as an <invoke> or <function_calls> block. Answer from reasoning alone, and mark any value you did not derive in the answer itself as unverified. --strict-mcp-config --tools - read-only{ readOnly: true }
-p {prompt} --strict-mcp-config --tools Read,Glob,Grep - read-only · json{ readOnly: true, structured: true }
-p --output-format json {prompt} --strict-mcp-config --tools Read,Glob,Grep - agent{ tools: true }
-p {prompt} - agent · json{ tools: true, structured: true }
-p --output-format json {prompt}
Paths
Templates as the registry stores them. ~, ${HOME}, ${TMPDIR} and %VAR% expand in resolve(); entries tagged with a platform are dropped on the others. Open in the explorer to see them expanded for a home directory of your choice.
config
~/.claude/settings.json~/.claude.jsonGlobal MCP server configurations.
.claude/settings.json.claude/settings.local.jsonLocal overrides, typically gitignored.
.claude/.mcp.jsonProject-scoped MCP server configurations.
/etc/claude-code/managed-settings.jsonEnterprise managed settings.
/Library/Application Support/ClaudeCode/managed-settings.jsonEnterprise managed settings.
sessions
~/.claude/projects/<dash-encoded-cwd>/*.jsonlPer-project session transcripts in JSONL format.
~/.claude/history.jsonlGlobal prompt history across all projects.
instructions
CLAUDE.md.claude/CLAUDE.mdAlternative project-level location.
~/.claude/CLAUDE.mdGlobal user-level instructions.
skills
.claude/skills/~/.claude/skills/Global user-level skills.
commands
.claude/commands/Legacy slash commands, merged into skills.
~/.claude/commands/Legacy global slash commands.
promptTemplates
.claude/commands/Legacy slash commands, merged into skills.
~/.claude/commands/Legacy global slash commands.
hooks
.claude/hooks/~/.claude/hooks/Global user-level hooks.
temp
${TMPDIR}/claude-<uid>/Session scratchpads sit under <dash-encoded-cwd>/<session-id>/scratchpad.
/tmp/claude-<uid>/${TMPDIR}/claude/
Env overrides
Variables the harness reads to move a root. The path is the default while the variable is unset; resolve() applies a set one to temp.
CLAUDE_CONFIG_DIR~/.claudeconfig · sessions · instructions · skills · commands · promptTemplates · hooksRead from the shell or the env block of user or managed settings, not project settings.
CLAUDE_CODE_TMPDIR${TMPDIR}temp · linux, win32Read from the shell or the env block of user or managed settings, not project settings.
CLAUDE_CODE_TMPDIR/tmptemp · darwinRead from the shell or the env block of user or managed settings, not project settings.
MCP servers
~/.claude.jsonuser · json · standard · mcpServers.mcp.jsonproject · json · standard · mcpServers
Detection
envVars
- CLAUDE_CODE
- CLAUDECODE
- CLAUDE_CODE_ENTRYPOINT
- CLAUDE_CONFIG_DIR
projectMarkers
- .claude/settings.json
- .claude/settings.local.json
- .claude/skills
- CLAUDE.md
Persistence
- JSON - Settings and MCP config files. (official)
- JSONL - Session transcripts and global history. (official)
syncAgentsFiles links ~/.claude/CLAUDE.md to the master bundle.