Claude Code
Route Claude Code through naxxen for prompt compression.
Claude Code uses the Anthropic API and supports a custom base URL via the ANTHROPIC_BASE_URL environment variable.
Configuration
Set the ANTHROPIC_BASE_URL environment variable to your naxxen endpoint with your key in the path:
export ANTHROPIC_BASE_URL="https://api.naxxen.ai/nxn-sk-YOUR_NAXXEN_KEY"Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.) to make it permanent.
Then use Claude Code as normal. Your existing Anthropic authentication (OAuth or API key) continues to work — naxxen forwards it unchanged.
How it works
- Claude Code sends requests to
https://api.naxxen.ai/nxn-sk-YOUR_KEY/v1/messages - naxxen strips the key, compresses system prompts and conversation history
- The compressed request is forwarded to
https://api.anthropic.com/v1/messages - Claude's response streams back through naxxen to Claude Code
Claude Code uses Anthropic OAuth (not an API key) for authentication. naxxen passes the OAuth bearer token through to Anthropic unchanged — no special configuration needed.
Verify
Run Claude Code and make a request. Then check your dashboard — you should see the request with compression stats. Requests from Claude Code will show as anthropic provider with the Claude model you're using.
Revert
To stop using naxxen, unset the variable:
unset ANTHROPIC_BASE_URLOr remove it from your shell profile.
Set up with an AI agent
Copy this prompt and give it to your AI coding agent:
Read https://docs.naxxen.ai/llms.txt and configure Claude Code to use
naxxen for prompt compression. My naxxen key is nxn-sk-YOUR_KEY.
Set ANTHROPIC_BASE_URL in my shell profile.