agent-builder

A guide for building agent harnesses: the code and tools around an AI model that let it observe information, take actions, and follow permissions. It covers single-agent and multi-agent designs.

In plain words
What is it for?
Use it when creating an agent, designing its tools, debugging its action loop, or choosing an agent architecture.
Why use it?
It helps structure the surrounding software without putting the model's reasoning into rigid application code.

Skill for Claude CodeCodex

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 skills/fareedkhan-dev/claude-code-from-scratch/agent-builder
Any agent
npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder
Clone the repo
git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,048 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00034 $0.01048
Opus 5 $0.00017 $0.00524
Sonnet 5 $0.00007 $0.00210
Haiku 4.5 $0.00003 $0.00105

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

Security

Grade A, and why

agent-builder scanned grade A 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 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

Bad: `output = subprocess.run("npm test", timeout=300)`
skills/agent-builder/SKILL.md · 147 lines

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.

Agent Builder Skill

When to use this skill

Load this skill when the user wants to:

  • Build a new agent from scratch
  • Design a tool for an agent
  • Structure a multi-agent system
  • Debug an agent loop that isn't working
  • Choose between agent architectures

Core principle

The agent is always the model. Your job is the harness.

Harness = Tools + Knowledge + Observation + Action + Permissions

Never try to encode intelligence in your harness code. Give the model clean tools, clear context, and get out of the way.

The minimal agent (always start here)

from anthropic import Anthropic
client = Anthropic()

def agent_loop(messages, tools, dispatch, system):
    while True:
        response = client.messages.create(
            model="claude-sonnet-4-20250514",
            system=system, messages=messages,
            tools=tools, max_tokens=8000,
        )
        messages.append({"role": "assistant", "content": response.content})
        if response.stop_reason != "tool_use":
            return
        results = []
        for block in response.content:
            if block.type == "tool_use":
                output = dispatch[block.name](block.input)
                results.append({"type": "tool_result",
                                 "tool_use_id": block.id, "content": output})
        messages.append({"role": "user", "content": results})

Do not add anything until you need it. Every mechanism should earn its place.

Tool design checklist

Before writing a tool, ask:

  • Is the name a verb? (bash, read, write — not "file_manager")
  • Does the description say WHEN to use it, not just what it does?
  • Is the input schema minimal? No optional fields unless truly needed.
  • Does it return plain text the model can reason about?
  • Does it have a hard timeout?
  • Is output truncated to a safe length (≤50k chars)?

Tool description formula

"[Action verb] [what it does]. Use when [specific situation].
[What it returns]. [Any important limits]."

Read the full file on GitHub · 147 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 · 147 lines · 34 tokens per session scan A b058947ebaa8

Subscribe to this mod's changes

agent-builder is a skill published in the GitHub repository FareedKhan-dev/claude-code-from-scratch (294 stars, last pushed 5mo ago), licensed MIT. It adds 34 tokens to every session and 1,048 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

implementation-strategy

Choose compatibility-aware scope for runtime and API changes in openai-agents-python. Use before initial implementation and each review-feedback batch to decide whether to patch, reset the design, preserve compatibility, or reject unsupported cases.

openai/openai-agents-python · 47 tokens

examples-run-analysis

Analyze artifacts from the latest completed manual examples Make run. Read the main log, every relevant per-example log, and example source; validate every exit-0 example and classify failures, skips, and environment restrictions. Never execute or control examples.

openai/openai-agents-python · 52 tokens

skill-creator

Create, install, or update skills in the workspace. Use when (1) installing a skill from a URL or remote source, (2) creating a new skill from scratch, (3) updating or restructuring existing skills. Always use this skill for any skill installation or creation task.

zhayujie/CowAgent · 61 tokens

implementation-final-review

Perform the repository's risk-tiered independent final review before implementation completion. Use only when explicitly invoked or when repository instructions require it after behavior-impacting implementation work; audit the complete task diff, supported contracts, lifecycle and security boundaries, complexity, and…

openai/openai-agents-python · 58 tokens

metrics-instrumentation

Specification for instrumenting an opik-backend workflow with operational OpenTelemetry metrics — per-stage throughput/latency/error counters and native histograms, dimensioned per-customer (workspace). Use when a pipeline (scoring, ingestion, experiments, jobs) needs per-stage visibility. Covers metric emission only…

comet-ml/opik · 93 tokens

query-performance

Validate what a ClickHouse query actually costs before merging it — at production scale through read-only environment access, or on a revived Testcontainers dataset extrapolated to 20k/500k/1M entities. Use when a DAO query changes, when an endpoint is slow, or when a reviewer asks "what does this cost at scale".

comet-ml/opik · 71 tokens