Docs
Bagheera
Each person’s session machinery. Checks that keep secrets out of Claude’s context, Git hooks from being skipped and hidden characters out of what Claude writes, a status line, a doctor, project setup, a session review, a retro and an assessment.
Install it once, for yourself:
claude plugin install bagheera@bunderlog
Bagheera runs in all your sessions: in every repository, in the home folder and in Claude Code’s own config folder. It has no settings: it is on, whole, wherever it is installed. It needs python3 3.9 or later; without it, session start says so and no check runs.
Checks
Three checks run before Claude’s tool calls (Bash, Read, Grep, Edit, Write, MultiEdit). They are always on and only ever refuse; they never ask. Each runs on its own, so a bug in one never stops the others from refusing. The first two read the words of a command, looking through sudo, timeout, env, sh -c, eval and command substitutions.
bagheera:no-secrets-in-context
Refuses a call that would put a secret into the session:
- reading an Env file (
.env,.env.local,prod.env,.envrc,*.env) withRead,Grep, or any of 38 shell readers such ascat,head,grep,sed,jqorbase64; - private keys (
id_rsa,id_ed25519,*.pem,*.key) unless the name marks them public; - secret files:
.aws/credentials,.netrc,.docker/config.json,.config/gh/hosts.yml; - commands that print secrets:
envorprintenvwithout a name,echo $API_KEYand other secret-looking names,gh auth token,aws configure export-credentials,op read,git credential fill, and interpreter code that opens such a file, given inline (python3 -c,node -e) or as a here-document (python3 - <<EOF).
Templates (.example, .sample, .template, .dist) pass, and so do counts and names, such as grep -c or cut -d= -f1. An Env file whose first line holds baloo:allow-secret counts as holding none, and only you can add that mark. The refusal tells Claude to ask you to look in your own terminal.
bagheera:no-git-hook-bypass
Refuses a command that would skip the Git hooks: --no-verify on any Git command (and its abbreviations), git commit -n, git -c core.hooksPath=…, writing core.hooksPath with git config, the GIT_CONFIG_* variables that set it, and HUSKY=0. The refusal tells Claude to ask you to run the command yourself with ! <command>.
bagheera:no-hidden-characters
Refuses a call that would write a character a terminal, an editor and a pull request’s diff don’t show. Text Claude copies from a web page, an issue or a file can hold them: bidi controls make code read one way and run another (Trojan Source), and zero-width and tag characters carry words Claude reads but you don’t. It looks at what a call writes: a Write’s content, an Edit’s or MultiEdit’s new text, and a Bash command as it stands. The characters are:
- the bidi embeddings, overrides and isolates, U+202A–U+202E and U+2066–U+2069;
- the tag characters, U+E0000–U+E007F, except in the flags of England, Scotland and Wales;
- zero width space U+200B, word joiner U+2060 and U+FEFF, except as the byte order mark a
Writestarts with.
An edit may remove such a character or keep one that is already there. Characters real text uses pass: the joiners in emoji and Persian, and the marks in Hebrew and Arabic. The refusal names the character, its line and column, and tells Claude to write it as an escape, such as \u200b, if it is meant.
These checks add to Claude Code’s own permissions.deny rules, which a set-up project commits. Commit checks belong to Hathi.
/bagheera:setup
Sets a project up as Set up a project lists: the settings, the CLAUDE.md line, .hathi.yml, .githooks/, the .gitignore entries and the ADR. It also removes what earlier versions of the plugins wrote. Where Hathi is missing or older than 1.2.0, it installs the latest: with mise if mise is installed, otherwise from Hathi’s GitHub Releases into ~/.local/bin, checked against SHA256SUMS. It shows you the diff and commits nothing.
Status line
shop main ±3 ↑1 ▤ 10% 21K · ◷ 46% 14:00 · ◷ 23% Sat · ↻ 41m ⧗ 1 · ⚑ 2 · Opus 5.5 high
Left: the project folder in light cyan and the branch in light blue, then ±3 for the files changed and not committed and ↑1 for the commits not pushed. Centre: the context window with its tokens, the 5-hour limit with the time it resets, the 7-day limit with the day it resets, and the minutes until the prompt cache goes cold. Right: ⧗ for your other Claude Code sessions waiting for you, ⚑ for the projects on this machine that need attention, ⇡ with a version when a newer Bagheera is installed and a restart would run it, ⤓ with a version when a newer Release is out and an update would install it, then the model and effort. Each of ⧗, ⚑, ⇡ and ⤓ shows only when there is something to do, in yellow; the doctor says which sessions and projects, and what to do about each.
The line stays grey while all is well. A figure’s icon and number turn yellow, then red:
| Figure | Yellow at | Red at |
|---|---|---|
Context window ▤ |
15 % | 20 % |
5-hour limit ◷ |
70 % | 85 % |
7-day limit ◷ |
80 % | 95 % |
Prompt cache life left ↻ |
below 40 % | below 20 %, and cold |
On a narrow terminal the reset times and tokens go first, then the model, then the folder name is shortened, then the figures go; ±, ↑, ⧗, ⚑, ⇡ and ⤓ stay. It never fetches (⤓ reads Claude Code’s own copy of the marketplace, as fresh as its last refresh), waits at most 150 ms for git, and refreshes every 60 seconds.
/bagheera:doctor
Shows what needs attention, here or in any project on this machine, problems first, each with what fixes it. It covers the running version and whether a newer one waits for a restart, the status line link, old settings an earlier version wrote, session reviews (running, waiting, failed this week, cost this week), and the checks. It only reads. Ask Claude “why didn’t a check run?” and it runs the doctor.
Session review
When a session in a repository ends, Bagheera starts a separate, headless Claude session that reads the conversation (masked, at most the last 200,000 characters; sessions under 2,000 characters are skipped). It proposes only what the conversation settled: a glossary term, an ADR decision, a PRD’s purpose or check, or deleting an inbox item that is now settled.
Proposals wait in .about/proposals/, outside Git. At the next session start Claude lists them and asks you to accept, reject or defer each; an accepted one is written through Baloo’s skills. A deferred one comes back at most twice. Each review is capped at $3; the dearest of the first 40 cost about $0.81.
/bagheera:retro
Reviews how past sessions went. It reads condensed, masked transcripts and looks for refused calls, failed commands, check refusals, interruptions and corrections, repeated prompts and expensive calls. It reports up to three stalls, ranked by what they cost, each with the setup change that would have spared it: preferably an enforced one (a test, a lint, a Git hook, a Hathi check), then a setting, then a line in CLAUDE.md. It applies only what you pick.
/bagheera:assess
Bagheera counts each session on this machine at its end, in its own data folder: names and numbers only, never what the session said. /bagheera:assess reports from those counts, over the last 30 days beside the 30 before, how useful each part of bunderlog is and how well it works: each check’s refusals and what followed them, the skills loaded, how often an ADR or PRD was read before an edit to what it names, how often a stack’s Guideline was in context before the first edit of its file in a session with Louie on (go before a .go file, python before a .py file), the size of what session start adds, the session review’s proposals, and each Louie workflow’s runs: how they ended, what they cost and which phase cost most, with the review and the rework counted apart from the build or the rebase. It asks you to label each refusal real (it kept a secret out, a hook from being skipped or a hidden character out) or false (it stopped harmless work). It changes nothing in the project, and nothing leaves the machine.
Short replies
The bagheera:short-replies output style: the answer first, no preamble or closing summary, short active sentences, lists only for parallel items. It doesn’t shorten code, commit messages or documents. Pick it in your own ~/.claude/settings.json with "outputStyle": "bagheera:short-replies".