PUNKthe adaptive runtime

//DOCS Claude Code

Route Claude Code through Punk as a model backend and add Punk runtime tools through MCP.

Claude Code Runtime

Punk can sit under Claude Code in two stackable modes:

ModeUse it when
Model backendYou want Claude Code's Anthropic-compatible model traffic to flow through Punk.
MCP runtime toolsYou want Claude to call Punk workflows, semantic web fetches, savings, approvals, and route explanations as tools.

These modes can be used together. Claude stays the interface; Punk becomes the runtime layer underneath it.

Launch Claude Code Through Punk

Prerequisites: the Claude Code CLI on PATH, Punk hosted gateway access, and a tenant API key.

export PUNK_API_KEY=pk_...
bun run cli -- launch claude \
  --gateway-url https://app.punktechnologies.com \
  --api-key env:PUNK_API_KEY \
  --model punk/chorus \
  -- --print "summarize this repo"

The launcher points Claude Code at Punk's Anthropic-compatible endpoint and clears parent-shell Anthropic credentials so model traffic cannot accidentally bypass the gateway.

Useful options:

OptionDefaultMeaning
--model <id>claude-sonnet-4-6Claude Code model id. Use punk/chorus for governed Chorus routing.
--gateway-url <url>https://app.punktechnologies.comPunk hosted gateway receiving Claude's /v1/messages traffic.
--api-key <token>PUNK_API_KEYGateway bearer token when auth is enabled.
--claude-bin <path>claudeClaude Code executable.
--dry-runoffPrint the resolved command and environment without launching Claude.

Add Punk As An MCP Server

Register Punk's Runtime Engine MCP server with Claude Code:

claude mcp add punk --env PUNK_GATEWAY_URL=https://app.punktechnologies.com --env PUNK_MCP_API_KEY=$PUNK_API_KEY -- bun run --cwd /path/to/punk mcp

Verify without Claude:

PUNK_GATEWAY_URL=https://app.punktechnologies.com PUNK_MCP_API_KEY=$PUNK_API_KEY bun run mcp --selfcheck

The MCP server exposes runtime tools for workflows, semantic web fetches, savings, approvals, and run explanations. It does not replace the gateway path; it gives Claude direct runtime tools in addition to model-backend routing.

What Punk Adds To Claude Code

CapabilityResult
Route visibilityEvery Claude model request can become a Punk run with route explanation.
GovernancePolicies and approvals can apply to tool and web side effects.
Cost controlRepeated compatible requests can hit cache or proven artifacts.
EvidenceRuns, receipts, trace events, and side-effect records stay inspectable.
WorkflowsClaude can discover and run Punk workflows through MCP tools.

Troubleshooting

SymptomCheck
Claude Code talks directly to AnthropicStart it through punk launch claude and verify ANTHROPIC_BASE_URL in --dry-run.
Tools do not appearRun claude mcp list and bun run mcp --selfcheck.
No run appears in PunkConfirm Claude traffic targets the Punk gateway origin, not Anthropic directly.
Auth failsPass --api-key env:PUNK_API_KEY or set PUNK_API_KEY consistently for the launcher and MCP runtime.

Read next: Anthropic SDK, Chorus, OpenAI-Compatible AI Gateway.