A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Claude Code usage governor: compact professional output, context slimming, tool-output filtering, telemetry, and drift g
Keep long Claude Code sessions sharp under quota pressure.
Reduce noisy tool output, recurring context bloat, and drift without throwing away the clue.
Quick Start · Why Governor · Benchmarks · Commands · Install
Governor is a Claude Code plugin for context hygiene, tool-output filtering, memory compression, telemetry, and drift guardrails.
It is built for the harder problem than "make the model talk less":
keep long Claude Code sessions efficient without making the model dumber.
The installed Claude Code command namespace is still /governor:*.
bash install.sh --force
Restart Claude Code, then run:
/governor:status
/governor:audit
/governor:compress CLAUDE.md
Governor auto-starts in compact professional mode when the plugin is loaded.
Use /governor:off to disable response compression and /governor:on to
re-enable it.
Long Claude Code sessions usually do not fail because Claude writes one extra paragraph.
They fail because context gets polluted:
CLAUDE.md, notes, and rules tax every sessionGovernor is designed for that failure mode.
| Capability | What it does | Why it matters |
|---|---|---|
| Tool-output filtering | Compacts noisy Bash, search, web, task, and MCP-style output when confidence is high | Keeps logs from dominating context |
| Memory compression | Rewrites bloated recurring prompt files into denser, safer forms | Lowers recurring prompt tax |
| Compact mode | Keeps Claude Code responses concise and professional | Reduces avoidable output bloat |
| Telemetry | Reports measured savings, failures, compactions, and waste heat | Lets you see whether Governor is helping |
| Drift guardrails | Adds planning and scope checks for broad tasks | Helps long sessions stay on track |
Most token-saving tools optimize one layer:
Governor is built for the broader session problem:
That is why Governor's benchmark story starts with valid-context loss and decision preservation, not only token counts.
Recent measured Sonnet run with Claude decision grading:
| Condition | Avg token savings | Avg VCLR | Decision preserved | Wrong decision |
|---|---|---|---|---|
| Caveman | 69.1% | 0.14 | 87.5% | 12.5% |
| Governor | 45.5% | 0.00 | 100.0% | 0.0% |
What this means:
Artifacts:
benchmarks/v2-fixture-results.mdbenchmarks/v2-fixture-results.jsonbenchmarks/sonnet-v2-report.mdSame machine, fresh Claude CLI Sonnet sessions, same multi-turn task, same starting repo snapshot.
| Condition | Output Tokens | Cost | Turns | Intent Preserved | Obvious Regression Found |
|---|---|---|---|---|---|
| Control | 10,997 | $0.5169 | 21 | Yes | No |
| Governor | 10,113 | $0.4933 | 22 | Yes | No |
| Delta | -8.0% | -4.6% | +4.8% | Tie | Tie |
This was a narrow pilot, not a universal claim. It matters because Governor kept the implementation contract intact while shaving cost on a real multi-turn coding task.
Structured/local cases focused on the criticism that compaction can miss the real clue.
| Case | Filtered? | Blocked | Signal Preserved |
|---|---|---|---|
| Noisy pytest failure buried in long log | Yes | 64.0% | Yes |
| Burp-style MCP payload with large history + one critical finding | Yes | 90.9% | Yes |
Large Read output containing source code | No | 0.0% | Yes |
RTK is excellent at shrinking shell output.
Governor is aimed at the wider Claude Code session:
Caveman is excellent when the main goal is making Claude talk in fewer tokens.
Governor is built for the broader session problem:
Short version:
RTK compresses commands. Caveman compresses style. Governor protects the session.
Governor is best for:
Governor is less useful for:
SessionStart and UserPromptSubmit hooks keep
responses concise in every Claude Code chat./governor:compress CLAUDE.md rewrites
verbose memory files into dense prose.GOVERNOR_FULL=1 as an env var in the
same Bash call to skip compaction without a separate command. Immune to
parallel-call cancellation./governor:status reports blocked tokens, failures,
compactions, and statusline snapshots when available./governor:guard.| Command | Purpose |
|---|---|
/governor:on | Enable compact professional response mode |
/governor:off | Disable response compression |
/governor:status | Show usage dashboard and waste heat map |
/governor:audit | Find bloated memory/rule files and context waste |
/governor:compress CLAUDE.md | Compress memory files with protected-span validation |
/governor:full | Let the next diagnostic command return full output |
/governor:plan "task" | Produce an implementation contract before broad work |
/governor:guard | Check current changes against the approved plan |
/governor:benchmark | Run or explain the V2 benchmark suite; use refresh-caveman to refresh captured comparators |
/governor:install-rules | Copy compact-mode rules into other-agent projects |
claude --plugin-dir .
bash install.sh --force
gh repo clone 0xhimanshu/governor
cd governor
bash install.sh --force
bash install.sh --project /path/to/project --agents all
Supported rule snippets:
| Agent | Rule File |
|---|---|
| Codex | AGENTS.md |
| Gemini CLI | GEMINI.md |
| Cursor | .cursor/rules/governor.mdc |
| Windsurf | .windsurf/rules/governor.md |
| Cline | .clinerules/governor.md |
Other agents get compact professional behavior only. Claude Code is the V1 target for hooks, telemetry, statusline, and Bash output filtering.
/governor:compress is automatic from the user's point of view:
Compression levels:
| Level | Target |
|---|---|
light | Remove filler and repetition; preserve most rationale |
medium | Collapse narrative into decision bullets |
aggressive | Keep only rules, facts, commands, risks, and decisions |
Set GOVERNOR_ALLOW_LOW_SAVINGS=1 only if you intentionally want to keep a
low-savings compression result.
Governor stores a local JSONL ledger. The status command automatically discovers
and merges ledger files from all known locations, including the plugin data
directory set by Claude Code (CLAUDE_PLUGIN_DATA) and the manual fallback
path. Deduplication uses resolved paths so symlinks and non-canonical paths
do not cause double-counting.
It tracks:
Prompt caching can reduce usage and cost but does not necessarily reduce context window occupancy. Governor reports those separately when Claude Code exposes the data.
Use benchmarks/ for measured comparisons.
Recommended conditions:
control: no token/style plugincaveman: Caveman enabled as normalgovernor-hooks: Governor hooks enabled, memory unchangedgovernor-compressed: Governor after /governor:compress CLAUDE.mdgovernor-strict: optional strict-mode run for broad tasksPrimary metrics:
Run:
python3 scripts/run_benchmark.py \
--write-json benchmarks/v2-fixture-results.json \
--write-md benchmarks/v2-fixture-results.md
Refresh Caveman captures first when Claude CLI auth is available:
python3 scripts/capture_fixture_conditions.py \
--condition caveman \
--model sonnet \
--write-summary benchmarks/captured/caveman/latest-summary.json
Refresh reference-style Governor captures too:
python3 scripts/capture_fixture_conditions.py \
--condition governor \
--model sonnet \
--write-summary benchmarks/captured/governor/latest-summary.json
/governor:status will show little or no telemetry./governor:full before a diagnostic command when you need unfiltered logs,
or prefix with GOVERNOR_FULL=1 to bypass inline.GOVERNOR_DEFAULT_MODE=off.Contributions are welcome when they make Governor more useful, safer, or easier to trust. Please read CONTRIBUTING.md before opening a pull request, especially for compression, hook, telemetry, or benchmark changes.
MIT. See LICENSE.
Native macOS app to monitor Claude AI usage limits and watch your coding sessions live
npx CLI installing 100+ agents, commands, hooks, and integrations in one command
干净、强大、属于你的 AI Agent 平台 --AI agents, without the clutter.
Pocket Flow: Codebase to Tutorial