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/juanmarchetto/agent-skills/setupgit clone --depth 1 https://github.com/JuanMarchetto/agent-skillsWrote 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/juanmarchetto/agent-skills/setup)<a href="https://agentmods.dev/commands/juanmarchetto/agent-skills/setup"><img src="https://agentmods.dev/badge/commands/juanmarchetto/agent-skills/setup.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.1 | $0.00033 | $0.00990 |
| Opus 5 | $0.00016 | $0.00495 |
| Sonnet 5 | $0.00007 | $0.00198 |
| Haiku 4.5 | $0.00003 | $0.00099 |
Grade A, and why
setup 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 — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/learn setup
Install the learn-by-mistake hooks for automatic error detection. This command MERGES hooks into your existing configuration — it never overwrites other hooks.
What it does
- Detect if hooks should go to project level (
.claude/hooks.json) or user level (~/.claude/hooks.json) - Read existing hooks file (if any)
- Merge learn-by-mistake hooks into the existing structure
- Write the merged result
- Verify installation
Protocol
Step 1: Determine scope
- If the user said
/learn setup --global→ use~/.claude/hooks.json - Otherwise → use
.claude/hooks.jsonin the current project root - Tell the user which location you're using
Step 2: Read existing hooks
Read the target hooks file. If it exists, parse the JSON. If it doesn't exist, start with:
{"hooks": {}}
Step 3: Merge — NEVER overwrite
For each hook type (PostToolUse, SessionStart, PreCompact):
If the hook type doesn't exist in the target file: add it entirely.
If the hook type already exists: APPEND learn-by-mistake hooks to the existing array. Never remove or modify existing hooks.
To prevent duplicates, check if any existing hook command contains "learn-by-mistake" or "detect-error" before adding.
Step 4: Determine script paths
The hook scripts live in the skill directory. Find them:
# Check common locations
SKILL_DIR=""
for dir in \
~/.claude/skills/learn-by-mistake \
.claude/skills/learn-by-mistake \
node_modules/learn-by-mistake-skill; do
if [ -f "$dir/hooks/scripts/detect-error.sh" ]; then
SKILL_DIR="$dir"
break
fi
done
Use ABSOLUTE paths in the hooks.json to avoid working directory issues.
Step 5: Write the merged hooks
The learn-by-mistake hooks to merge:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash <SKILL_DIR>/hooks/scripts/detect-error.sh",
"timeout": 5
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bash <SKILL_DIR>/hooks/scripts/load-lessons.sh",
"timeout": 3
}
]
}
],
"PreCompact": [
{
"hooks": [
{
"type": "command",
"command": "bash <SKILL_DIR>/hooks/scripts/preserve-lessons.sh",
"timeout": 3
}
]
}
]
}
}
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 · 147 lines · 33 tokens per session scan A e9c1e6cc55c4
setup is a command published in the GitHub repository JuanMarchetto/agent-skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 33 tokens to every session and 990 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-09-03.
Other commands, from other repositories
unicli-repair
Diagnose and fix a broken Uni-CLI adapter from the original failure evidence.
error-analysis
You are an expert error analysis specialist with deep expertise in debugging distributed systems, analyzing production incidents, and implementing comprehensive observability solutions.
telemetry
Inspect, opt in/out of, and audit mochi's anonymous usage telemetry.
insights
Owner-only — fetch and print the mochi-insight server's aggregate summary.
eg-fix-bug
Fix a bug using the elephant/goldfish workflow — problem doc, goldfish diagnosis check, failing test, fix, review, validate.
playbook
Manage Mochi playbooks (list, show, run, delete). Plays through the browser MCP tools.