claudeers.

🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?

Claim this page →
// Claude Plugins

governor

Claude Code usage governor: compact professional output, context slimming, tool-output filtering, telemetry, and drift guardrails.

Actively maintained
100/100
last commit 18 days ago
last release 18 days ago
releases 1
open issues 0
// install
git clone https://github.com/0xhimanshu/governor

Governor icon

Governor for Claude Code

Keep long AI coding sessions sharp under quota pressure.

Now also works with Cursor · Windsurf · Cline · Codex CLI · Gemini CLI

Quick Start · Multi-Agent · Why Governor · Benchmarks · Commands · Install

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:*.

Quick Start

Claude Code (full plugin)

bash install.sh --force

Restart Claude Code, then run:

/governor:status
/governor:audit
/governor:compress CLAUDE.md

Other Agents (prompt-based skill)

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.

Multi-Agent Support

Governor works at two levels:

AgentIntegrationWhat You Get
Claude CodePlugin with hooksFull: auto-filtering, telemetry, compression, drift guard, /governor:* commands
Cursor.cursor/rules/governor.mdcSelf-filtering, compact mode, context hygiene
Windsurf.windsurf/rules/governor.mdSelf-filtering, compact mode, context hygiene
Cline.clinerules/governor.mdSelf-filtering, compact mode, context hygiene
Codex CLIAGENTS.mdSelf-filtering, compact mode, context hygiene
Gemini CLIGEMINI.mdSelf-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.

Why Governor

Long coding sessions usually do not fail because the AI writes one extra paragraph.

They fail because context gets polluted:

  • verbose test, build, and MCP output floods the transcript
  • bloated recurring files like CLAUDE.md, notes, and rules tax every session
  • broad prompts trigger repo-wide scans and retries
  • scope drift compounds over time

Governor is designed for that failure mode — in Claude Code and beyond.

What It Does

CapabilityWhat it doesWhere it works
Tool-output filteringCompacts noisy output when content is repetitive; preserves unique dataAll agents
Compact modeKeeps responses concise and professionalAll agents
Context hygieneAvoids re-reads, broad scans, and context wasteAll agents
Memory compressionRewrites bloated prompt files into denser, safer formsClaude Code
TelemetryReports measured savings, failures, compactions, and waste heatClaude Code
Drift guardrailsAdds planning and scope checks for broad tasksClaude Code

Why It Feels Different

Most token-saving tools optimize one layer:

  • shorter replies
  • shorter command output

Governor is built for the broader session problem:

  • tool spam
  • recurring context tax
  • MCP-heavy workflows
  • long-task drift
  • wasted retries

That is why Governor's benchmark story starts with valid-context loss and decision preservation, not only token counts.

Benchmarks

V2 Sonnet Fixture Run

Recent measured Sonnet run with Claude decision grading:

ConditionAvg token savingsAvg VCLRDecision preservedWrong decision
Caveman69.1%0.1487.5%12.5%
Governor45.5%0.00100.0%0.0%

What this means:

  • Caveman still wins on raw compression.
  • Governor preserved more valid context in this run.
  • Governor won on decision quality in the latest Sonnet pass.

Artifacts:

  • benchmarks/v2-fixture-results.md
  • benchmarks/v2-fixture-results.json
  • benchmarks/sonnet-v2-report.md

Early Multi-Turn Pilot

Same machine, fresh Claude CLI Sonnet sessions, same multi-turn task, same starting repo snapshot.

ConditionOutput TokensCostTurnsIntent PreservedObvious Regression Found
Control10,997$0.516921YesNo
Governor10,113$0.493322YesNo
Delta-8.0%-4.6%+4.8%TieTie

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.

Tool Filter Signal Checks

Structured/local cases focused on the criticism that compaction can miss the real clue.

CaseFiltered?BlockedSignal Preserved
Noisy pytest failure buried in long logYes64.0%Yes
Burp-style MCP payload with large history + one critical findingYes90.9%Yes
Large Read output containing source codeNo0.0%Yes

Compared To

RTK

RTK is excellent at shrinking shell output.

Governor is aimed at the wider coding session:

  • tool-output filtering across all agents
  • recurring prompt-file hygiene
  • MCP and structured payload handling
  • drift-sensitive long sessions
  • measured savings and waste heat

Caveman

Caveman is excellent when the main goal is making Claude talk in fewer tokens.

Governor is built for the broader session problem:

  • less tool spam
  • less recurring context tax
  • less drift
  • more decision preservation under pressure

Short version:

RTK compresses commands. Caveman compresses style. Governor protects the session.

Best Fit

Governor is best for:

  • Claude Code Max users who hit long-session limits
  • Cursor / Windsurf / Cline users who want context hygiene without switching tools
  • MCP-heavy workflows (Burp, Playwright, structured tool output)
  • prompt-heavy repos with large rules or command docs
  • teams using multiple AI agents on the same codebase

Governor is less useful for:

  • tiny chats
  • already-clean prompt files
  • users who only want meme-simple answer shortening

