From agent user to agent builder: build a Claude Code-style coding agent from scratch in Python. 8 free lessons — agent loop, permissions, sandboxes, context engineering, subagent swarms, evals.
# Add to your Claude Code skills
git clone https://github.com/decodingai-magazine/building-a-coding-agent-from-scratch-courseGuides for using ai agents skills like building-a-coding-agent-from-scratch-course.
Last scanned: 7/25/2026
{
"issues": [
{
"file": ".claude/skills/manual-e2e-qa/SKILL.md",
"line": 31,
"type": "secret-exfiltration",
"message": "Instruction appears to send credentials/secrets to an external endpoint",
"severity": "medium"
},
{
"file": ".claude/skills/manual-e2e-qa/SKILL.md",
"line": 45,
"type": "secret-exfiltration",
"message": "Instruction appears to send credentials/secrets to an external endpoint",
"severity": "medium"
},
{
"file": "README.md",
"line": 24,
"type": "remote-install",
"message": "Install command (remote install script piped to a shell — review the source before running): \"curl -LsSf https://astral.sh/uv/install.sh | sh\"",
"severity": "low"
}
],
"status": "PASSED",
"scannedAt": "2026-07-25T06:18:30.050Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}building-a-coding-agent-from-scratch-course is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by decodingai-magazine. From agent user to agent builder: build a Claude Code-style coding agent from scratch in Python. 8 free lessons — agent loop, permissions, sandboxes, context engineering, subagent swarms, evals. It has 119 GitHub stars.
Yes. building-a-coding-agent-from-scratch-course passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/decodingai-magazine/building-a-coding-agent-from-scratch-course" and add it to your Claude Code skills directory (see the Installation section above).
building-a-coding-agent-from-scratch-course is primarily written in Python. It is open-source under decodingai-magazine on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh building-a-coding-agent-from-scratch-course against similar tools.
No comments yet. Be the first to share your thoughts!
Try the finished agent first — 5 minutes, $0:
# install uv first if you don't have it: curl -LsSf https://astral.sh/uv/install.sh | sh git clone https://github.com/decodingai-magazine/building-a-coding-agent-from-scratch-course.git cd building-a-coding-agent-from-scratch-course make install cp .env.example .env # set GEMINI_API_KEY — free at https://aistudio.google.com/apikey uv run decodeThen type
/demo-and pick a demo — see what they do below. Full guide: install_and_usage.md.
In one public experiment by LangChain, changing only the harness — same model throughout — moved a coding agent from roughly 30th place into the top 5 on Terminal-Bench. The harness decides what the model sees, what it touches, and what happens when it's wrong. It's also the part nobody teaches.
agent = Agent(
build_model(settings.llm_provider), # gemini | openrouter | modal
deps_type=AgentDeps, # cwd, event sink, permission gate
output_type=[str, DeferredToolRequests], # final answer, or tools paused for approval
)
register_tools(agent) # read, edit, bash, grep, ...
async with agent.iter(prompt, message_history=history) as run:
async for node in run: # model request → tool calls → repeat
stream_events(node)
That's the entire tool-calling agent — the thing people call "the agent" ends here. Everything else in this repo — the permission gate, the sandbox, compaction, the steering queue, the durable runtime, the subagent fan-out, the evals — is the harness. That's what you're here to build.
We spent months under the hood of Claude Code (via its leaked source), OpenCode, Pi, and Aider, then distilled it into 8 lessons where, from an empty repo, you build decode, your own terminal coding agent. By lesson 2 it asks permission before running bash; by lesson 8 it's deployed to the cloud, building the same feature 5–10× in parallel and handing you back reviewed pull requests. One headless core, two ways to drive it: an interactive TUI wired to a live session, and a remote runtime running N copies in parallel.
Under the hood: a Pydantic AI ReAct loop on Gemini, OpenRouter, or an open model you serve on Modal; file / bash / web / LSP tools and parallel Explore subagents; Docker/Modal sandboxes; a durable Kitaru runtime; Opik tracing and evals.
You walk away with three things:
decode at your own repos the way you point Claude Code at them today.Skip this layer and you're betting your work on tools you can't inspect.
The whole repo is free: clone it, read it, ship it. But anyone can read an agent loop. The lessons cover what code can't — why steering input waits for the next model call instead of injecting mid-tool, why compaction fires at ~80% of the window instead of at the limit, why the sandbox may hold a git token while the model's context never does, why subagent fan-out caps at 6. Every component earns its place, and every lesson walks the reasoning.
The finished agent ships with demo skills under .decode/skills/. Open the TUI, type /demo-, pick one, and watch the harness you're about to build do real work:
And the machinery underneath is real infrastructure you'll stand up yourself, not a diagram:
y/n gate on every tool call.kill -9 a run mid-task and resume it — checkpoints never re-pay for finished work.gemini-2.5-pro have done from this exact point?"