build-until-pass
Use when a build, typecheck, lint, or test command is failing and you want the agent to drive it to green on its own — run the…
Use BEFORE invoking the Task or Agent tool to spawn a subagent. Anthropic does NOT share prefix cache across subagents — every subagent cold-starts and re-tokenizes its full prompt (system prompt + tool definitions + the context you handed it). Spawning N subagents with full
$ npx -y skills add lichamnesia/lich-skills --skill subagent-brief --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/subagent-briefContext preview
The summary Claude sees to decide when to auto-load this skill.
Use BEFORE invoking the Task or Agent tool to spawn a subagent. Anthropic does NOT share prefix cache across subagents — every subagent cold-starts and re-tokenizes its full prompt (system prompt + tool definitions + the context you handed it). Spawning N subagents with full
name: subagent-brief description: Use BEFORE invoking the Task or Agent tool to spawn a subagent. Anthropic does NOT share prefix cache across subagents — every subagent cold-starts and re-tokenizes its full prompt (system prompt + tool definitions + the context you handed it). Spawning N subagents with full context = N× token cost; a single fan-out can burn an entire Max-plan day. This skill enforces a pre-flight discipline: compress every subagent prompt into a ≤200-word brief before spawning. Triggers when the agent is about to call Task / Agent tool, especially with long files, full repo dumps, or N parallel subagents on similar work.
Pre-flight checklist for spawning subagents in Claude Code. The single most expensive mistake in multi-agent workflows is treating subagents as free threads. They are not. Each subagent is an independent LLM call that re-tokenizes the entire prompt you hand it.
There is **no prefix sharing across subagents** in Anthropic's serving stack today. The multi-agent topology is a known optimization opportunity (see arXiv 2604.25899 *Pythia: Predictability-Driven Agent-Native LLM Serving*, 2026-04) but has not yet shipped in production. Until it does, the burden of compression falls on the orchestrating agent.
The math: 20 subagents × 50K shared context = ~1M tokens per fan-out. One careless Task call exhausts a Max-plan daily quota.
For every subagent you are about to spawn, apply these five rules in order.
The subagent gets its own system prompt, its own tool list, and its own task framing automatically. Do **not** paste your own conversation history, your TODO list, or your reasoning trail into the subagent prompt unless the subagent literally needs them to do its job.
BAD: Here is the full content of foo.py: <800 lines> GOOD: Read /abs/path/to/foo.py and report the public API.
The subagent has Read access. One Read call is cheaper than re-tokenizing 800 lines on every spawn.
BAD: <entire 50K context window dump> — now look for X GOOD: Project context: <3-line summary>. Look for X in <specific path>.
If you genuinely synthesized something useful from your context, summarize it in 1-3 sentences and pass that summary. Never paste the raw window.
The brief should fit in a tweet-length window. If it does not, you are either dumping context the subagent can fetch itself, or handing over a task too large for one subagent — split it.
Before spawning N parallel subagents, ask: do they all share the same long context? If yes, you are about to multiply cost by N. Either:
(the per-item task), not the shared context.
ROLE: <one line — what this subagent is> GOAL: <one line — what it should produce> INPUTS: - <path or 1-line summary, never raw content> - <path or 1-line summary> CONSTRAINTS: - <output format, what NOT to do> RETURN: <one line — what to report back>
Total ≤ 200 words. If it does not fit, the task is too large for one subagent. Split it.
| Excuse | Reality | |---|---| | "Faster to just paste the whole file." | Faster for *you*. The subagent re-tokenizes 800 lines on every spawn. | | "Parallelism will be 5× faster." | 5× faster wall-clock, 5× more tokens — and Max plan caps are *daily*, not hourly. The hourly speedup costs you the rest of the day. | | "The subagent needs context." | It needs *information*. A summary is information. The raw window is dump. | | "I'll just pass the whole repo, it's small." | "Small" repos compound across 10 subagents into a Max-plan kill. | | "I don't have time to summarize." | Summarizing forces you to clarify what the subagent should do — which is 80% of why subagents fail anyway. | | "The user wanted parallel." | The user wanted *fast*. Token-budget parallel ≠ wall-clock parallel. Default to sequential unless tasks are genuinely independent. |
Spawn the subagent. Then evaluate:
constraint and re-spawn (rare).
re-spawn (rare).
followed the five rules.
Most "subagent failures" are brief failures, not subagent failures.
If you catch yourself writing any of these in a subagent prompt, stop and re-compress:
Multi-agent serving is a 2026 research topic, not a shipped feature. arXiv 2604.25899 (Pythia, 2026-04) demonstrates that exposing multi-agent topology to the serving layer can recover 3-5
Personal skill collection for Claude Code, Gemini CLI, and OpenAI Codex — by @LichAmnesia. Telegraph-style, opinionated, no filler. Engineering judgment skills plus high-leverage utility tools. 中文版:README-zh.md
Use when a build, typecheck, lint, or test command is failing and you want the agent to drive it to green on its own — run the…
Use when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in…
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web…
Use BEFORE any spec, plan, or code exists — the Stage 0 gate that decides whether a project should start at all. NO-GO is the…
Analyze Google Analytics 4 data — review website performance, identify traffic patterns, diagnose high-bounce pages, compare time…
Generate or edit images with Google's Nano Banana 2 (`gemini-3.1-flash-image-preview`). Use when the user asks to generate an…