Claude Code usage governor: compact professional output, context slimming, tool-output filtering, telemetry, and drift guardrails.
> /plugin marketplace add 0xhimanshu/governor> /plugin install governor@governor
FAQ
governor is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes usage-governor. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Repo: 0xhimanshu/governor
Governor started as a Claude Code plugin for context hygiene, tool-output filtering, memory compression, telemetry, and drift guardrails.
As of v0.2.3, Governor's core behavior โ content-aware tool-output filtering and context hygiene โ works with any AI coding agent via prompt-based skills. No hooks or MCP required.
Keep long coding sessions efficient without making the model dumber.
The Claude Code command namespace is /governor:*.
bash install.sh --force
Restart Claude Code, then run:
/governor:status
/governor:audit
/governor:compress CLAUDE.md
bash install.sh --project /path/to/project --agents all
This copies a Governor rules file into your project for each agent. The rules teach the agent to self-filter noisy tool output, preserve unique data, and maintain context hygiene โ automatically, every session.
Governor works at two levels:
| Agent | Integration | What You Get |
|---|---|---|
| Claude Code | Plugin with hooks | Full: auto-filtering, telemetry, compression, drift guard, /governor:* commands |
| Cursor | .cursor/rules/governor.mdc | Self-filtering, compact mode, context hygiene |
| Windsurf | .windsurf/rules/governor.md | Self-filtering, compact mode, context hygiene |
| Cline | .clinerules/governor.md | Self-filtering, compact mode, context hygiene |
| Codex CLI | AGENTS.md | Self-filtering, compact mode, context hygiene |
| Gemini CLI | GEMINI.md | Self-filtering, compact mode, context hygiene |
How it works for non-Claude agents: Governor's rules file teaches the agent to apply content-aware filtering itself. When tool output has >40% duplicate lines (test failures, log spam, build warnings), the agent compresses it โ keeping the first error, file:line, and exit code. When output is unique (API responses, JSON, code), it passes through intact. No external dependencies.
Claude Code gets the deepest integration because it supports plugin hooks. Other agents get the core behavior via prompt engineering.
Long coding sessions usually do not fail because the AI writes one extra paragraph.
They fail because context gets polluted:
CLAUDE.md, notes, and rules tax every sessionGovernor is designed for that failure mode โ in Claude Code and beyond.
| Capability | What it does | Where it works |
|---|---|---|
| Tool-output filtering | Compacts noisy output when content is repetitive; preserves unique data | All agents |
| Compact mode | Keeps responses concise and professional | All agents |
| Context hygiene | Avoids re-reads, broad scans, and context waste | All agents |
| Memory compression | Rewrites bloated prompt files into denser, safer forms | Claude Code |
| Telemetry | Reports measured savings, failures, compactions, and waste heat | Claude Code |
| Drift guardrails | Adds planning and scope checks for broad tasks | Claude Code |
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 coding 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:
/governor:compress CLAUDE.md rewrites
verbose memory files into dense prose. (Claude Code)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. (Claude Code)/governor:guard. (Claude Code)Claude Code plugin commands:
| 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 |
/governor:install-rules | Copy Governor skills into other-agent projects |
gh repo clone 0xhimanshu/governor
cd governor
bash install.sh --force
bash install.sh --project /path/to/project --agents all
Or install for specific agents:
bash install.sh --project . --agents cursor,windsurf
bash install.sh --project . --agents cline,codex,gemini
claude --plugin-dir .
/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:
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 tasksRun:
python3 scripts/run_benchmark.py \
--write-json benchmarks/v2-fixture-results.json \
--write-md benchmarks/v2-fixture-results.md
/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, agent rules, or benchmark changes.
MIT. See LICENSE.
.claude-plugin/
marketplace.json
plugin.json
.gitignore
assets/
governor-icon.png
benchmarks/
captured/
caveman/
burp-proxy-history-ssrf.json
intent-dashboard-scope-drift.json
large-read-source-no-compress.json
memory-architecture-constraints.json
memory-destructive-rules.json
noisy-pytest-ssrf-tail.json
playwright-network-auth-redirect.json
tsc-warning-root-cause.json
governor/
intent-dashboard-scope-drift.json
memory-architecture-constraints.json
memory-destructive-rules.json
README.md
fixtures/
burp-proxy-history-ssrf.json
intent-dashboard-scope-drift.json
large-read-source-no-compress.json
memory-architecture-constraints.json
memory-destructive-rules.json
noisy-pytest-ssrf-tail.json
playwright-network-auth-redirect.json
README.md
schema.json
tsc-warning-root-cause.json
pilot-intent-results.md
pilot-intent-run.csv
README.md
run-sheet.csv
sonnet-v2-report.md
tasks.json
tool-filter-v1-1-results.json
tool-filter-v1-1-results.md
v2-fixture-results-sonnet.json
v2-fixture-results-sonnet.md
v2-fixture-results.json
v2-fixture-results.md
bin/
governor
governor-statusline
CHANGELOG.md
commands/
audit.md
benchmark.md
compress.md
full.md
guard.md
install-rules.md
off.md
on.md
plan.md
status.md
strict.md
CONTRIBUTING.md
docs/
specs/
governor-accounting-fix.md
hooks/
hooks.json
install.sh
LICENSE
README.md
RELEASING.md
rules/
cline/
.clinerules/
governor.md
codex/
AGENTS.md
cursor/
.cursor/
rules/
governor.mdc
gemini/
GEMINI.md
windsurf/
.windsurf/
rules/
governor.md
scripts/
benchmark_lib.py
build_release.py
capture_fixture_conditions.py
compare_benchmarks.py
evaluate_decision.py
governor.py
install_rules.py
run_benchmark.py
run_tool_filter_benchmarks.py
skills/
usage-governor/
SKILL.mdยฉ 2026 Flowy ยท Free and open source
Built for Claude Code ยท Not affiliated with Anthropic