By 0xhimanshu
Manage Claude Code Max token budgets with response compression, tool output filtering, drift guardrails, and implementation contracts to prevent scope creep and optimize context usage.
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 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:*.
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.
npx claudepluginhub 0xhimanshu/governor --plugin governor45% 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.
Complete collection of battle-tested Claude Code configs from an Anthropic hackathon winner - agents, skills, hooks, and rules evolved over 10+ months of intensive daily use
Real-time session dashboard for Claude Code — cost tracking, analytics, and smart alerts
(Alpha) Persistent memory, architectural decisions, and safety guardrails for Claude Code. Your agent starts every session with full project context — stack, decisions, patterns, safety rules, and a handoff from the previous session.
Live API usage in Claude Code statusline - colored progress bars, Git info, tokens, session metrics, device tracking, and more
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.