DotnetTokenKiller

A .NET CLI proxy that reduces LLM token usage by filtering the verbose output of dotnet commands down to only what matters.

When you feed dotnet build or dotnet test output to an LLM, most of it is noise — SDK banners, MSBuild headers, progress lines, ANSI escape codes, duplicate error messages. DTK strips all of that and returns a compact, signal-only result. Fewer tokens in means lower cost and less context consumed.

Quick Start

# Install (requires .NET 10 SDK — full SDK, not just runtime)
dotnet tool install -g DotnetTokenKiller

# Use — just prefix any supported dotnet command with dtk
dtk dotnet build
dtk dotnet test
dtk dotnet restore
dtk dotnet clean
dtk dotnet format
dtk dotnet list package --outdated

Key Features

  • Build filtering — strips MSBuild noise, keeps only errors, warnings, and a compact summary (~78% savings)
  • Test filtering — removes xUnit/NUnit/MSTest adapter banners, license warnings, and reflection stack frames; shows only failures with clean relative paths (~84% savings)
  • Restore/Clean filtering — condenses restore and clean output to essentials (~47–98% savings)
  • Format filtering — shows only violations with workspace-relative paths
  • list package filtering — collapses per-TFM duplication across plain, --outdated, --deprecated, and --vulnerable (~80.9% savings)
  • Pipe modedtk pipe <subcommand> filters output dtk did not produce (CI logs, missed invocations)
  • Log retrievaldtk log retrieves a previous run's full output without re-running it
  • Token analytics — tracks per-command token savings over time with dtk gain
  • Log teeing — optionally saves raw output to disk for post-mortem inspection
  • AI agent integrationdtk integrate installs hooks for 8 providers: Claude Code, GitHub Copilot, GitHub Copilot CLI, Gemini CLI, Cursor, Windsurf, Aider, and JetBrains AI
  • Self-diagnosticsdtk doctor validates your setup in one command
  • Shell completion — bash, zsh, fish, and PowerShell via dtk completion

How It Works

DTK intercepts dotnet subcommands, runs them, and applies per-command output filters before returning the result. The filtered output is what your LLM — or you — actually needs:

Command Typical Savings
build ~78%
test ~84%
clean ~98%
restore ~47%
format varies
list package ~80.9%

Documentation