agentleFS
justijusti/claude-code-project-boundary/CLAUDE.md

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
  1. Distinctive:

    Only add a quirk: if Claude measurably wastes tool calls without it.

    line 13
  2. Distinctive:

    If you hit the budget, delete an old hint before adding a new one — never bump the budget casually.

    line 15
  3. Very specific:

    Every entry is an escape hatch from the project boundary.

    line 21
  4. Very specific:

    When closing a new bypass category in hooks/guard.sh, follow this flow strictly, one bypass at a time:

    line 25
  5. Distinctive:

    Don't batch several bypasses into one commit — regression coverage gets muddy.

    line 33

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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:

  1. Hard budget: 800 bytes of stdout. Enforced by tests/test_session_hint.sh.
  2. 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.
  3. Only add a quirk if Claude measurably wastes tool calls without it.
  4. Remove obsolete hints as soon as the underlying guard behavior changes.
  5. 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:

  1. Reproducer first — add a failing test to tests/test_bypass_reproducers.sh (expected: BLOCKED, exit 2).
  2. Confirm bypass exists — run the suite; new test must FAIL. If it passes immediately, the bypass doesn't exist — stop.
  3. Patch — modify hooks/guard.sh.
  4. Regression — full tests/test_guard.sh must be green.
  5. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.