Claude Code
Claude Code is Anthropic’s official CLI tool for interacting with Claude directly from your terminal. By routing Claude Code through Shinzo, you gain comprehensive visibility into your AI usage patterns, token consumption, response times, costs, and full conversation traces with tool usage.How It Works
Shinzo acts as a proxy between Claude Code and the Anthropic API. All requests are forwarded through Shinzo, which records analytics data before passing the request to Anthropic with your stored provider key. What’s captured:- Conversation flow (prompts, responses, context)
- Tool calls and results
- Token usage and costs (including cache usage)
- Performance metrics (latency)
- Error traces
Prerequisites
Before you begin, ensure you have:- A Shinzo account - Sign up at app.shinzo.ai
- Claude Code installed - Get it from GitHub
- Your Anthropic API key stored in Shinzo - Add it in Settings > API Keys > Provider Keys
- A Shinzo API key - Create one in Settings > API Keys > Shinzo Keys
Setup Guide
Follow these steps to configure Claude Code with Shinzo:Add your Anthropic API key to Shinzo
- Go to app.shinzo.ai
- Navigate to Settings > API Keys
- Click the Provider Keys tab
- Click Add Provider Key
- Select Anthropic as the provider
- Paste your Anthropic API key from the Anthropic Console
- Add a descriptive label (e.g., “Claude Code Production”)
- Click Save
Your key will be validated and encrypted before storage.
Create a Shinzo API key
- In the API Keys page, click the Shinzo Keys tab
- Click Create Key
- Give your key a descriptive name (e.g., “Claude Code Desktop”)
- Copy the generated key (you won’t see it again)
Configure Claude Code environment variables
Set the following environment variables to route Claude Code through Shinzo:
- macOS / Linux
- Windows (PowerShell)
- Windows (Command Prompt)
Add to your shell configuration file (Then reload your shell:
~/.bashrc, ~/.zshrc, etc.):Configuration Breakdown:
ANTHROPIC_BASE_URL: Redirects Claude Code to Shinzo’s Anthropic proxy endpointANTHROPIC_CUSTOM_HEADERS: Passes your Shinzo API key for authentication
Verify the configuration
Test your configuration by running a simple Claude Code command:Then check the Shinzo Dashboard to see your conversation appear.
First-time login flow:When you first run Claude Code with Shinzo configured, you may see several login screens. Follow these steps:
- When prompted to choose a login method, select “Anthropic Console account · API usage billing” (not a subscription-based option)
- If you see “Detected a custom API key in your environment… Do you want to use this API key?”, select “No (Recommended)”
- You may need to restart
claudeafter completing login for Shinzo observability to take effect
If you see your conversation in the dashboard with full trace details, you’re all set!
What Data is Collected?
When you use Claude Code through Shinzo, the following data is automatically captured by the proxy:Conversation Data
- User prompts: The questions or commands you send to Claude
- Agent responses: Claude’s text responses
- Conversation context: Full conversation history and context
- Model configuration: Model version, temperature, max tokens, etc.
- Timestamps: When each message was sent and received
Tool Usage
- Tool calls: Which tools Claude invokes (file operations, bash commands, etc.)
- Tool parameters: Arguments passed to each tool
- Tool results: Output returned from tool executions
Performance Metrics
- Response time: Latency from request to response
- Token counts: Input and output tokens per message
- Cache usage: Cache creation and cache read tokens
- Costs: Estimated cost per conversation based on model pricing
All data is sent securely over HTTPS and encrypted at rest in Shinzo’s infrastructure.
Viewing Your Data
Once configured, you can view your Claude Code data in the Shinzo dashboard:Agent Analytics Dashboard
Navigate to Analytics > Agent Analytics in the Shinzo dashboard to see:- Conversation traces: Full conversation flows with timing data
- Tool usage patterns: Which tools are used most frequently
- Token consumption: Token usage over time with cost breakdown
- Performance trends: Response times and throughput metrics
Agent Analytics Dashboard
Learn more about the agent analytics dashboard
Individual Conversation View
Click on any conversation to see:- Full conversation transcript: All messages in the conversation
- Token breakdown: Detailed token usage per message including cache hits
- Performance metrics: Latency for each interaction
Troubleshooting
Conversations not appearing in dashboard
Conversations not appearing in dashboard
-
Verify environment variables:
- Check that
ANTHROPIC_BASE_URLis set tohttps://api.app.shinzo.ai/spotlight/anthropic - Verify
ANTHROPIC_CUSTOM_HEADERScontains your Shinzo API key
- Check that
-
Check API key:
- Ensure your Shinzo API key is valid and not revoked
- Verify your Anthropic provider key is stored in Settings > API Keys > Provider Keys
-
Test connectivity:
Should return
200 OK.
Authentication errors
Authentication errors
- 401 Unauthorized: Your Shinzo API key is invalid or revoked. Check Settings > API Keys in the Shinzo dashboard.
- 403 Forbidden - Subscription not supported: You’re using a Claude subscription OAuth token. Shinzo requires an API key from the Anthropic Console.
- 403 Forbidden - Invalid provider key: Your Anthropic API key stored in Shinzo may be invalid. Update it in Settings > API Keys > Provider Keys.
Claude Code performance issues
Claude Code performance issues
If Claude Code feels slower after enabling Shinzo:
- Check network latency: Run
ping api.app.shinzo.aito verify connectivity - Check firewall: Ensure your firewall allows HTTPS to
api.app.shinzo.ai
Disabling Shinzo observability
Disabling Shinzo observability
To stop routing through Shinzo, unset the environment variables:Or remove them from your shell configuration file and reload your shell.
Privacy & Security
- Encryption in transit: All requests are sent over HTTPS
- Encryption at rest: Data is encrypted in Shinzo’s database
- Access control: Only you can access your data
- No training: Your data is never used to train AI models
- Provider key security: Your Anthropic API key is encrypted and never exposed to client-side code
Next Steps
Agent Analytics Dashboard
Explore your agent conversation data and metrics
Anthropic SDK
Set up analytics for custom agents built with the Anthropic SDK
MCP Analytics
Add observability to your MCP servers
Contact Support
Get help or contact us about your use case

