Repository navigation
chore(claude): review every AI commit for project names - #108
Conversation
Project and product names reached this public repository through AI assistants, which carry the context a feature is built in into comments, docs and commit messages. There is no list of forbidden names: a list here would publish them. Instead the assistant reviews each commit and asks before using a name. - CLAUDE.md: a "Project names" rule -- generic wording while writing, a review of the staged diff and the message before every commit, an explicit yes for any name; IDAC is approved. It holds whether or not hooks run. - .claude/hooks/project-name-review.sh, wired as a PreToolUse hook in .claude/settings.json: holds every `git commit` (also `git -C dir commit`, `--amend`; not `commit-tree`) until the command carries PROJECT_NAMES_REVIEWED=1, and tells the assistant what to check. - .gitignore keeps .claude/settings.local.json local but commits the shared settings and hooks; .gitattributes keeps *.sh at LF so the hook runs on Windows checkouts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Generated by Claude Code |
On 2026-10-21 the history from 2026-08-24 on was rewritten to remove internal project names. A branch that started on the old history still contains it, and merging such a branch would bring the names back. Every replaced commit descends from 1c2098c, so one ancestry check finds them all. - ci.yml: job "No replaced history" -- full-history checkout, fails when 1c2098c is reachable from HEAD, for every push and pull request. Made a required status check on develop and main, it keeps such a branch from being merged. - .claude/hooks/replaced-history-guard.sh (PreToolUse, Bash): refuses a `git push` of a branch that contains 1c2098c, before anything leaves the machine. It reads only each push's own arguments (named branches, refspec sources, --all/--mirror, else the current branch), follows `git -C dir` and a leading `cd dir`, and lets --delete and tags-only pushes through. - CLAUDE.md: "Replaced history" -- what happened and how to move a branch's own commits onto the new history. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks for the check. No version bump in this PR, on purpose: it changes nothing that ships in the package -- only The next version is set by the release work on 🤖 Generated with Claude Code |
Security review: PR #108 (
|
…y fetches The guard runs before the user approves the command, and took the directory for its git calls from the command itself. A crafted repository there -- a partial clone whose promisor remote sets uploadpack -- made `git cat-file -e` run a command through a lazy fetch, before any approval. Reported in the security review of PR #108; reproduced with the hook of 229d843. - Only the project ($CLAUDE_PROJECT_DIR) and directories inside it are checked; a command naming any other directory is let through unchecked, and CI still refuses an old branch. - Every git call goes through g(): GIT_NO_LAZY_FETCH=1 and -c safe.bareRepository=explicit, so even a crafted repository inside the project runs nothing. - JSON-escaped backslashes in a Windows path become slashes instead of being dropped. Measured: a crafted partial clone outside the project, one inside, and a bare one inside -- the hook of 229d843 ran the injected command in all three, this one in none. Regression: 33 command shapes x 2 JSON styles, 66 of 66 as expected; live in a Claude Code session, an old branch in the project was still refused. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks -- confirmed and fixed in 2d72ecc. Reproduced first, against the hook as of 229d843: a partial clone whose promisor remote sets Fix (
Measured after the fix:
Regression: 33 command shapes × compact/spaced JSON, 66 of 66 as expected; live in a Claude Code session, an old-history branch in the project is still refused. 🤖 Generated with Claude Code |
PR Review: chore(claude): review every AI commit for project names (GitHub #108)Recommendation: Approve with comments Blocking issuesNone. Security finding from the earlier review: fixed, verified independentlyThe low-severity item from the security review (git run in a directory named by the command, before the permission prompt) is fixed in
Functional check of the fixed hook in a scratch clone with a branch on The fix is sound: every git call goes through one wrapper with A · Traceability & B · Story
C · CodeNo production code changed, so brooks-review was not run; I reviewed the two shell scripts, the settings and the CI job directly.
D · Documentation
F · LiabilityNo findings. Diff and all three commits scanned for secrets, keys, tokens, connection strings, e-mail addresses and private IPs (manual pattern scan; gitleaks/trufflehog not installed): only the G · Repository hygiene (default branch
|
| Item | Status |
|---|---|
| README | ✅ present |
| LICENSE | ❌ no LICENSE file, although the repository is public |
| CODEOWNERS | ❌ none; worth adding at least for .claude/ and .github/workflows/, since the hooks run in every contributor's assistant session |
| SECURITY.md | ❌ none |
| CONTRIBUTING | CONTRIBUTE.md (non-standard name, GitHub does not pick it up) |
| Secret scanning | |
| SBOM | ❌ no SBOM step found in the workflows |
| Dependency updates | ❌ no Dependabot or Renovate config |
| SAST / dependency audit | |
| Branch protection | ❌ rulesets for main and develop exist but are not enforced |
| CHANGELOG | ✅ present |
Not checked
- Behaviour on Windows checkouts and on Git < 2.44 (only Git 2.54 on macOS tested).
- The hooks inside a live Claude Code session (the author reports this; I tested the scripts directly with hook JSON).
project-name-review.shcommand shapes beyond reading the regex (covered by the earlier security review).
Brings the project-name review hook, the replaced-history push guard and the CI job "No replaced history" onto the feature branch. CLAUDE.md: both sides appended sections; kept the branch's sections, then develop's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Why
Internal project and product names reached this public repository -- in docs, specs, changelogs and commit messages -- because AI assistants carry the context a feature is built in into what they write. They have been removed from the history; this PR keeps new ones out.
There is deliberately no list of forbidden names: such a list in a public repository would publish exactly the names it is meant to keep out. Instead, the assistant reviews every commit itself and asks before using any name.
What
CLAUDE.md-- "Project names" rule. Describe where a change came from generically; before every commit, review the staged diff and the message for anything that could be a project, product, customer, team or internal-system name, and commit such a name only after an explicit yes from the user. IDAC is approved. The rule holds whether or not hooks run..claude/hooks/project-name-review.sh+.claude/settings.json-- a Claude CodePreToolUsehook onBash. It holds everygit commit(alsogit -C dir commit,git -c k=v commit,--amend; notcommit-treeorgit log --grep=commit) and tells the assistant what to check. The commit goes through once the command carriesPROJECT_NAMES_REVIEWED=1. Plainsh, no dependencies..gitignorecommits.claude/settings.jsonand.claude/hooks/;.claude/settings.local.jsonand everything else under.claude/stays local..gitattributeskeeps*.shat LF, so the hook still runs on Windows checkouts withcore.autocrlf.Limits
The hook enforces that the review is acknowledged, not that it was done well: an assistant can set the prefix without looking. Humans committing by hand are not affected. Other assistants (Copilot, Codex, ...) only see the
CLAUDE.mdrule; the same rule goes intoAGENTS.mdonce #96 has brought that file todevelop.Tested
Replaced history (second commit)
The rewrite gave every commit from 2026-08-24 on a new SHA. A branch that started on the old history still carries it -- and merging it would bring the names back. Every replaced commit descends from
1c2098c, so one ancestry check finds them all:ci.yml-- job "No replaced history". Full-history checkout; fails when1c2098cis reachable fromHEAD, on every push and pull request. To make it a gate, an admin adds "No replaced history" as a required status check ondevelopandmain. Pushing such a branch cannot be prevented on github.com (no pre-receive hooks), but merging it can..claude/hooks/replaced-history-guard.sh-- a secondPreToolUsehook: refuses agit pushof a branch that contains1c2098c, before anything leaves the machine. It reads only each push's own arguments (named branches and refspec sources,--all/--mirror, otherwise the current branch), followsgit -C <dir>and a leadingcd <dir>-- but only into the project; a command naming any other directory is let through unchecked, because the hook runs before the user approves the command. All its git calls run withGIT_NO_LAZY_FETCH=1and-c safe.bareRepository=explicit(security review finding, fixed in2d72ecc). It lets--deleteand tags-only pushes through.CLAUDE.md-- "Replaced history": what happened, and thegit rebase --ontorecipe to move a branch's own commits onto the new history.Security: a crafted partial clone outside the project, one inside and a bare one inside made the first version of the hook run an injected command; the fixed hook runs it in none of the three. Tested: the hook against 33 command shapes (single pushes, refspecs,
--all/--mirror,-C/cd, chains with&&/;/|, multi-line commands), each with compact and spaced JSON -- 66 of 66 as expected; live in a Claude Code session, an old-history branch was refused and a clean one went through. The CI step's script, run locally: exit 1 on the old feature tip, exit 0 on the newdevelopand feature tip.Review notes
🤖 Generated with Claude Code