Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/marcusgoll/Spec-Flownpx agentmods add skills/marcusgoll/spec-flow/worktree-contextWrote 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/marcusgoll/spec-flow/worktree-context)<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/worktree-context"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/worktree-context/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/marcusgoll/spec-flow/worktree-context"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/worktree-context.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.00000 | $0.01490 |
| Opus 5.5 | $0.00000 | $0.00596 |
| Sonnet 5.5 | $0.00000 | $0.00298 |
| Haiku 4.5 | $0.00000 | $0.00149 |
Grade A, and why
worktree-context 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 2mo 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 — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Worktree Context Skill
Provides centralized worktree handling for workflow commands, eliminating ~50 lines of inline code per command.
Purpose
Git worktrees enable parallel development by allowing multiple branches to be checked out simultaneously. This skill provides a single source of truth for worktree detection, creation, and context generation.
Quick Reference
# Check if in worktree
bash .spec-flow/scripts/bash/worktree-context.sh in-worktree && echo "yes" || echo "no"
# Get worktree info (JSON)
bash .spec-flow/scripts/bash/worktree-context.sh info
# Create worktree for feature
bash .spec-flow/scripts/bash/worktree-context.sh create "feature" "001-auth" "feature/001-auth"
# Generate Task() agent context block
bash .spec-flow/scripts/bash/worktree-context.sh context "/path/to/worktree"
Output Format
Info Command
Returns JSON with worktree details:
{
"is_worktree": true,
"worktree_path": "/path/to/worktrees/feature/001-auth",
"root_path": "/path/to/main/repo",
"branch": "feature/001-auth",
"worktree_type": "feature",
"worktree_slug": "001-auth"
}
Fields
| Field | Values | Description |
|---|---|---|
is_worktree |
boolean | Whether currently in a worktree |
worktree_path |
string | Absolute path to worktree |
root_path |
string | Absolute path to main repository |
branch |
string | Current git branch |
worktree_type |
feature, epic |
Type of worktree |
worktree_slug |
string | Feature/epic slug |
Compact Pattern (v11.2)
In Command Process Section
Replace 50+ lines of inline worktree detection with this compact reference:
### Step N: Worktree Context (Optional)
**Check worktree using centralized skill** (see `.claude/skills/worktree-context/SKILL.md`):
1. Check preference: `bash .spec-flow/scripts/utils/load-preferences.sh --key "worktrees.auto_create" --default "true"`
2. Check if already in worktree: `bash .spec-flow/scripts/bash/worktree-context.sh in-worktree`
3. If NOT in worktree AND auto_create is true:
- Create: `bash .spec-flow/scripts/bash/worktree-context.sh create "feature" "$SLUG" "$BRANCH"`
- Store path in state.yaml: `yq eval ".git.worktree_path = \"$PATH\"" -i state.yaml`
4. For Task() agents, generate context: `bash .spec-flow/scripts/bash/worktree-context.sh context "$PATH"`
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.
- 2mo ago First seen · 198 lines · 0 tokens per session scan A 596d490d18e8
worktree-context is a skill published in the GitHub repository marcusgoll/Spec-Flow (97 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,490 tokens. 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-09-03.
worktree-context compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| worktree-contextmarcusgoll/Spec-Flow | Skill | 97 | 2mo ago | MIT | A | 0 | Claude Code |
| antigravity-maintainer-batch-releasesickn33/agentic-awesome-skills | Skill | 51k | yesterday | MIT | A | 60 | Claude Code, Codex |
| write-changelogDonchitos/Claude-Code-Game-Studios | Skill | 42k | 21d ago | MIT | A | 24 | Claude Code |
| github-automationsickn33/agentic-awesome-skills | Skill | 51k | yesterday | MIT | A | 42 | Claude Code |
| resolve-conflictstailcallhq/forgecode | Skill | 7.6k | today | Apache-2.0 | A | 68 | Claude Code, Codex |
| team-releaseDonchitos/Claude-Code-Game-Studios | Skill | 42k | 21d ago | MIT | A | 33 | Claude Code |
| write-release-notestailcallhq/forgecode | Skill | 7.6k | today | Apache-2.0 | A | 105 | Claude Code, Codex |