A developer analyzed 147 local sessions of Claude Code and Codex to understand token usage and context window costs. The analysis revealed that a small percentage of turns, particularly those exceeding 200K context, accounted for a disproportionately large share of the token expenses. The developer created a Node.js CLI tool called `compactsim` to simulate different context compaction strategies, finding that setting `autoCompactWindow` to 250,000 tokens could reduce weighted token usage by 28.5% with minimal impact on compaction frequency. AI
IMPACT Provides insights into optimizing LLM context window usage and reducing operational costs for developers.
RANK_REASON Developer-created CLI tool for analyzing LLM token usage.
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →