carrel
CLAUDE.md2 starsChanged 5 months agoMITView on GitHub
Resume from disk: read STATE.md first — it always says what's done, what's in flight, and what's next. Decisions live in docs/DECISIONS.md. The product name, tagline, and version live ONLY in product.json at the repo root. Never hardcode the name in code. Docs/manifests may use the name in prose, but anything generated (CLI banner, --version, asset text) must read product.json. Do not run scripts/finalize.sh: it was for the original hand-off only (it relocates the tree and creates a new repo;…
In this repositoryOne other file it gives its agents.
- docs/AGENTS.mdAGENTS.md
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
Resume from disk: read STATE.md first — it always says what's done, what's in flight, and what's next.
- Very specific: line 19
Every CLI command MUST have: working --help, --json flag when output is data, ≥1 test, graceful degradation when an optional binary is …
- Very specific: line 20
No stubs/TODO/placeholder code in shipped commands.
- Distinctive: line 49
Never commit generated junk (see .gitignore).
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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 CLAUDE.md — Local File Toolkit + Plugin Marketplace
Resume from disk: read STATE.md first — it always says what's done, what's in flight, and what's next. Decisions live in docs/DECISIONS.md.
Product name — single source of truth
The product name, tagline, and version live ONLY in product.json at the repo root. Never hardcode the name in code. Docs/manifests may use the name in prose, but anything generated (CLI banner, --version, asset text) must read product.json. Do not run scripts/finalize.sh: it was for the original hand-off only (it relocates the tree and creates a new repo; STATE.md).
Stack & layout
- Python ≥3.12 (dev box: 3.14), managed by uv (
pyproject.toml,uv run,uv sync). - Core library in
src/carrel/; umbrella CLI entry inpyproject.toml [project.scripts]. - All external binaries are called through the single adapter layer
src/carrel/core/adapters.py— neversubprocessdirectly from command modules. Adapters do capability detection and convert timeouts into a clean error. One documented exception:core/actions.pyruns the user-authored--runshell actions ofwatchandbatch(shell-quoted substitutions,--action-timeout; D-013). - Repo root doubles as a Claude Code plugin marketplace:
.claude-plugin/marketplace.json+plugins/<name>/.
Coding standards
- Python: type hints on public functions,
pathlib.Pathover strings, no global state, f-strings, stdlibargparse-free — we use the CLI framework chosen in Phase 2 (see docs/ARCHITECTURE.md). - Every CLI command MUST have: working
--help,--jsonflag when output is data, ≥1 test, graceful degradation when an optional binary is missing (actionable message + install hint, exit code 3 — never a traceback, never a silent no-op). - No stubs/TODO/placeholder code in shipped commands. Cut and document in
docs/FEATURES.mdinstead. - Wrap, don't rewrite: prefer proven libraries/binaries via the adapter layer; attribute in docs/LICENSES section.
Exit code convention
0success1general/unexpected error (message to stderr, no traceback unless--debug);diffreuses 1 to mean "inputs differ" (documented in its--help)2bad usage/arguments (argparse-style)3missing optional dependency (message names the binary + install hint)4input file not found / unreadable / unsupported type5operation produced no result (e.g., search with no hits when--fail-empty)
Testing
uv run pytestfrom repo root runs everything. Fixtures intests/fixtures/(generated bytests/fixtures/generate.py; never hand-edit binaries).- Tests that need an optional binary must skip (with reason) when it's absent, not fail.
- A test gives the same result on any day it runs. A file dated by its mtime gets the mtime pinned with
PINNED_MTIMEfromtests/conftest.py(noon local time on a fixed past day, so the date is the same in every timezone); code that reads the clock gets a fixed or injected time, or the test does not assert on what the clock decided. Prove a pin by removing it and watching the test fail (docs/CONTRIBUTING.md, How to add a command, step 4).
Subagent rules
Subagents: read your spec in specs/, respect your write boundary exactly, and report: files touched, tests written+run (with real output), deviations from spec, open issues. Claims are verified by execution — write tests that actually run.
Versioning
product.json is the only place a version is typed by hand. Bump it, run scripts/sync_product.py (regenerates _product.py, pyproject.toml, plugin/marketplace manifests, CITATION.cff), add a CHANGELOG.md entry; tests/test_product_sync.py fails otherwise. Release steps: docs/RELEASING.md.
Git
- Branch
mainis protected by a ruleset: changes land through a PR with greenlint/test/test-minimalchecks (admin bypass for emergencies only). Historical commits usedphase(N): .../wave(N): ...; use conventional prefixes (fix:,feat:,docs:,ci:) now. - Never commit generated junk (see .gitignore); fixtures ARE committed once generated.
Review gates the merge
A PR merges only after /code-review <pr> high has completed and every
confirmed finding is either fixed in that same PR or written into STATE.md
Open issues with the reason it was deferred. A PR whose review has not finished
is not merged, however green CI is — the reviews find things CI cannot. In the
v0.4.0 session three of them found 42 verified defects across five PRs; in
v0.4.1 one of them found that the new work-tree guard did not stop the incident
it was written for. Launch the review right after opening the PR so it runs
while CI does.
Mutating smoke tests run in /tmp, never in the checkout
Any hand-run of --apply, batch --run, intake or watch happens in a
scratch directory under /tmp (mktemp -d), never against this working tree or
any path inside it. On 2026-09-10 a carrel rename --apply aimed at the
checkout renamed 21 tracked files; recovery was possible only because the
command prints its plan. carrel now refuses to move files git is tracking
(spec 29), but that guard is the second line of defence, not a licence to test
in place — and --force exists.
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.

