better-writing
CLAUDE.md64 starsChanged 2 months agoMITView on GitHub
These rules are for automated agent runs that can share one checkout of this repo with other runs. The maintainer's orchestrator (Paperclip) starts such runs and sets PAPERCLIP_WORKSPACE_CWD and PAPERCLIP_AGENT_ID. Before your first git command, decide which rules apply to you: - Run printenv PAPERCLIP_WORKSPACE_CWD. If it prints a path, this whole file applies. - If it prints nothing, run git worktree list. If it lists worktrees that you did not make, or you know that other agents use this…
In this repositoryOne other file it gives its agents.
- better-writingSkill
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Very specific: line 7
Run printenv PAPERCLIP_WORKSPACE_CWD.
- Distinctive: line 8
If it prints nothing, run git worktree list.
- Distinctive: line 14
If you cannot tell, act as in the bullet above.
- Very specific: line 38
Never run checkout, switch, reset, stash, merge, rebase, commit, clean, apply, or pull there, and never edit a tracked file there.
- Distinctive: line 44
Before your first edit, get an isolated working tree.
- Distinctive: line 83
Stop. Do not commit and do not stash — both make it worse for whoever else is in there.
≈ “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
Agent instructions
These rules are for automated agent runs that can share one checkout of this repo with other runs.
The maintainer's orchestrator (Paperclip) starts such runs and sets PAPERCLIP_WORKSPACE_CWD and
PAPERCLIP_AGENT_ID. Before your first git command, decide which rules apply to you:
- Run
printenv PAPERCLIP_WORKSPACE_CWD. If it prints a path, this whole file applies. - If it prints nothing, run
git worktree list. If it lists worktrees that you did not make, or you know that other agents use this checkout, treat the checkout as shared. Rules 1, 3 and 4 and the last section apply. Instead of the script in Rule 2, make your worktree outside the checkout withgit worktree add -b <type>/<task>-<slug> ../<name>, and remove it withgit worktree removewhen you finish. Do the same if the script in Rule 2 exits because a variable is missing. - If you cannot tell, act as in the bullet above.
- None of this file applies only when you know that nobody else uses this checkout at the same time: for example, a human in their own clone, or an agent whose user says the clone is theirs alone. CONTRIBUTING.md says how to work on the repo.
Git workspace hygiene for automated agents
This section is for automated agent runs that share a checkout of this repo. The start of this file says when it applies.
The shared checkout is the repo itself. The orchestrator provisions one clone per project,
not one per task, and this project is a single repo — so the clone you are standing in is the
only one every concurrent run has. Running git checkout or git reset there replaces
another run's working tree mid-task.
This is measured, not theoretical. Concurrent runs on this repo have moved a shared checkout's HEAD repeatedly inside a single twenty-minute window, including hard resets that discarded uncommitted changes.
Rule 1 — never mutate the project checkout
In the project checkout, the only git commands allowed are read-only queries plus fetch,
remote, and worktree add|remove|list|prune.
Never run checkout, switch, reset, stash, merge, rebase, commit, clean,
apply, or pull there, and never edit a tracked file there. Every edit happens in your
per-task worktree.
Rule 2 — work in a per-task worktree
Before your first edit, get an isolated working tree. A linked worktree shares the object store, so it costs a couple of MB and no extra fetch:
WT=$(scripts/issue-worktree.sh . FOR-123 docs/123-short-slug)
cd "$WT"The first argument is . because this project's checkout is the repo itself; the script also
accepts a subdirectory name for projects that nest several clones under one checkout. The full
signature is <repo-dir> <issue-key> [branch] [base-ref]. It prints only the worktree path, is
idempotent across runs on the same task, refuses to steal a branch another worktree already
holds, and never resets an existing branch. Read it before you trust it — it is short.
Then edit, commit, and push entirely from $WT. If you are woken again on the same task,
re-run the script; it returns the same path.
Rule 3 — tear down when the task is finished
Once your branch is pushed and the task is done or handed off:
git -C "$PAPERCLIP_WORKSPACE_CWD" worktree remove "$WT"
git -C "$PAPERCLIP_WORKSPACE_CWD" worktree prune$PAPERCLIP_WORKSPACE_CWD is the project checkout. Use --force only when you mean to discard
your own uncommitted changes. Never force-remove a worktree that is not yours — the path
contains the owning agent's id.
Rule 4 — one branch per task
Git refuses to check out one branch in two worktrees. Name branches after the task
(<type>/<task-number>-<slug>) so concurrent tasks cannot collide. If issue-worktree.sh
reports the branch is already checked out, another run owns it: coordinate on the task rather
than forcing it.
If you already edited the project checkout
Stop. Do not commit and do not stash — both make it worse for whoever else is in there. Create your worktree, re-apply your changes in it, and say what happened on the task.
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.