Features

  • Content-aware tool filtering: large outputs are only compacted when content is repetitive noise (>40% duplicate lines). Unique data — API responses, Burp proxy history, curl output, structured JSON — passes through unfiltered. Works in all supported agents.
  • Always-on compact mode: keeps responses concise and professional. In Claude Code via hooks; in other agents via rules files.
  • Professional memory compression: /governor:compress CLAUDE.md rewrites verbose memory files into dense prose. (Claude Code)
  • Protected-span safety: code blocks, inline code, paths, URLs, commands, env vars, versions, headings, tables, and warnings are preserved.
  • Quality guard: low-savings compression is rejected and the backup is restored instead of pretending success.
  • Inline full-output bypass: set GOVERNOR_FULL=1 as an env var in the same Bash call to skip compaction without a separate command. Immune to parallel-call cancellation.
  • Telemetry ledger: /governor:status reports blocked tokens, failures, compactions, and statusline snapshots when available. (Claude Code)
  • Prompt guidance: vague broad prompts get soft, non-blocking suggestions.
  • Plan and drift guard: explicit contracts for broad builds, then scope checks with /governor:guard. (Claude Code)

Commands

Claude Code plugin commands:

CommandPurpose
/governor:onEnable compact professional response mode
/governor:offDisable response compression
/governor:statusShow usage dashboard and waste heat map
/governor:auditFind bloated memory/rule files and context waste
/governor:compress CLAUDE.mdCompress memory files with protected-span validation
/governor:fullLet the next diagnostic command return full output
/governor:plan "task"Produce an implementation contract before broad work
/governor:guardCheck current changes against the approved plan
/governor:benchmarkRun or explain the V2 benchmark suite
/governor:install-rulesCopy Governor skills into other-agent projects

Install

Claude Code (Full Plugin)

gh repo clone 0xhimanshu/governor
cd governor
bash install.sh --force

Other Agents

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

Local Development

claude --plugin-dir .

How Compression Works

/governor:compress is automatic from the user's point of view:

  1. Create a timestamped backup.
  2. Mark protected spans.
  3. Rewrite the file with dense professional prose.
  4. Strip markers.
  5. Validate protected content.
  6. Attempt protected-span recovery if needed.
  7. Reject low-savings output and restore the backup if the quality guard fails.
  8. Report exact before/after token estimates and backup location.

Compression levels:

LevelTarget
lightRemove filler and repetition; preserve most rationale
mediumCollapse narrative into decision bullets
aggressiveKeep 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.

Telemetry

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:

  • tool-output tokens blocked
  • full-output overrides
  • prompt-risk suggestions
  • Bash failures
  • compactions
  • statusline snapshots
  • memory compression savings

Benchmarking

Use benchmarks/ for measured comparisons.

Recommended conditions:

  • control: no token/style plugin
  • caveman: Caveman enabled as normal
  • governor-hooks: Governor hooks enabled, memory unchanged
  • governor-compressed: Governor after /governor:compress CLAUDE.md
  • governor-strict: optional strict-mode run for broad tasks

Run:

python3 scripts/run_benchmark.py \
  --write-json benchmarks/v2-fixture-results.json \
  --write-md benchmarks/v2-fixture-results.md

Design Principles

  • Helpful by default, strict only when invoked.
  • Professional dense prose, never novelty dialect.
  • Measure exact savings where possible.
  • Treat 1M context as a ceiling, not a target.
  • Keep broad planning and drift checks opt-in.
  • Restore backups instead of accepting unsafe or low-value compression.

Gotchas

  • If hooks do not fire, /governor:status will show little or no telemetry.
  • Existing custom statuslines are not overwritten by the installer.
  • Compression sends file content through the active Claude Code/model workflow. Do not compress secrets or sensitive private files.
  • Use /governor:full before a diagnostic command when you need unfiltered logs, or prefix with GOVERNOR_FULL=1 to bypass inline.
  • For installed-but-inactive behavior, launch Claude Code with GOVERNOR_DEFAULT_MODE=off.

Contributing

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.

License

MIT. See LICENSE.

// compatibility

Platformscli, api
Operating systems
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguagePython

// faq

What is governor?

Claude Code usage governor: compact professional output, context slimming, tool-output filtering, telemetry, and drift guardrails.. It is open-source on GitHub.

Is governor free to use?

governor is open-source under the MIT license, so it is free to use.

What category does governor belong to?

governor is listed under devtools in the Claudeers registry of Claude-compatible tools.

3 views
124 stars
unclaimed
updated 15 days ago

// embed badge

governor on Claudeers
[![Claudeers](https://claudeers.com/api/badge/governor.svg)](https://claudeers.com/governor)

// retro hit counter

governor hit counter
[![Hits](https://claudeers.com/api/counter/governor.svg)](https://claudeers.com/governor)

// reviews

// guestbook

0/500

// related in Claude Plugins

🔓

A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.

// pluginsmultica-ai/187,223[ claude ]
🔓

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explainin…

// pluginsanthropics/Python135,848[ claude ]
🔓

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

// pluginsHKUDS/Python44,672Apache-2.0[ claude ]
🔓

financial-services — a Claude ecosystem project on GitHub.

// pluginsanthropics/Python32,982Apache-2.0[ claude ]
Ecosystem hubone of the most connected projects in the claude ecosystem · 57 connections
→ see how governor connects across the ecosystem