Stop paying for old chat history: a free BYOK VS Code AI agent that compresses long sessions
Description and use
CodeCook is a VS Code extension that compresses long AI chat sessions to reduce token usage and costs, while offering cost estimates and checkpoints.
Problem
Long AI coding chats become expensive because each turn resends the entire conversation, making later turns cost more than earlier ones.
Outcome
In a long session, a single turn’s token count dropped from about 800k to about 15k, demonstrating significant cost savings.
Workflow
- 1. Install the CodeCook VS Code extension.
- 2. Configure a BYOK model (Gemini, OpenAI, Claude, Azure OpenAI, or Bedrock).
- 3. Start an AI coding session; CodeCook summarizes older turns and tool output.
- 4. Review token and cost estimates per turn and set daily, weekly, or monthly spend caps.
- 5. Use checkpoints to review diffs, revert, or rewind as needed.
Evidence
Long AI coding chats get expensive for a simple reason: every turn resends the whole conversation, so turn 30 costs far more than turn 3.
I built CodeCook to fix that. It's a free, MIT-licensed VS Code extension (disclosure: I'm the author).
Summarizes older turns and bulky tool output so you stop paying for them again
In one long session, a single turn went from about 800k to about 15k tokens.
- Record date: 2026-10-12T21:41:28.185Z