Windsurf · Updated 2026-11-16
Reduce Windsurf Token Usage: Compress Context in Cascade
Long Cascade conversations carry every terminal run, file read and MCP result forward. Here is where Windsurf tokens go, the habits that cut them, and how SuperCompress gives Cascade a tool that keeps only the lines that answer your question.
npm install -g supercompress-proxy && supercompress setup to link your account and install the supercompress-mcp server, add one supercompress entry in the Cascade MCP config (shown below), and ask Cascade to compress large logs and files with compress_context.
Where Windsurf tokens go
- The conversation so far. Earlier messages and tool results go back to the model as the conversation continues.
- Terminal output and file reads. Full logs and full files, even when a few lines matter.
- MCP tools. Every enabled tool adds its definition.
- Rules and memories. Always-on rules are added to requests.
Habits that cut Windsurf token usage for free
- One task per conversation. Start a new Cascade conversation when you switch work.
- Ignore what the agent never needs. Keep build output, vendored code and generated files out of reach.
- Trim always-on rules. Keep them short and scoped.
- Switch off unused MCP tools. Each enabled tool adds to every request.
- Point at files. Mention the files you mean instead of asking for a broad search.
These habits shrink what goes in. They don't help when the agent genuinely needs to run a test suite or read a large file and only a few lines of the output matter. That is the part SuperCompress handles.
How SuperCompress works
SuperCompress is hosted, extractive and query-aware. Your agent sends a large block of context (a log, a diff, a file read, an MCP result) together with the question it is working on. It keeps the original lines that answer that question and drops the rest. It selects lines from the original rather than writing a summary, so file paths, error messages, IDs and code in the kept lines stay as written; preprocessing may rewrite JSON or collapse repeated stack frames before lines are chosen. See how prompt compression works. The question itself is never compressed.
In Windsurf the compress_context MCP tool reports original_tokens and compressed_tokens (the hosted API calls the second one kept_tokens); they are estimates, not provider-billed totals, and when the savings would be too small the tool returns a passthrough notice instead of a digest (no compressed_tokens, and the content is not sent back), so the agent keeps using its original text. The usage_summary MCP tool shows what your account saved this month.
What the SuperCompress MCP entry adds to Windsurf
| What | Where | What it does |
|---|---|---|
| MCP server entry (added by you) | ~/.config/devin/mcp_config.json (%APPDATA%\devin\mcp_config.json on Windows). Windsurf is now Devin Desktop, and Cascade reads this file; open it from the Cascade panel menu > MCPs > Open MCP config file. | Gives the agent the compress_context, connect_account and usage_summary tools. |
Once the entry is in place, Cascade can call the SuperCompress tools. Ask Cascade to run large logs, diffs and files through compress_context with your question as the query, or add that as a rule of your own.
Install
npm install -g supercompress-proxy && supercompress setup
Setup links your SuperCompress account in the browser and installs the supercompress-mcp server command. Windsurf is now Devin Desktop, and Cascade reads its MCP configuration from ~/.config/devin/mcp_config.json (%APPDATA%\devin\mcp_config.json on Windows), so you add the entry there yourself in the next step.
Add the MCP entry
In the Cascade panel, open the menu, choose MCPs, then Open MCP config file, and merge this into the existing mcpServers object (keep the servers already there):
{
"mcpServers": {
"supercompress": {
"command": "supercompress-mcp",
"args": []
}
}
}
No API key goes in this entry; supercompress setup already linked your account. Save the file, then restart the app or refresh the Cascade MCP list, and confirm the server answers:
supercompress doctor
doctor prints a per-agent health check, and supercompress mcp-check confirms the MCP server answers. supercompress uninstall removes only the entries SuperCompress added, and the supercompress entry you added by hand comes out by deleting it from the same MCP config file. Setup backs up each config file before it edits it.
Comparing this with other ways to cut tokens? See context compression for coding agents.
When to skip it
- Short sessions with small tool results. There is little to drop.
- Files the agent is about to edit line by line. It needs those in full.
- Work where every byte must be passed through unchanged for compliance reasons.
FAQ
Does SuperCompress change how I sign in to Windsurf?
No. You keep your normal Windsurf login and models. SuperCompress adds an MCP server and instructions to Windsurf; your model traffic does not pass through SuperCompress.
Does SuperCompress summarize what Windsurf reads?
No. It is extractive. It keeps lines copied from the original output rather than writing a summary, so file paths, error messages and code in the kept lines stay as written. Preprocessing may rewrite JSON or collapse repeated stack frames first.
How do I undo the Windsurf setup?
Run supercompress uninstall for what setup added. It removes only the entries SuperCompress added, so your other MCP servers, hooks and instructions stay as they were. The supercompress entry you added by hand is removed by deleting it from ~/.config/devin/mcp_config.json.