Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/craigcossairt/trellis/worktreegit clone --depth 1 https://github.com/craigcossairt/trellisWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/craigcossairt/trellis/worktree)<a href="https://agentmods.dev/commands/craigcossairt/trellis/worktree"><img src="https://agentmods.dev/badge/commands/craigcossairt/trellis/worktree.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00044 | $0.00571 |
| Opus 5 | $0.00022 | $0.00285 |
| Sonnet 5 | $0.00009 | $0.00114 |
| Haiku 4.5 | $0.00004 | $0.00057 |
Grade A, and why
worktree scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Git Worktree Workflow
Run parallel agent sessions on independent tasks using git worktrees.
When to Use
- You have 2+ independent tasks that touch different files
- Tasks are on separate tracker issues
- You want to multiply throughput by running parallel sessions
When NOT to Use
- Tasks touch the same files (merge conflicts)
- One task depends on the output of another
- Quick single-file fixes (just do them sequentially)
Step 0: Claim the Branch
Worktrees stop two sessions sharing a checkout. They do nothing about two sessions sharing a branch, which is the collision you actually hit once more than one agent runs at a time - they all authenticate as the same git identity, so nothing tells them apart.
bin/claim-branch.sh feature/<task-name>
Exit 0 free, 1 claimed by someone else (pick another branch or coordinate), 2 could not tell. Exit 2 never means free. And a clean fast-forward is not permission - that is exactly what a collision looks like from the inside, so "it merged fine" is not evidence that nobody else was there.
Run it again before pushing to any branch you did not create.
Setup a Worktree
# From the repo root
git worktree add ../<repo>-worktree-<task-name> -b feature/<task-name>
Then open a new agent session in the worktree directory and work there.
Cleanup After Merge
git worktree remove ../<repo>-worktree-<task-name>
git branch -d feature/<task-name>
git pull origin main
Rules
- Claim before you branch -
bin/claim-branch.shfirst, every time (Step 0) - Each worktree gets its own agent session - don't share sessions
- Only for truly independent work - different files, different features
- Always clean up - remove worktrees after merge to avoid stale branches
- Start small - try 2 parallel sessions before scaling up
- Main stays clean - the main worktree stays on the main branch
Tips
- Name worktrees after the tracker issue ID
- Each worktree has its own dependency/build cache, so install runs once per worktree
- If you need to share changes between worktrees, commit and cherry-pick
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 70 lines · 44 tokens per session scan A 3d2cc368d1e3
worktree is a command published in the GitHub repository craigcossairt/trellis (4 stars, last pushed 14d ago), licensed MIT. It adds 44 tokens to every session and 571 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
adr-review
Run the workflow in docs/playbooks/adr-review.md. You review only — never write or rewrite the ADR for me. Check problem framing, option fairness, trade-offs and consequences, reversibility, the revisit trigger, and weak reasoning. Give pointed questions and concrete suggestions; I write the words. If it supersedes an…
milestone
Produce the next build doc. Run the workflow in docs/playbooks/milestone.md: read the active mode and current phase from PROJECT.md, find the next milestone in docs/progress.md, and write docs/milestones/ . - .md in the six-part format (Concept · ADR · Guided build · Challenges · Verify · Stretch). Respect the mode …
mode
Run the workflow in docs/playbooks/mode.md: read the current mode from PROJECT.md, confirm the trade-off of the target mode in one line, update the Mode field and Current mode: line in PROJECT.md, and confirm the new rules. Modes: guided (I write all code), collab (split), autopilot (you write it and teach). Full…
progress
Run the workflow in docs/playbooks/progress.md: read PROJECT.md, docs/progress.md, and the actual repo (trust the repo over the doc). Locate me, name concrete progress, append a dated session-log entry, propose the single next action, and check docs/learning-debt.md for anything worth pulling in. If I seem stuck…
start
Turn this freshly cloned template into my project. Run the workflow in docs/playbooks/start.md: welcome me, run a short conversational interview (idea, background, goals, mode, stack, pace), then write PROJECT.md, the design skeleton, and the roadmap in docs/progress.md, and offer to write my first milestone. Keep it…
crossframe-essay
使用 CrossFrame Essay 把用户给出的主题、素材或问题写成中文批判性洞察文章。.