claude-code-project-boundary
CLAUDE.md90 starsChanged 7 months agoMITView on GitHub
Rules for anyone (Claude included) editing this plugin. The contents of session_hint.md are cat-ed by the SessionStart hook and prepended to every session's context window for every user of this plugin. Every byte costs the user tokens forever. Rules when editing the hint: The test measures wc -c < session_hint.md directly. Every entry is an escape hatch from the project boundary. See the warning at the top of allowlist.conf for the bypass risks. Keep entries narrow, purpose-specific, and comment the…
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Only add a quirk: if Claude measurably wastes tool calls without it.
- Distinctive: line 15
If you hit the budget, delete an old hint before adding a new one — never bump the budget casually.
- Very specific: line 21
Every entry is an escape hatch from the project boundary.
- Very specific: line 25
When closing a new bypass category in hooks/guard.sh, follow this flow strictly, one bypass at a time:
- Distinctive: line 33
Don't batch several bypasses into one commit — regression coverage gets muddy.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
project-boundary — plugin development notes
Rules for anyone (Claude included) editing this plugin.
hooks/session_hint.md — context-budget discipline
The contents of session_hint.md are cat-ed by the SessionStart hook and prepended to every session's context window for every user of this plugin. Every byte costs the user tokens forever.
Rules when editing the hint:
- Hard budget: 800 bytes of stdout. Enforced by
tests/test_session_hint.sh. - One short paragraph per quirk. Prefer the "avoid X, use Y" pattern as a single line; a brief multi-line example (e.g. a heredoc showing the ONE supported form) is allowed when it saves Claude multiple tool calls. If you add an example, keep it minimal and still within the 800-byte budget.
- Only add a quirk if Claude measurably wastes tool calls without it.
- Remove obsolete hints as soon as the underlying guard behavior changes.
- If you hit the budget, delete an old hint before adding a new one — never bump the budget casually.
The test measures wc -c < session_hint.md directly.
hooks/allowlist.conf — path-allowlist discipline
Every entry is an escape hatch from the project boundary. See the warning at the top of allowlist.conf for the bypass risks. Keep entries narrow, purpose-specific, and comment the reason each one exists.
Security-bypass TDD flow
When closing a new bypass category in hooks/guard.sh, follow this flow strictly, one bypass at a time:
- Reproducer first — add a failing test to
tests/test_bypass_reproducers.sh(expected: BLOCKED, exit 2). - Confirm bypass exists — run the suite; new test must FAIL. If it passes immediately, the bypass doesn't exist — stop.
- Patch — modify
hooks/guard.sh. - Regression — full
tests/test_guard.shmust be green. - Positive case — if the patch is broad, add a test of a legal use that must still PASS, so we don't over-block real workflows.
Don't batch several bypasses into one commit — regression coverage gets muddy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

