by 0xhimanshu
Claude Code usage governor: compact professional output, context slimming, tool-output filtering, telemetry, and drift guardrails.
# Add to your Claude Code skills
git clone https://github.com/0xhimanshu/governorGuides for using cli tools skills like governor.
governor is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by 0xhimanshu. Claude Code usage governor: compact professional output, context slimming, tool-output filtering, telemetry, and drift guardrails. It has 133 GitHub stars.
governor's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/0xhimanshu/governor" and add it to your Claude Code skills directory (see the Installation section above).
governor is primarily written in Python. It is open-source under 0xhimanshu on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh governor against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Governor started as a Claude Code plugin for context hygiene, tool-output filtering, memory compression, telemetry, and drift guardrails.
As of v0.2.4, 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. Filtering, compact mode, and telemetry are already running — there is nothing to turn on. When you want to look under the hood:
/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 |
| Hermes 🆕 | .hermes.md |
Self-filtering, compact mode, context hygiene |
| DeepSeek 🆕 | .dsh/rules/governor.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 8 agents |
| Compact mode | Keeps responses concise and professional | All 8 agents |
| Context hygiene | Avoids re-reads, broad scans, and context waste | All 8 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 |
Governor sits in a different layer from the other token-savers, so it stacks with them rather than replacing them.
| Tool | Shrinks | Overlap with Governor |
|---|---|---|
| Ponytail | The code the agent writes | None |
| Caveman | The prose the agent speaks | None |
| RTK | The shell output you pipe through it | Partial |
| Governor | The context the session consumes | — |
Ponytail is a YAGNI enforcer: before writing code it walks a ladder — does this need to exist, is it already in the codebase, does the stdlib or platform do it — and stops at the first rung that holds. Their published benchmark reports ~54% less code written against a no-skill baseline. Those are their numbers on their fixtures, not something Governor has independently reproduced.
Ponytail does not read tool output. Governor does not touch code generation. Run both: Ponytail keeps the agent from over-building, Governor keeps the test logs and MCP payloads from that build out of your context window.
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:
Ponytail shrinks what gets built. Caveman shrinks what gets said. RTK shrinks what a command prints. Governor protects the session that holds all three.
Governor is best for:
Governor is less useful for:
/governor:compress CLAUDE.md rewrites
verbose memory files into dense prose. (Claude Code)