Claude Code

Run Claude Code through api.hanzo.ai with hanzo code claude: what is routed, what is not, and how to keep your own plan.

Set up

curl -fsSL hanzo.sh | sh
hanzo login
hanzo code claude

Give it a task as one quoted argument to run it headless: hanzo code claude "fix the failing test in api/users". claude-code and cc are accepted spellings of claude.

What goes through Hanzo

With a signed-in account and no --no-route:

  • Model calls go to https://api.hanzo.ai. The wrapper points Claude Code at it with ANTHROPIC_BASE_URL and sends your Hanzo token as the bearer in ANTHROPIC_AUTH_TOKEN, and clears any ANTHROPIC_API_KEY in your shell so one credential is in play. The token goes to the process through its environment, never its arguments.
  • The model is enso-auto unless you set another with --model, ANTHROPIC_MODEL or model in ~/.hanzo/settings.json. Claude Code is handed a claude-* name so it grants the model's real context window, and the wrapper maps that name back to the Hanzo model before the request leaves the process.
  • Usage is metered into your org at api.hanzo.ai, so it appears in the cloud whichever machine you ran on.
  • The Hanzo toolset (hanzo-mcp, if installed or reachable with uvx) and your org's cloud tools are added to Claude Code's MCP servers. The cloud tools ride only a routed run, because only then does the process already hold your token.
  • The session is registered in the cloud with its machine and directory, and its messages and tool calls stream there. Pass --no-link to keep it local.
  • Claude Code's home for the run is ~/.hanzo/claude, so its saved model choice and your Hanzo settings do not overwrite each other.

What does not

  • A repository's own .mcp.json and .claude/settings*.json hooks do not load, because a repository is untrusted and its hooks would run with your token in the environment. --project-mcp opts in for a repository you trust.
  • With --ask the tool asks before each action. By default the wrapper starts Claude Code with --dangerously-skip-permissions, as autoApprove in ~/.hanzo/settings.json says.

See usage and savings

A linked headless run prints its reported tokens, the cached share and the cost at the listed price when it ends. Any other routed run prints the cloud's count for the session window, since an interactive Claude Code reports nothing to the wrapper. Then:

hanzo console          # press 6 for Savings
hanzo usage summary --range 7d

How to read the numbers →

Keep your own plan

hanzo code claude --no-route

Claude Code uses its own login in ~/.claude, and its environment is left as your shell has it. Hanzo meters none of that traffic and the end-of-session block says so.

Was this page useful?
Last updated Oct 12, 2026