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/rmolines/fractal-loop/patchgit clone --depth 1 https://github.com/rmolines/fractal-loopWhat 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.00073 | $0.04330 |
| Opus 5 | $0.00036 | $0.02165 |
| Sonnet 5 | $0.00015 | $0.00866 |
| Haiku 4.5 | $0.00007 | $0.00433 |
Grade B, and why
patch scanned grade B with 1 finding 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 today.
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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
REPO_NAME=$(grep "^alias:" "$REPO_ROOT/.claude/project.md" 2>/dev/null | sed 's/^alias: //' | head -1) How it starts
The opening of the file, as written. The whole thing — 547 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/fractal:patch
Human gates
Every time this skill needs human input, use the AskUserQuestion tool instead of printing the question as text output.
Context header (REQUIRED on every question when state is available): Prefix the question string with:
📍 | 🎯 <active_predicate (max 80 chars)>
Variables come from the pre-loaded State section. If state is not yet loaded (e.g., early steps of /fractal:propose before tree detection), omit the header.
IMPORTANT: The header must be plain text. No markdown formatting (no **, ##, *, etc.) in the question string. Emojis are fine as visual anchors.
You are a fast-iteration agent. The user knows what they want — your job is to implement it in isolation, present the result, and let them decide what to do with it.
No PRD. No plan. No cycles. Just: implement → present → decide.
Input: $ARGUMENTS — description of the change to make. Required.
On entry: detect context and parse arguments
Detect project context
REPO_ROOT=""
REPO_NAME=""
if git rev-parse --is-inside-work-tree 2>/dev/null; then
REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_NAME=$(grep "^alias:" "$REPO_ROOT/.claude/project.md" 2>/dev/null | sed 's/^alias: //' | head -1)
[ -z "$REPO_NAME" ] && REPO_NAME=$(basename "$REPO_ROOT")
fi
Read .claude/project.md for:
SPEC="$REPO_ROOT/.claude/project.md"
BUILD_CMD=$(grep "^build:" "$SPEC" 2>/dev/null | sed 's/^build: //' | head -1)
TEST_CMD=$(grep "^test:" "$SPEC" 2>/dev/null | sed 's/^test: //' | head -1)
SMOKE_CMD=$(grep "^smoke:" "$SPEC" 2>/dev/null | sed 's/^smoke: //' | head -1)
DEPLOY_CMD=$(grep "^deploy:" "$SPEC" 2>/dev/null | sed 's/^deploy: //' | head -1)
HOT_FILES=$(awk '/^## Hot files/{found=1; next} found && /^- /{print substr($0,3)} found && /^##/{exit}' "$SPEC" 2>/dev/null)
Verify fractal tree exists
FRACTAL_DIR="$REPO_ROOT/.fractal"
if [ ! -d "$FRACTAL_DIR" ] || [ -z "$(ls -d "$FRACTAL_DIR"/*/root.md 2>/dev/null)" ]; then
# No tree found
fi
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.
- today First seen · 547 lines · 73 tokens per session scan B e241fc94ba86
patch is a command published in the GitHub repository rmolines/fractal-loop (13 stars, last pushed 5mo ago), licensed MIT. It adds 73 tokens to every session and 4,330 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
pm-arch
Scan project structure and generate Mermaid architecture diagrams + flowcharts under .pm/architecture/.
pm-done
Close a todo (TODO-xxx), sync completed.md, refresh overview.
pm-status
Show governance health, wizard next step, all open blocking/high todos, and pending review count. Primary daily entry.
pm-charter
Create, import, discover, approve, or skip project charter. No-arg form is an interactive wizard.
_closing
会改 .pm/ 的 /pm- 回复必须有一句中文摘要。链接只列已经存在的文件,不要指向还没生成的路径。.
pm-tests
List missing unit-test companions for core/changed sources. Do not write tests into the business tree unless the user confirms.