Repository navigation
chore: guard sensitive paths and flag stale knowledge notes - #5140
Conversation
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
PR SummaryLow Risk Overview
A new Reviewed by Cursor Bugbot for commit 26f4739. Bugbot is set up for automated code reviews on this repo. Configure here. |
[Low impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issue was found. SummaryAdds advisory warnings for sensitive files and reminds Claude Code when edited code is listed as a knowledge note's source.
Reviews (2) · Last reviewed commit: "fix: read inline source lists and drop h..." · Reviewed by Greptile |
There was a problem hiding this comment.
🟡 Changes recommended
The documented sources: [...] template is incompatible with the hook’s block-list-only parser, so notes following the template will not receive reminders.
1 open issue
What changed in this PR
This PR expands Claude Code’s advisory safeguards for sensitive CDP files and adds reminders to keep knowledge notes aligned with their source code.
Changes:
- Extends non-blocking warnings to additional migration, authentication, deletion, unmerge, and production paths.
- Registers a post-edit hook that identifies related knowledge notes and returns reminders through
additionalContext. - Documents the reminder hook and directory-prefix matching.
| File | Description |
|---|---|
docs/knowledge/README.md |
Documents knowledge-note reminders and directory matching. |
.claude/settings.json |
Registers the knowledge-check hook after edits. |
.claude/hooks/knowledge-doc-check.sh |
Matches edited files to note sources and emits reminders. |
.claude/hooks/guard-protected-files.sh |
Expands sensitive-path warning coverage. |
Review effort: Balanced
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>

Summary
Phase 4 of the agent-ready knowledge base. Claude Code now warns before it edits migrations, auth, data deletion and production config. It also reminds Claude to update a knowledge note when it edits code that the note lists under
sources.Changes
guard-protected-files.sh: adds theosspckgsandproductFlyway migration directories, backend and public API auth, frontend auth, member erasure scripts, cleanup jobs and workflows, unmerge,*/config/production.json, and production deploy workflows. It only warns and never blocks an edit.knowledge-doc-check.shPostToolUse hook. It reads thesourceslist in eachdocs/knowledge/*.mdfrontmatter. A source ending in/covers everything below it. When an edited file matches, the hook returnsadditionalContextnaming the note, so the reminder reaches Claude and not only the transcript. It skips edits to the notes themselves.docs/knowledge/README.md: one sentence about the hook.The same knowledge hook goes into insights in a companion PR.
Type of change
Related issue
None. This is local work with no ops issue.