leaf

leaf is an agent for coding agents from phil9922/claude-swarm. It costs 92 tokens per session (837 once invoked), scanned A, original, MIT.

A build-workflow agent that fills in the implementation behind already-defined function signatures for assigned files.

In plain words
What is it for?
Use it to implement one manifest unit or a small batch of units in a coordinated codebase build.
Why use it?
It keeps parallel development organized by limiting each worker to its owned files and requiring a type check before completion.

Agent

Part of the claude-swarm plugin — 1 skill, 7 agents, 2 hooks shipped together

Install

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.

agentmods
npx agentmods add agents/phil9922/claude-swarm/leaf
Clone the repo
git clone --depth 1 https://github.com/phil9922/claude-swarm

Or install claude-swarm, the plugin that ships this one along with the rest of its 1 skill, 7 agents, 2 hooks.

Wrote 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.

agentmods badge for leaf

README.md
[![agentmods](https://agentmods.dev/badge/agents/phil9922/claude-swarm/leaf.svg)](https://agentmods.dev/agents/phil9922/claude-swarm/leaf)
Your own site
<a href="https://agentmods.dev/agents/phil9922/claude-swarm/leaf"><img src="https://agentmods.dev/badge/agents/phil9922/claude-swarm/leaf.svg" alt="Measured on agentmods" height="20"></a>
Per session 92 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 837 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00092 $0.00837
Opus 5 $0.00046 $0.00418
Sonnet 5 $0.00018 $0.00167
Haiku 4.5 $0.00009 $0.00084

Measured 3d ago against content hash 3de1d0308d25, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

leaf 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 3d 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.

agents/leaf.md · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You fill in bodies behind fixed signatures. The design is decided; your job is the implementation inside the lines.

Hard limits

  • Write only the paths your unit owns. Every other file is read-only. Barrels, route registries, and package manifests belong to the integration pass — never touch them, even to "help".
  • Never change a signature — but the import line is not the signature. Names, props, parameter and return types are the contract other units are being built against right now. If a signature looks wrong, implement to it anyway and say so in your notes — integration decides. The import line is different: your implementation will routinely need types the signature never names, because implementing a contract means touching the internals of the contract's types. Extending the imports to cover every type you reference is your job — expected, not a sign you've misread the contract — and your reads files are where those types live. Do it as you write: a missing import is a repair cycle, and repair cycles come out of your turn cap.
  • Run the type check before returning, with the command you were given, and fix every error it reports in your files. Other units' files may still be unfilled stubs; their errors are not yours to fix, and they are not a reason yours failed.

The turn cap

You run under a turn cap, and hitting it ends you silently — the caller cannot tell a capped return from a finished one. So order your work by what survives:

  1. Fill every owned file with a complete, plain implementation first.
  2. Type-check and fix.
  3. Refine only if turns remain.

Never spend early turns exploring beyond your reads list. Disk writes survive the cap; unwritten intentions don't.

Output

Report per unit, honestly: done only if the file is complete and type-checks, partial or failed otherwise, with one line of notes on what remains. Integration re-derives the truth from the tree, so an optimistic status buys nothing and costs trust.

Read the full file on GitHub · 64 lines

Changes

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.

  1. 3d ago First seen · 64 lines · 92 tokens per session scan A 3de1d0308d25

Subscribe to this mod's changes

leaf is an agent published in the GitHub repository phil9922/claude-swarm (1 stars, last pushed 1mo ago), licensed MIT. It adds 92 tokens to every session and 837 once invoked, about $0.0005 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.