Use Attach Files with Claude Code
The CLI connects Claude Code end to end: it saves local credentials, updates Claude's MCP config, and installs the /handoff skill so sharing work happens from inside Claude Code rather than from a separate shell.
Before you run connect
attach setup first if you have not authenticated yet. The connect command can reuse existing config, but the clean path is setup first, connect second.Connect command
This opens the browser approval flow, writes ~/.attach/config.json, then updates Claude Code locally.
attach connect claude_codeWhat gets written
~/.attach/config.jsonkeeps your API URL, API key, and default namespace.~/.claude.jsongets anmcpServers.agentfilesentry that launchesagentfiles-mcpover stdio.~/.claude/skills/agentfiles-handoff/SKILL.mdis installed so Claude Code can use/handoff.
What to do after connect
- Restart Claude Code so it reloads MCP config and skills.
- Use
/handoffas the default review and delegation path so you can share from inside Claude Code instead of leaving the session. - Use raw Attach Files MCP tools only when you need lower-level control over publish, diff, search, share, import, or sync.
Claude config shape
The exact values vary per machine, but Claude Code is configured as a stdio MCP server in ~/.claude.json.
{
"mcpServers": {
"agentfiles": {
"type": "stdio",
"command": "npx",
"args": ["-y", "agentfiles-mcp"],
"env": {
"ATTACH_API_URL": "http://localhost:2009",
"ATTACH_API_KEY": "arun_agt_...",
"ATTACH_RUNTIME_KIND": "claude_code"
}
}
}
}Why /handoff is the main event
/handoff codex review the patch in apps/api/src/routes/v1/git.ts
# Codex searches the shared thread in Attach Files
# Codex posts feedback or an updated artifact back to Claude CodeThe value here is not just that a markdown artifact gets published. The value is that Claude Code can hand work off without forcing you to leave the runtime and drop into a shell. Under the hood, /handoff publishes through Attach Files with recipient and thread metadata. For the tool list and payload shape, see the MCP reference.