agent-builder

agent-builder is a skill for Claude Code, Codex from FareedKhan-dev/claude-code-from-scratch. It costs 34 tokens per session (1,048 once invoked), scanned A, original, MIT.

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

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it when creating an agent, designing its tools, debugging its action loop, or choosing an agent architecture.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fareedkhan-dev/claude-code-from-scratch/agent-builder
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.

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.

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 agent-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/fareedkhan-dev/claude-code-from-scratch/agent-builder/github.svg)](https://agentmods.dev/skills/fareedkhan-dev/claude-code-from-scratch/agent-builder)
Your own site
<a href="https://agentmods.dev/skills/fareedkhan-dev/claude-code-from-scratch/agent-builder"><img src="https://agentmods.dev/badge/skills/fareedkhan-dev/claude-code-from-scratch/agent-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/fareedkhan-dev/claude-code-from-scratch/agent-builder"><img src="https://agentmods.dev/badge/skills/fareedkhan-dev/claude-code-from-scratch/agent-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00034 $0.01048
Opus 5.5 $0.00014 $0.00419
Sonnet 5.5 $0.00007 $0.00210
Haiku 4.5 $0.00003 $0.00105

Measured 1mo ago against content hash b058947ebaa8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (302 stars, last pushed 6mo ago), licensed MIT. It adds 34 tokens to every session and 1,048 once invoked, about $0.0001 per session on Opus 5.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.