Connect Claude Code

Claude Code talks to Guardrail instead of talking to Anthropic directly. Your own login is relayed untouched, so there is no API key to create, store or rotate.

Connect

bash
guardrail connect claude-code

This writes ANTHROPIC_BASE_URL into your ~/.claude/settings.json, pointing Claude Code at http://localhost:4000. The file’s existing permissions are preserved and any settings already in it are left alone. Restart Claude Code afterwards so it picks up the change.

Check it worked

Run a prompt in Claude Code, then look at the dashboard: a session should appear within a second or two, with its model, token counts and an estimated cost.

bash
guardrail status
guardrail doctor   # if anything looks wrong

What Guardrail sees

The request body is forwarded byte for byte. Guardrail parses the model name and token usage from the response as it streams past, and writes only that. Prompts, responses and code are never stored — see the privacy model.

Disconnect

This restores your previous configuration. Claude Code goes back to talking to Anthropic directly, and your recorded history stays in the local database.

bash
guardrail disconnect claude-code

Pausing instead. To stop recording for a while without changing any configuration, use guardrail pause. Claude Code keeps working and keeps flowing through the proxy; nothing is written down.