claude-context-editor
v0.1.4
Published
Real-time context window viewer and editor for Claude Code
Downloads
606
Maintainers
Readme
Claude Context Editor
Real-time context window viewer and editor for Claude Code.
See exactly what Claude Code sends to the API — system prompts, messages, tool definitions, and token counts — and optionally edit messages before they're sent.
How it works
Claude Code ──POST /v1/messages──▶ Proxy (8080) ──▶ api.anthropic.com
│
│ WebSocket
▼
Web UI (3000)A local proxy intercepts Claude Code's API requests using the ANTHROPIC_BASE_URL environment variable. A web UI displays the full context window in real-time via WebSocket.
Quick Start
# Install
npm install -g claude-context-editor
# Start the proxy + web UI
cce
# Then in another terminal:
ANTHROPIC_BASE_URL=http://localhost:8080 claudeThe web UI opens automatically in your browser.
CLI
cce # Start the proxy + web UI
cce --version # Show version
cce --help # Show helpFeatures
Observe Mode (default)
- View every API request in real-time
- Inspect system prompt, messages, and tool definitions
- See token counts per section (system, messages, tools)
- Track API response usage (input/output tokens, stop reason)
Intercept Mode
- Pause requests before they reach the API
- Edit or delete individual messages
- Send modified or original request
- 5-minute timeout (auto-sends original if no action)
Cache Safety
| What you edit | Cache impact | |---------------|-------------| | Messages | Safe — no cache bust | | System prompt | Read-only in UI (would bust cache) | | Tools | Read-only in UI (would bust cache) |
Auto Port Selection
If the default ports (8080, 3000) are in use, the proxy and UI automatically find the next available port (up to +10).
Configuration
Environment variables:
| Variable | Default | Description |
|----------|---------|-------------|
| PROXY_PORT | 8080 | Proxy server port |
| UI_PORT | 3000 | Web UI port |
| UPSTREAM_URL | https://api.anthropic.com | Upstream API URL |
# Custom ports
PROXY_PORT=9090 UI_PORT=4000 cce
ANTHROPIC_BASE_URL=http://localhost:9090 claudeHow Claude Code connects
Claude Code supports ANTHROPIC_BASE_URL natively. When set, all API calls go through the specified URL instead of api.anthropic.com. The proxy forwards headers (authorization, x-api-key, anthropic-version, etc.) and relays SSE streaming responses transparently.
License
MIT
