Harnesses

Claude Code

Anthropic's CLI. Headless -p mode with a real advisor, JSONL transcripts per project, JSON settings at four scopes, MCP in ~/.claude.json.
IDclaude02 / 1323 paths · env + project
Harness

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
Inferred 0 / 23

Access

GetgetHarness("claude")
CLIharnesses 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}.

Callinvoke(prompt, options)6 of 6 modes
  • 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.

PathsgetHarness("claude")23 templates · 8 groups

config

  • ~/.claude/settings.jsonuserofficialall
  • ~/.claude.jsonuserofficialall

    Global MCP server configurations.

  • .claude/settings.jsonprojectofficialall
  • .claude/settings.local.jsonprojectofficialall

    Local overrides, typically gitignored.

  • .claude/.mcp.jsonprojectofficialall

    Project-scoped MCP server configurations.

  • /etc/claude-code/managed-settings.jsonsystemofficiallinux

    Enterprise managed settings.

  • /Library/Application Support/ClaudeCode/managed-settings.jsonsystemofficialdarwin

    Enterprise managed settings.

sessions

  • ~/.claude/projects/<dash-encoded-cwd>/*.jsonldataofficialall

    Per-project session transcripts in JSONL format.

  • ~/.claude/history.jsonldataofficialall

    Global prompt history across all projects.

instructions

  • CLAUDE.mdprojectofficialall
  • .claude/CLAUDE.mdprojectofficialall

    Alternative project-level location.

  • ~/.claude/CLAUDE.mduserofficialall

    Global user-level instructions.

skills

  • .claude/skills/projectofficialall
  • ~/.claude/skills/userofficialall

    Global user-level skills.

commands

  • .claude/commands/projectofficialall

    Legacy slash commands, merged into skills.

  • ~/.claude/commands/userofficialall

    Legacy global slash commands.

promptTemplates

  • .claude/commands/projectofficialall

    Legacy slash commands, merged into skills.

  • ~/.claude/commands/userofficialall

    Legacy global slash commands.

hooks

  • .claude/hooks/projectofficialall
  • ~/.claude/hooks/userofficialall

    Global user-level hooks.

temp

  • ${TMPDIR}/claude-<uid>/dataofficiallinux

    Session scratchpads sit under <dash-encoded-cwd>/<session-id>/scratchpad.

  • /tmp/claude-<uid>/dataofficialdarwin
  • ${TMPDIR}/claude/dataofficialwin32

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.

EnvenvOverrides3 variables
  • CLAUDE_CONFIG_DIR~/.claudeconfig · sessions · instructions · skills · commands · promptTemplates · hooks

    Read from the shell or the env block of user or managed settings, not project settings.

  • CLAUDE_CODE_TMPDIR${TMPDIR}temp · linux, win32

    Read from the shell or the env block of user or managed settings, not project settings.

  • CLAUDE_CODE_TMPDIR/tmptemp · darwin

    Read from the shell or the env block of user or managed settings, not project settings.

MCP servers

FilemcpConfigs2 files
  • ~/.claude.jsonuser · json · standard · mcpServers
  • .mcp.jsonproject · json · standard · mcpServers

Detection

CalldetectHarness()env, then project

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.