# Governor for Claude Code

> Claude Code plugin and prompt-based agent skill that filters noisy tool output, compresses memory files, tracks telemetry, and guards against scope drift.

Governor is an open-source MIT-licensed project from GitHub user 0xhimanshu that keeps long AI coding sessions efficient under quota pressure. It began as a Claude Code plugin for context hygiene, tool-output filtering, memory compression, telemetry, and drift guardrails. Since v0.2.4 its core filtering and context-hygiene behavior also works with other coding agents through prompt-based rules files. The latest release listed is v0.2.5.

## What It Is

Governor is a context-management layer for AI coding agents. In Claude Code it installs as a full plugin with hooks; for Cursor, Windsurf, Cline, Codex CLI, Gemini CLI, Hermes, and DeepSeek it copies a rules file into the project that teaches the agent to filter output itself, with no hooks or MCP required.

## How Filtering and Compression Work

Tool output is compacted only when it is repetitive noise (more than 40% duplicate lines), keeping the first error, file:line, and exit code. Unique data such as API responses, JSON, and code passes through intact. Setting GOVERNOR_FULL=1 in a command bypasses compaction.

The /governor:compress command backs up a memory file such as CLAUDE.md, marks protected spans (code, paths, URLs, commands, versions, tables), rewrites the file in denser prose at light, medium, or aggressive levels, validates the result, and restores the backup if savings are too low.

## Commands and Telemetry

Governor works without commands, but offers five in Claude Code: /governor:status, /governor:mode, /governor:audit, /governor:compress, and /governor:plan. Plan writes an implementation contract and, when run again, reports drift against it. A local JSONL ledger tracks blocked tokens, full-output overrides, Bash failures, compactions, and compression savings.

## Benchmarks and Fit

The README reports its own benchmarks, including a Sonnet fixture run comparing Governor with Caveman and a narrow multi-turn pilot, and describes the pilot as not a universal claim. It positions Governor as complementary to Ponytail, Caveman, and RTK. It lists Claude Code Max users, MCP-heavy workflows, and prompt-heavy repos as the best fit.

## Features
- Content-aware tool-output filtering
- Always-on compact response mode
- Context hygiene guidance
- Memory file compression with protected-span validation
- Quality guard that restores backups on low-savings compression
- Local telemetry ledger and status dashboard
- Plan and drift guard
- Prompt-risk suggestions
- Inline full-output bypass via GOVERNOR_FULL=1
- Multi-agent rules file installer

## Integrations
Claude Code, Cursor, Windsurf, Cline, Codex CLI, Gemini CLI, Hermes, DeepSeek

## Platforms
WEB, API, CLI

## Pricing
Open Source

## Version
0.2.5

## Links
- Website: https://github.com/0xhimanshu/governor
- Documentation: https://github.com/0xhimanshu/governor
- Repository: https://github.com/0xhimanshu/governor
- EveryDev.ai: https://www.everydev.ai/tools/governor-for-claude-code
