{
  "markdown": "# TokenSaver\n\nA **structural warm start** for AI coding agents in .NET. Instead of loading whole files into your assistant, TokenSaver hands it a cheap map of your code — every type and member as a signature, each tagged with its line range — so the model reads only the slice it needs instead of slurping the file. Built on the Roslyn compiler platform.\n\n**Where it pays off:** outlining a file costs **70–95% fewer tokens** than reading it — up to **90% on a large file**. The end-to-end win is biggest on **smaller / cheaper models** (which over-read the most) and on **large codebases**: on real tasks it trims a Haiku-class model's token use by ~8%, and the savings climb with file size. A top-tier model already reads tightly, so it sees less benefit — the leaner the model, the more a warm start helps.\n\nWorks with **Visual Studio 2026** (GitHub Copilot Chat), **Claude Code**, VS Code Copilot, Claude Desktop, and any other MCP client that speaks stdio.\n\n→ **Full docs and setup guide:** [mcp/README.md](mcp/README.md)  \n→ **Changelog:** [CHANGELOG.md](CHANGELOG.md)\n\n---\n\n## Install\n\nSee **[tokensavermcp.com/install](https://tokensavermcp.com/install)** for one-click install buttons, per-client config snippets, upgrade/uninstall instructions, and troubleshooting.\n\n---\n\n## What the tools do\n\n<!-- BEGIN:generated:tools -->\n### Single-file tools\n\n| Tool | What it does | Reduction |\n|---|---|---|\n| `OutlineCSharpFile` | Signatures of every type and member — no bodies. Best for \"what's in this file?\" | 70–95% |\n| `MinifyFile` | Lossless minify of an entire file — strips comments and whitespace, logic unchanged. Auto-dispatches by extension (C#, Razor, JS/TS, Python, HTML, CSS, JSON, YAML, XML, C, C++, X++, VB.NET). | 20–50% |\n\n\\* Reductions are measured against reading the **whole file** — the real alternative when you'd otherwise load it. The **end-to-end** saving on a task is smaller, because a capable model already reads somewhat selectively; it is largest on smaller/cheaper models and large files (see *Token savings in practice* below).\n\n### Cross-file traversal tools\n\nThese scan an entire project directory in one call — no need to know which file to look in first.\n\n| Tool | What it does |\n|---|---|\n| `TraceDiRegistrations` | Finds every Dependency-Injection registration referencing a type (interface or concrete) and returns a compact table of `file:line`, method, `ServiceType -> ImplType`, and key. Answers \"where is IFoo wired, and to what?\" |\n\nBoth accept a directory path or `.csproj` file — `obj/` and `bin/` are excluded automatically.\n<!-- END:generated:tools -->\n\n---\n\n## Token savings in practice\n\nMeasured against this project's own `FocusedEmitter.cs` (9,261 tokens raw):\n\n| Question type | Tool | Tokens sent | Reduction |\n|---|---|---|---|\n| \"What's in this file?\" | `OutlineCSharpFile` | 1,039 | **89%** |\n| \"Read one method body\" | `OutlineCSharpFile` + narrow `Read` of the `// L..` range | ~300 | **~95%** |\n| \"Audit the whole file\" | `MinifyFile` | 5,525 | 40% |\n\nThose are per-read figures versus loading the whole file. The **end-to-end** saving on a real task is smaller, because a capable model already reads somewhat selectively — and that's the honest part of the story:\n\n| Model running the agent | Real-task token saving vs no tool |\n|---|---|\n| Top-tier (reads tightly already) | ~1% — negligible |\n| Mid-tier (Sonnet-class) | ~5–7% |\n| **Smaller / cheaper (Haiku-class)** | **~8%** |\n\nThe leaner the model, the more it over-reads on its own — and the more a warm start saves. TokenSaver is most worth it for **agents running on small/cheap models**, **large files**, or any workflow that would otherwise read whole files. It won't make a top model meaningfully cheaper, and it won't make a model write better code — it curbs wasteful reading, which is where cheap-model token budgets actually leak.\n\n---\n\n## Collective impact\n\nEvery invocation is counted at **[tokensavermcp.com](https://tokensavermcp.com)** — a live dashboard showing total tokens saved by the community. Fewer tokens processed means less GPU compute and a smaller carbon footprint for AI-assisted development.\n\n---\n\n## Language support\n\n| Tier | Languages |\n|---|---|\n| **Primary** (Roslyn, full support) | C# `.cs`, Razor `.razor`, VB.NET `.vb`, .NET project files `.csproj .props .config .xml` |\n| **Basic** (comment-strip + whitespace collapse) | JavaScript, TypeScript, Python, HTML, CSS/SCSS/LESS, JSON/JSONC, YAML, C, C++, X++ |\n\n`OutlineCSharpFile` and `TraceDiRegistrations` are **C# only**; `MinifyFile` works across every supported language.\n",
  "bytes": 4583,
  "sha": "bdc22434c764de95a26a19dc45eaae17d83ff1946fd5324aa7e40f293043b53f",
  "repo_slug": "byggarepop/tokensaver",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_byggarepop_tokensaver_7d8e409f/readme"
}