I built a BYOK VS Code agent that cuts token costs by compressing old chat turns
Description and use
CodeCook is a VS Code extension that compresses old chat turns and tool output, reducing token usage and costs when interacting with large language models. It provides checkpoints, plan persistence, and cost visibility.
Problem
In a long AI coding session, every turn resends everything you already paid for: all the old messages and all the tool output. The bill keeps growing even when the work doesn't.
Outcome
CodeCook compresses old chat turns, cutting token usage by up to 98% for individual turns and providing visible cost tracking, plan persistence, and checkpointed edits.
Workflow
- Install CodeCook from the Marketplace
- Open CodeCook and sign in with Google or GitHub to create a local account
- Connect an LLM provider (Google Gemini, OpenAI, Anthropic Claude, Azure OpenAI, or AWS Bedrock)
- Ask the agent to work on the workspace and review diffs
Evidence
In a long AI coding session, every turn resends everything you already paid for: all the old messages and all the tool output.
CodeCook is a free, MIT-licensed VS Code extension: a coding agent in your sidebar that you run with your own API key (BYOK).
In one long agent session, a single turn went from 800,787 to 14,857 tokens (about 98% fewer) with the plan and work intact.
- Record date: 2026-10-11T19:56:12.108Z