Claude Code stuffs every tool output into context and never throws anything away. By step 10, your agent is reading step 1's bash output — and making worse decisions because of it. Optexai ranks and filters in real-time. Same results. Up to 45% fewer tokens than RTK.
No API keys to rotate. No code changes. No workflow changes. From install to optimized in about 10 seconds.
$ npx optexai setup✓ Proxy installed on 127.0.0.1:8787✓ CA certificate trusted✓ Claude Code configuredReady — no restart required.
$ claude⏵ optexai · active -62% input tokens⏵ ranking context (step 4) …✓ stripped 12.4k tokens of stale outputEvery request — optimized, transparently.
Free for individuals. MIT-licensed CLI.
Claude Code appends every tool output and result to the context window with no pruning. By step 10, the model is reading your step 1 bash output. That's your token budget.
Each agent iteration appends tool outputs, results, and reasoning — without any pruning or relevance check.
Early steps that no longer matter remain in the prompt, consuming tokens that could go toward what's relevant now.
Long-context benchmarks show accuracy drops as irrelevant history accumulates. You're not just paying for noise — it's actively making your agent worse at the current step.
Every redundant token costs money and burns rate-limit capacity — regardless of whether it contributes to the output.
Optexai runs as a lightweight HTTPS proxy alongside Claude Code. No changes to your code or workflows.
Each request is analyzed in real-time. Prior context is ranked by relevance to the current step. Low-signal history is compressed out.
A focused, high-signal prompt reaches Anthropic's API. Context stays bounded across the entire agent run — automatically.
Per-command savings measured across 13,000+ real compactions. Every bar is a real tool call — left is what Claude Code sent, right is what Optexai forwarded.
RTK rewrites your CLI commands before they reach Claude — a useful trick, but it only touches Bash tool outputs and misses the conversation history, file reads, and thinking blocks that dominate real agent sessions. Worse: aggressive command filtering throws away context the model actually needed. Our SWE-bench trials show RTK can cut task reward scores by up to 30%. Optexai ranks context by relevance to the current step — so it strips noise, not signal.
| Task | RTK v0.35.0 | Baseline | Optexai |
|---|---|---|---|
| astropy | 1.98M tokens· reward 0.60 | 1.84M tokens· reward 0.85 | 1.06M tokens· reward 0.85-47% vs RTK |
| django | 2.71M tokens· reward 0.95 | 2.21M tokens· reward 0.91 | 1.38M tokens· reward 0.91-49% vs RTK |
| matplotlib | 1.68M tokens· reward 0.95 | 1.65M tokens· reward 1.00 | 0.93M tokens· reward 1.00-45% vs RTK |
Reward = SWE-bench normalized patch correctness score (higher is better). RTK's filtering improves token count but hurts task quality — Optexai matches baseline quality while cutting deeper. ~20 trials per task on SWE-bench Verified.
Stay focused during long Claude Code runs. Plug in once and immediately get more from every session — no configuration needed.
When 10 engineers run 3 Claude sessions a day, context bloat compounds fast. One runaway sub-agent can balloon a $0.02 task to $2.00. Optexai caps context growth across the whole team — predictably, automatically, without touching a single line of code.
Your source code and context content are never stored. Only anonymized per-command-type statistics are retained temporarily for your dashboard.
Aggregated usage statistics — which command types waste context, how much was saved — are kept for a limited time to power your dashboard, then discarded.
Works as a transparent proxy alongside Claude Code. No modifications to your codebase, workflows, or tooling.
Yes, Optexai intercepts HTTPS traffic via a local proxy — that's how it reads and filters context before it reaches Anthropic. Your source code never leaves your machine. The CA cert is trusted locally, and all filtering happens in-process. Full source available for audit.
Start optimizing your Claude Code context today. Free for individuals.