By 0xhimanshu
Control Claude Code's token usage and context size for Max plans via response compression, tool output filtering, drift prevention, and governance modes, with a dashboard and benchmarks for monitoring efficiency.
Audit recurring context files and suggest usage-limit optimizations.
Explain or summarize Governor vs Caveman performance benchmark results.
Automatically compress CLAUDE.md or other memory files with protected-span safety. One-command token savings.
Temporarily ask Governor to avoid compacting tool output for the next diagnostic step.
Check current changes against the latest approved implementation contract.
Matches all tools
Hooks run on every tool call, not just specific ones
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
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.
npx claudepluginhub 0xhimanshu/governor --plugin governorReal-time session dashboard for Claude Code — cost tracking, analytics, and smart alerts
Opus 4.8-aware context optimization: silent-by-default hooks, honest NET token savings, big-file map-then-load, Context Control Center, per-task tracking, prompt coach
45% cost reduction measured. Cache expiry prevention, SubTask auto-delegation, zero-cost context restoration, real-time cost dashboard. The only Claude Code plugin built from CC source analysis.
Session intelligence for Claude Code — find why your sessions fail and fix them
Cost-conscious mode for Claude Code. Saves 30-60% on costs through concise responses, model routing, and efficient workflow patterns.
Mission Control for Claude Code — auto-starts a web dashboard, provides 90 MCP tools (sessions, stats, live monitoring, projects, teams, insights, coaching, and more), and adds 9 skills including /session-recap, /daily-cost, /standup, /coaching, /insights, and /team-status.