# "Agentic Coding ENDGAME Build your Claude Code SDK Custom Agents" <!-- ref: @content/youtube/indy-dev-dan/2025-09-22-agentic-coding-endgame-build-your-claude-code-sdk triggers: [need for custom agents, inefficient off-the-shelf tools, high context consumption, multi-turn conversations] trigger_prompt: When developers seek to create specialized agents that align closely with their specific domain needs and workflows. version: 4 updated_at: 2026-10-31T19:01:35.595Z --> Claude Code SDK (Indy Dev Dan, 2025-09-22): Agentic engineering progresses along a single path: **better agents → more agents → custom agents**. IndyDevDan walks through building custom agents on top of the Claude Code SDK, demonstrating eight progressively sophisticated agents from a 3-line "Pong" agent to a multi-agent micro-SDLC task board. ## Core Thesis Agentic engineering progresses along a single path: **better agents → more agents → custom agents**. Off-the-shelf tools like Claude Code, Codex CLI, and Gemini CLI are built for everyone's codebase, not yours — and at scale that mismatch costs hundreds of hours and millions of tokens. The alpha lives in custom agents tuned to your domain, where the system prompt is the highest-leverage surface you control. ## Key Insights - **The system prompt *is* the agent.** Overriding Claude Code's default system prompt replaces the product entirely. The model stays the same; the system prompt defines what you've built. Every user prompt is multiplied by it. - **The Core 4** (options, system prompt, tools, model) governs how every agent flows and scales. Master these and you master compute scaling. - **Tool descriptions teach the agent how to use the tool** — they are instructions to the agent, not just human docs. Inside tool implementations you "step back into traditional deterministic code," using tools as escape hatches from probabilistic LLM behavior. - **In-memory MCP servers** via `create_sdk_mcp_server` let you bundle tools into an agent without standing up an external server. - **Hidden context cost**: custom agents inherit Claude Code's full ~15 baked-in tools by default, all consuming context window. Run `/context` to see what's eating your agent's mind. - **Two SDK invocation modes**: `query` for one-off prompts, `ClaudeSDKClient` for stateful multi-turn conversations. - **Right-size the model**: simple agents (echo, pong) should drop to Claude Haiku — cheaper, faster, intelligence-appropriate. - **Append vs. overwrite** the system prompt are two distinct strategies: extend Claude Code, or fork a new product. - **Multi-agent UIs unlock new form factors** — a micro SDLC (planner → builder → reviewer → shipper) handing off via a Kanban board streamed over WebSockets, triggered by a single prompt. - **The shift**: "Agent coding is not so much about what we can do anymore. It's about what we can teach our agents to do." ## Actionable Takeaways 1. Treat the system prompt as the highest-leverage surface in any agent you build — every other choice multiplies through it. 2. When inspecting any custom agent, collapse it to **main → tools → system prompt** and locate the Core 4. 3. Strip inherited Claude Code tools when your custom agent doesn't need them; run `/context` regularly to audit consumption. 4. Write tool descriptions as instructions to the agent — describe *how* and *when* to use, not just what. 5. Use `ClaudeSDKClient` whenever multi-turn context matters; reserve `query` for fire-and-forget runs. 6. Downgrade to Haiku for low-complexity agents to align cost and latency with the work. 7. Stream `tool_use`, `text`, and `result` message blocks with rich logging — adopt the agent's perspective to debug it. 8. For complex workflows, package multiple specialized agents behind a UI rather than overloading a single agent. Add hooks and a permission system when they share code. 9. Don't reinvent the wheel — use the base Claude Code agent until specialization actually demands a custom one. 10. Hunt for repeat workflows (scripts, streams, terminals, UIs) in your business — those are the constraints worth automating. ## Notable Quotes > "Scale your compute to scale your impact." > "They're built for everyone's codebase, not yours." > "All of your work is multiplied by your system prompt." > "The system prompt is truly what builds the agent." > "If you understand the Core 4 and how each element flows and controls your agent, you will understand compute and you'll understand how to scale your compute." > "The description of your tool tells your agent how to use it." > "These 15 tools consumes context. It consumes space in your agent's mind." > "As soon as you touch the system prompt and once you start dialing into the tools, you change the product, you change the agent." > "Agent coding is not so much about what we can do anymore. It's about what we can teach our agents to do." > "Deploying effective compute and deploying effective agents is all about finding the constraints in your personal workflow and in your products." --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*