lumberjack
AGENTS.md0 starsChanged 24 days agoMITView on GitHub
Claude Code and Codex plugin repository: worktree sweep and Stop hook gate. Users start at README.md; terms are in GLOSSARY.md. - scripts/sweep_worktrees.py - worktree and branch sweep (standard-library Python 3.11+). - scripts/setup_lumberjack.py - setup helper: discover prints repo facts as JSON (read-only), apply ANSWERS.json writes .lumberjack.toml, the post-merge hook (marker-bounded block), Claude settings, the instructions block and .gitignore entries; never commits. Both resolve the primary checkout first (find_primary), so setup works from a linked worktree. scope = "local" writes untracked…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- cleanupSkill
- lumberjackSkill
- setupSkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
Keep LF line endings.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.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
lumberjack
Claude Code and Codex plugin repository: worktree sweep and Stop hook gate.
Users start at README.md; terms are in GLOSSARY.md.
Layout
scripts/sweep_worktrees.py- worktree and branch sweep (standard-library Python 3.11+).scripts/setup_lumberjack.py- setup helper:discoverprints repo facts as JSON (read-only),apply ANSWERS.jsonwrites.lumberjack.toml, the post-merge hook (marker-bounded block), Claude settings, the instructions block and.gitignoreentries; never commits. Both resolve the primary checkout first (find_primary), so setup works from a linked worktree.scope = "local"writes untracked files instead:.git/lumberjack.toml(LOCAL_CONFIG, the last placeconfig_fileslooks),.git/hooks/post-merge,CLAUDE.local.md,.git/info/exclude. Apply never writes through a symlink (instructions_target). Importssweep_worktreesfor config loading andparse_config, remote URL parsing, the hook markers (HOOK_BEGIN,HOOK_END,HOOK_MARKERS) andhook_manager(HOOK_MANAGERStable).skills/lumberjack/SKILL.md- the rules the script enforces.skills/cleanup/SKILL.md-/lumberjack:cleanup(user-invoked only): runs--cleanup, then removesunverifiedandlanded-probableworktrees one confirmed--remove <path>at a time.skills/setup/SKILL.md- run-once interview (/lumberjack:setup, user-invoked only) that drivesdiscoverandapply; its questions follow their JSON keys.hooks/hooks.json- shared hooks: SessionStart, SubagentStart and Stop all run the sweep's--hook, which reads the hook input on stdin and dispatches onhook_event_name..claude-plugin/,.codex-plugin/plugin.json,.agents/plugins/marketplace.json- Claude Code and Codex manifests and marketplace listings.VERSION- keep it equal to bothplugin.jsonfiles,pyproject.tomland the two version mentions inwebsite/dist/index.html.README.md- the stranger-facing guide; its config table, tier and reason names, summary line and setup output lines must match the scripts verbatim.CHANGELOG.md- one section per releasedVERSION..github/workflows/release.yml- releases: a push to main that changesVERSIONchecks the other version files match, then tagsv<VERSION>and publishes a GitHub release whose notes are the## <VERSION>section ofCHANGELOG.md. A release PR only bumps the files and renames## Unreleased; never tag by hand.website/- the static product site (website/dist, no build step), deployed to GitHub Pages by.github/workflows/site.yml; seewebsite/README.md. Its demo quotes the sweep's and gate's output lines and the install commands verbatim, and shows the version twice.GLOSSARY.md- the sweep's vocabulary (integrated, landed, probable, unverified, dependent, fresh, locked, cleanup).SECURITY.md- private vulnerability reporting and what counts as a security issue.tests/- pytest suite, one module per area:test_sweep_worktrees.py,test_config.py,test_setup_discover.py,test_setup_apply.py,test_lifecycle.py,test_rule_delivery.py;conftest.pyisolates HOME, git identity andshutil.which,helpers.pyholdsgitandwrite. Main seams: each script'smain()against temp git repos, aghshim on PATH, and a real merge through the Python hook. A few tests callclassify,short_path,load_config,parse_config,block_reasonandmanager_wireddirectly and patchorphan_candidates,GH_TIMEOUTandgh_facts.
Tests
python -m pip install "pytest>=8", then python -m pytest -q.
Rules
- Scripts stay standard-library only and run on Python 3.11.
- Keep LF line endings.
skills/lumberjack/SKILL.mdstays at most 79 lines,skills/setup/SKILL.mdat most 120; they andskills/cleanup/SKILL.mdname no consumer project, path or ticket; config keys carry the project-specific values.branch_patternchecks names againstbranch_shapes(elseLEGACY_SHAPES).- Session start must stay well inside its 30 s timeout at 400 worktrees (11 s on Linux): nothing
quadratic in worktrees; guesses yield to
PROBABLE_SECONDS. - The hooks act only on a repository with a config file (
is_set_up); without one, session start printsNOT_SET_UPand the Stop gate is off. Never gate or prune on bareDEFAULTS.
Release checklist
Our repos share one shape (main, <owner>/ branches), so each release proves a foreign one:
- Tests cover a trunk other than
main, a primary checkout off trunk and an unconfigured repo. - A marketplace install (not
--plugin-dir) on macOS and on Windows reaches a finished setup on a repository that is not lumberjack or FairPrompt. - The
CHANGELOG.mdsection says whether to re-run setup.
<!-- >>> lumberjack -->Lumberjack
Worktree rules live in the lumberjack skill; config in .lumberjack.toml.
Session start cleans up landed worktrees; the Stop hook gates debt.
Re-run the lumberjack:setup skill after conventions change.
<!-- <<< lumberjack -->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.

