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.9.4MITIn 1 marketplace
Multi-session, per-project budget accounting for the Onlooker ecosystem. Rolls each session's spend into a per-project ledger on SessionEnd and surfaces "this project burned $X this week" at SessionStart. Where governor regulates a single session, bursar is the cross-session rollup: it reads governor.session.complete off the shared event bus, degrades to a session count when governor is absent, and emits bursar.* events for audit. Named for the officer who keeps the accounts. 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.
Multi-session, per-project budget accounting for the Onlooker ecosystem.
Bursar rolls each session's spend into a per-project ledger when the session ends, and surfaces "this project burned $X this week" at the next session start. Named for the officer who keeps an institution's accounts, it answers a question governor cannot: not "is this session over budget?" but "what has this project cost me lately?"
Where governor regulates a single session, bursar is the cross-session rollup. The two do not call each other — bursar reads governor's per-session totals off the shared event bus (governor.session.complete) and degrades gracefully when governor is not running.
Bursar is a sibling plugin to ecosystem and assumes the Onlooker observability substrate (~/.onlooker/) is present.
| Hook | Matcher | What Bursar does |
|---|---|---|
SessionStart | * | Derives the project key from the session cwd, writes a breadcrumb so SessionEnd can attribute spend, then sums the per-project ledger over the active window and surfaces the total as additionalContext. Emits bursar.rollup.surfaced (or bursar.rollup.skipped when there is nothing in the window). |
SessionEnd | * | Resolves the ending session's project key (breadcrumb → substrate session tracker → live cwd), reads the session's spend from the latest governor.session.complete on the event bus, upserts one record into the per-project ledger, and emits bursar.session.recorded. |
SessionEnd's hook payload only reliably carries session_id, so bursar cannot derive a project key from a cwd at that point. Instead, SessionStart — which does receive cwd — derives the project key (SHA256 of the git origin URL, or the repo root for remote-less repos) and stashes a breadcrumb at $ONLOOKER_DIR/bursar/sessions/<session-id>.json. SessionEnd reads it back, falling back to the substrate session tracker's recorded cwd, then to the live cwd.
Records are keyed by session_id: re-recording a session replaces its line rather than appending, so a SessionEnd that fires more than once is idempotent.
On SessionEnd, bursar scans ~/.onlooker/logs/onlooker-events.jsonl for the last governor.session.complete matching the session — governor re-emits cumulatively, so the final one carries the session's totals. It records total_cost_usd, total_tokens, and total_api_calls. When no such event exists (governor disabled or absent), the session is still recorded with governor_present: false and no cost, and the surfaced message degrades to a session count.
Install the plugin in Claude from the marketplace with:
/plugin install bursar@onlooker-community
All keys are optional. Unset keys fall back to the plugin's config.json defaults.
{
"bursar": {
"window": "rolling_7d",
"week_start": "monday",
"surface_at_session_start": true,
"min_cost_to_surface_usd": 0
}
}
| Key | Default | Description |
|---|---|---|
window | "rolling_7d" | Rollup window. "rolling_7d" sums the trailing 7×24h; "calendar_week" sums from the most recent week start. |
week_start | "monday" | First day of the calendar week — "monday" or "sunday". Only consulted when window is "calendar_week". |
surface_at_session_start | true | When false, bursar still records sessions and writes breadcrumbs but prints nothing at SessionStart. |
min_cost_to_surface_usd | 0 | Suppress the SessionStart message when the windowed total is below this dollar amount. |
Config resolves in three layers, latest wins: plugin config.json → ${CLAUDE_CONFIG_DIR:-~/.claude}/settings.json → <repo>/.claude/settings.json.
~/.onlooker/bursar/
├── projects/
│ └── <project-key>/
│ ├── sessions.jsonl # one record per session (project key sanitized to [a-zA-Z0-9-_])
│ └── sessions.jsonl.lock # upsert lock
└── sessions/
└── <session-id>.json # SessionStart→SessionEnd breadcrumb (removed once recorded)
Each ledger line is a JSON record: { ts, ts_epoch, session_id, project_key, cost_usd?, tokens?, api_calls?, governor_present, model? }. ts_epoch (seconds) is stored alongside the RFC3339 ts so windowing is a portable numeric compare with no date parsing. Cost fields are omitted when governor was not running for the session.
Bursar honors $ONLOOKER_DIR; it never hardcodes ~/.onlooker, so the test suite's isolated temp home is respected.
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 bursarPlugins from other owners that cover similar ground