Skip to main content
  1. Sign up — Create an account at platform.respan.ai
  2. Create an API key — Generate one on the API keys page
  3. Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page
Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.
{
  "mcpServers": {
    "respan-docs": {
      "url": "https://docs.respan.ai/mcp"
    }
  }
}

What is Claude Code?

Claude Code is Anthropic’s agentic coding tool that lives in your terminal. It can understand your codebase, edit files, run commands, and handle complex multi-step coding tasks using extended thinking and a rich set of built-in tools.

Setup

Prerequisite: Claude Code must be installed before integrating with Respan.
npm install -g @anthropic-ai/claude-code
1

Install the Respan CLI

npm install -g @respan/cli
2

Set your API key

export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
3

Integrate

respan integrate claude-code
This automatically configures Claude Code’s hooks to send traces to Respan.
4

Use Claude Code normally

claude "Refactor the auth module to use JWT tokens"
All conversations are now traced automatically — no changes to your workflow.
5

View your traces

Open the Traces page to see your Claude Code conversations with full hierarchy — thinking blocks, tool calls, and responses.

Configuration

Customize the integration with flags:
respan integrate claude-code --customer-id "frank" --project-id "proj-123" --span-name "my-app"
FlagEnv varDefaultDescription
--globalBothWrite user-level global config (~/.claude/settings.json).
--localBothWrite per-project config (.claude/settings.local.json).
--customer-idRESPAN_CUSTOMER_IDCustomer/user identifier for traces.
--project-idRESPAN_PROJECT_IDRespan project ID.
--span-nameclaude-codeRoot span name.
--workflow-nameclaude-codeWorkflow name for traces.
--attrsCustom attributes JSON (e.g. '{"env":"prod"}').
--base-urlRESPAN_BASE_URLhttps://api.respan.ai/apiRespan API base URL.
--dry-runPreview changes without writing files.

Captured Data

DataDescription
User promptThe user’s input text
Assistant responseClaude Code’s final response
Thinking blocksExtended thinking / reasoning content
Tool callsTool name, input, and output (Read, Write, Bash, Glob, Grep, etc.)
Token usageInput, output, and cache tokens
TimingStart time, end time, latency
ModelModel name used (e.g. claude-sonnet-4-20250514, claude-opus-4-20250514)

Span Types

Spanlog_typeDescription
RootagentThe complete conversation turn
ThinkinggenerationExtended thinking / reasoning blocks
TooltoolTool invocations (file reads, writes, shell commands, glob, grep, etc.)

Uninstall

To remove the integration:
respan integrate claude-code --remove