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 skills add huzaifa525/claude-code-optimizer --skill worktreegit clone --depth 1 https://github.com/huzaifa525/claude-code-optimizerWrote 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/skills/huzaifa525/claude-code-optimizer/worktree)<a href="https://agentmods.dev/skills/huzaifa525/claude-code-optimizer/worktree"><img src="https://agentmods.dev/badge/skills/huzaifa525/claude-code-optimizer/worktree/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/huzaifa525/claude-code-optimizer/worktree"><img src="https://agentmods.dev/badge/skills/huzaifa525/claude-code-optimizer/worktree.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00029 | $0.00624 |
| Opus 5.5 | $0.00012 | $0.00250 |
| Sonnet 5.5 | $0.00006 | $0.00125 |
| Haiku 4.5 | $0.00003 | $0.00062 |
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 3mo 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 — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Create an isolated git worktree for safe development on: $ARGUMENTS
Iron Law
All new feature work happens in a worktree. The main branch stays clean.
If you think "this change is small enough to do on main" — you are wrong. Worktrees cost 5 seconds. Debugging a polluted main branch costs hours.
Steps
1. Verify Clean Baseline
Before creating the worktree:
# Ensure we're in a git repo
git rev-parse --is-inside-work-tree
# Check for uncommitted changes
git status --porcelain
If there are uncommitted changes, ask the user whether to stash or commit them first. Do NOT proceed with dirty state.
2. Create the Worktree
Sanitize the branch name from the user's description:
- Lowercase everything
- Replace spaces and special characters with hyphens
- Remove consecutive hyphens
- Example: "User Notifications!" →
feature/user-notifications
# Create worktree on a new branch
git worktree add "../$(basename $PWD)-feature-$BRANCH_NAME" -b "feature/$BRANCH_NAME"
3. Verify Test Baseline
Run the project's test suite in the new worktree BEFORE making any changes:
cd "../$(basename $PWD)-$BRANCH_NAME"
# Run tests (detect test command from package.json, Makefile, etc.)
If tests fail BEFORE any changes, the baseline is broken. Stop and report.
4. Work in the Worktree
- Make all changes in the worktree directory
- Commit frequently with descriptive messages
- Run tests after each meaningful change
5. Finish
When work is complete, present options:
| Option | Command | When |
|---|---|---|
| Merge | git checkout main && git merge $BRANCH_NAME |
Feature is complete and tested |
| PR | gh pr create from the worktree branch |
Needs review before merge |
| Keep | Leave worktree as-is | Work in progress, will continue later |
| Discard | git worktree remove ../worktree-dir |
Experiment failed, throw it away |
Red Flags
- "Let me just make this quick fix on main" — NO. Use a worktree.
- "The tests were already failing" — Then fix the baseline FIRST.
- "I'll clean up the branch later" — You won't. Clean it now.
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.
- 3mo ago First seen · 81 lines · 29 tokens per session scan A 6955f8d02578
worktree is a skill published in the GitHub repository huzaifa525/claude-code-optimizer (11 stars, last pushed 8mo ago), licensed MIT. It adds 29 tokens to every session and 624 once invoked, about $0.0001 per session on Opus 5.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.
worktree compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| worktreehuzaifa525/claude-code-optimizer | Skill | 11 | 8mo ago | MIT | A | 29 | Claude Code |
| diff-projectluiseiman/dotforge | Skill | 8 | 26d ago | MIT | A | 25 | Claude Code |
| sync-all-reposluiseiman/dotforge | Skill | 8 | 26d ago | MIT | D | 39 | Claude Code |
| memstack-security-git-guardcwinvestments/memstack | Skill | 433 | 18d ago | MIT | A | 92 | Claude Code |
| memstack-development-changelog-generatorcwinvestments/memstack | Skill | 433 | 18d ago | MIT | A | 63 | Claude Code |
| land-and-deployFlorianBruniaux/claude-code-ultimate-guide | Skill | 7.6k | today | CC-BY-SA-4.0 | A | 41 | Claude Code |
| review-prFlorianBruniaux/claude-code-ultimate-guide | Skill | 7.6k | today | CC-BY-SA-4.0 | A | 45 | Claude Code |