Set up the MCP server
trail init registers the Trail-code MCP server with agents that support it, so its six tools appear natively, no shell required. See MCP tools for what each one does.
Claude Code
Section titled “Claude Code”trail init writes the server into the project’s .mcp.json. Restart Claude Code to load it.
Register it by hand
Section titled “Register it by hand”Register it by hand if your agent needs it explicit:
{ "mcpServers": { "trail": { "command": "npx", "args": ["-y", "@trailhq/trail-code", "mcp"] } } }Run it by hand
Section titled “Run it by hand”trail mcp [dir]Skip MCP registration
Section titled “Skip MCP registration”Pass --no-mcp to trail init to skip MCP registration for agents other than Claude Code.
Hooks for CLI agents
Section titled “Hooks for CLI agents”Where a CLI agent supports user-level hooks.json, as Codex does, init also installs Trail-code’s hooks there: session start, context with each prompt, blast radius and a $0 graph re-sync after edits, and the end-of-turn sync. Skip them with --no-hooks.