How They Use AI  |  Newest

<< Home  |  Tech

38% cost reduction per request

AreaTech
AI usedClaude Code
Sourcer/claudeskills
Posted2026-11-04

The move

Lower the autoCompactWindow setting to 400,000 tokens to trigger earlier context compaction.

Steps

  1. Install the tokendoctor plugin to analyze your current session token usage.
  2. Run the dashboard command to identify where your tokens are being spent.
  3. Adjust the autoCompactWindow setting to a lower threshold like 400,000.
  4. Monitor your session costs and performance to ensure the new window size is effective.

Prompt for your AI

Analyze my current Claude Code session history and suggest an optimal autoCompactWindow setting between 200,000 and 600,000 tokens to minimize costs without sacrificing performance.

What happened

The user analyzed their Claude Code usage and found that long context windows were driving up costs. By setting the autoCompactWindow to 400,000, they forced the system to compact context sooner. This change reduced the average context per request from 412K to 219K, resulting in a 38% cost savings per request.

Watch out

Lowering the window size increases the frequency of compactions, which may cause the model to re-read files more often. If your sessions are typically short, this change may not result in any cost savings.

Give it to your agent

Read https://howtheyuse.ai/p/38-cost-reduction-per-request.md and help me do this.

Sources



Last updated November 26, 2026.