Search This Blog

Saturday, July 18, 2026

⏬Optimize Claude and avoid hitting token/compute limits!



The Core Equation

The transcript establishes that running out of limits is a matter of total compute budget, not just raw token count. The system runs on a strict formula:

Compute Budget Used = Tokens Consumed X Model Used

To stop hitting limits, you must optimize either the tokens consumed or the model tier you are running.

Part 1: Quick Wins (Token Optimization)

1. Fix Contextual Habits

As a chat progresses, the context window fills up, exponentially draining your compute.

  • Clear Tasks: Run /clear or start a new chat whenever you switch tasks.

  • Work in Focus Blocks: Avoid leaving a chat for more than 5–10 minutes to maintain Claude's smart caching benefits (which expire on delayed responses).

  • Adjust Effort: Lower the default execution effort (low/medium/high) in the desktop app to reduce compute per task.

  • Compress Threads: Type /compact when the context window reaches roughly 60% capacity to summarize the history and save space.

2. Contextual Cleanup

Preloaded data takes up token space before you even type a word. Type /context in a fresh chat to see what is preloading, then clean it up:

  • Manage MCPs: Run /mcp and delete any unused Model Context Protocol extensions.

  • Trim Skills: Archive unused skills and shorten overly wordy skill descriptions.

  • Optimize claude.md: This file is read on every single message. Keep it under 200 lines and focus on high-level interaction rules rather than deep project documentation.

3. Reduce Output Tokens

Output tokens are a smaller percentage of overall use but still consume budget.

  • Add instructions to your claude.md telling Claude to "be concise."

  • Alternatively, use community tricks or plugins (like the "Caveman" plugin) to strictly force ultra-short responses.

Part 2: System Upgrades (60% to 90% Efficiency Gains)

1. Compress Inputs via RTK

Instead of dumping raw, multi-page logs or files into Claude, use an open-source preprocessing tool like RTK.

  • RTK uses deterministic computer logic to clean up text, remove boilerplate/formatting noise, and eliminate repeated text before passing it to Claude.

  • Tests show this can reduce input token sizes by 60% to 90%.

2. Subagents on Minimum Viable Models (MVM)

Not every task requires a top-tier frontier model. If an AI could solve a task a year ago (e.g., basic scraping, formatting, file fetching), use a lighter model like Haiku instead of Sonnet/Opus, saving up to 90% compute.

  • Define the model inside specific Claude "Skills."

  • Use context: fork inside a skill to spin up a completely fresh thread, preventing the main conversation's massive context history from bloat-loading into the subtask.

3. Script-Driven Skills

For entirely repeatable tasks, transition the workflow away from AI. Use computer logic or code scripts wrapped inside a Claude skill.

Rule of thumb: Use AI for judgment, and use scripts for repeatable execution. Scripts cost zero tokens and eliminate hallucinations.

Part 3: Nuclear Enhancements (Advanced Shifts)

EnhancementDescriptionPros/Cons
1. Route Work to CodexInstall a Codex plugin to have Claude route execution-heavy, token-burning tasks to OpenAI's infrastructure.

Pros: Codex can be up to 4x more efficient for surgical code edits.


Cons: Requires managing two ecosystems.

2. Images Instead of TextUse tools like PXpipe to convert large blocks of text into an image before uploading it.

Pros: Can result in a 60–70% token reduction.


Cons: Slight risk of text misinterpretation; might be patched by Anthropic.

3. Swap the Engine EntirelyChange environment variables in Claude Code to route requests to cheaper external providers (e.g., DeepSeek or GLM).

Pros: Drastically higher compute capacity per dollar.


Cons: Slight drop in model intelligence; data privacy considerations.

4. Run Local ModelsRoute requests to an office server or hardware (like a Mac Mini) using open-source models.

Pros: Infinite, free tokens; 100% data privacy.


Cons: Consumer hardware cannot run top-tier frontier models; high setup and maintenance costs ($10k+ for equivalent hardware). Not recommended for most users right now.

Summary Checklist (Speed Run)

  1. Every Task Switch: Run /clear.

  2. At 60% Context: Run /compact.

  3. claude.md Limit: Keep it under 200 lines.

  4. Pre-processing: Install RTK to compress inputs.

  5. Delegation: Push grunt work to Haiku (MVM) and repeatable tasks to Scripts.

  6. Heavy Coding: Route heavy edits to Codex.

Credits: https://www.youtube.com/watch?v=SFh6MMe-XcM