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 skills/huzaifa525/claude-code-optimizer/worktreenpx skills add huzaifa525/claude-code-optimizer --skill worktreegit clone --depth 1 https://github.com/huzaifa525/claude-code-optimizerWhat 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.00029 | $0.00624 |
| Opus 5 | $0.00015 | $0.00312 |
| Sonnet 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 2d 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.
- 2d 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 (9 stars, last pushed 5mo ago), licensed MIT. It adds 29 tokens to every session and 624 once invoked, about $0.0001 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 skills, from other repositories
throughline
Use when the user asks to use Throughline from Codex, continue or restore Throughline memory, export read-only handoff context for a local launcher, prepare a new Codex thread handoff, summarize a captured Codex session, or check whether the Throughline Codex Stop hook captured the current session. Hide long…
critical-review
Use when you want structured feedback on a plan or document before implementation.
save
Save all session progress to status tracking files. Use when you want to checkpoint work mid-session or before ending.
code-review
Use when you want a thorough code review of files, changes, or the entire project before shipping.
implement-batch
Use when you want to implement the next batch of a plan. Handles module implementation, testing, and validation.
audit-orchestrator
Universal Pre-Scan → Analysis → Optimization → Report orchestrator for ANY project type — web apps (Astro/SvelteKit/Next), infrastructure/homelab repos, CLI tools, libraries, backend services, monorepos, data/ML projects, docs. Self-detects project type and runs the matching analysis track. Session state lives in…