Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By onlooker-communityv0.8.3MITIn 1 marketplace
Resource governance and budget enforcement for the Onlooker ecosystem. Tracks per-session token and cost spend, gates Task spawns before they exceed a configurable budget ceiling, and emits governor.* events for audit. Named for the steam-engine governor — a device that regulates output. Builds on the Onlooker ecosystem plugin.
Run automatically on Claude Code events. Claude doesn't decide.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Resource governance and budget enforcement for the Onlooker ecosystem.
Governor tracks per-session token and cost spend, gates Task spawns before they exceed a configurable budget ceiling, and emits governor.* events for audit. Named for the steam-engine governor — the flyweight device that throttles a machine back before it runs away — it keeps a session's subagent fan-out inside a spend envelope instead of letting it accelerate unchecked.
Governor is a sibling plugin to ecosystem and assumes the Onlooker observability substrate (~/.onlooker/) is present.
Governor keeps a per-session JSONL ledger and consults it on every Task spawn. Accounting is two-phase: the gate writes a reservation before a spawn runs so concurrent spawns each see the others' in-flight cost, and completion cancels that reservation and records observed spend.
| Hook | Matcher | What Governor does |
|---|---|---|
SessionStart | * | Creates ~/.onlooker/governance/ledgers/, sweeps stale lock directories left by crashed prior sessions (emitting governor.lock.stale_cleared for each), and checks that the global policy file exists (warns to stderr if missing — never blocks). |
PreToolUse | Task | The gate. Estimates tokens for the spawn, reads consumed tokens from the ledger under an atomic check-and-reserve lock, decides allow or block, writes a reservation when allowing, and emits governor.gate.checked. |
PostToolUse | Task | Records the completed call: negates the reservation estimate, adds observed actual_tokens when the tool response carries usage counts, appends a record to the ledger, and emits governor.call.recorded. |
Stop | * | Reads cumulative totals from the ledger and emits governor.session.complete with token, cost, and call summaries plus an under_budget flag. |
On each Task spawn, Governor estimates the spawn's token cost, adds it to the session's consumed tokens, and compares the projection against two thresholds:
ceiling_exceeded — projected tokens exceed tokens_default × hard_stop_margin. Always blocks, regardless of enforcement mode.budget_exceeded — projected tokens exceed tokens_default but stay under the hard ceiling. Blocks only in hard enforcement; in soft enforcement the spawn is allowed and only the event is emitted.lock_timeout — the gate lock could not be acquired within its timeout. Treated as a block in hard enforcement.To block, the hook writes {"decision":"block","reason":"..."} to stdout (the Claude Code PreToolUse block protocol) and still exits 0. All other paths allow the spawn. Every decision — allow or block — emits governor.gate.checked with the decision, reason, estimate, and remaining budget.
Governor does not know the model a spawn will use, so estimates are a planning-time upper bound. Tokens are estimated from the tool-input JSON using a tier table of characters-per-token ratios:
| Content tier | Characters per token |
|---|---|
| ASCII prose | 4.0 |
| Code / JSON | 3.0 |
| Mixed | 2.5 |
| Non-Latin | 1.5 |
The raw estimate is multiplied by safety_margin before the gate check. Cost is derived from tokens at a blended ~$9 per million (Sonnet-class $3/M input + $15/M output, assuming a 50/50 split). When a PostToolUse response carries usage.input_tokens / usage.output_tokens, the actual count is recorded alongside the estimate and the running total converges to real spend.
Install Governor from the marketplace:
/plugin install governor@onlooker-community
Once installed, the plugin is active. No additional configuration is required to enable it.
All keys are optional. Unset keys fall back to the plugin's config.json defaults.
{
"governor": {
"enforcement": "soft",
"global_policy_path": "~/.onlooker/governance/global-policy.yaml",
"session": {
"tokens_default": 100000,
"cost_usd_default": 1.0,
"reserve_pct": 10
},
"estimation": {
"safety_margin": 1.3,
"hard_stop_margin": 1.5,
"method": "tier_table"
}
}
}
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub onlooker-community/ecosystem --plugin governorPlugins from other owners that cover similar ground