Claude Agent SDK generator
Describe an agent for the Claude Agent SDK — Claude Code as a library — and download the TypeScript project that runs it: the Options object with its system prompt, tool permissions, custom tools, subagents, MCP servers, hooks, skills and structured output. No account, nothing leaves your browser.
The options are the agent
The harness already has the tools and the loop. What you decide is in src/options.ts, so the preview opens on it — the other files exist so each tool, subagent and hook can be edited on its own.
Permission rules, enforced
Subagents without Agent approved. A restricted tool list without Skill. An allow list under bypassPermissions. A deny on anything but PreToolUse. Each is reported next to the row that breaks it, because each is a silent failure at runtime.
No secrets on the page
The API key and every MCP credential are emitted as names in .env.example and read with process.env. The tool never asks for a value, so there is none to send anywhere.
How to scaffold a Claude Agent SDK agent
Four steps from an empty form to a project that runs query(). The harness already has the tools and the loop; every field here is a property of the Options object, and the preview shows where it lands.
Write the system prompt
Your own text, or Claude Code's claude_code preset with your text appended so the model also gets the harness's instructions for its built-in tools.
Set tool permissions
Tick the built-ins to pre-approve in allowedTools, optionally restrict the tools list, add deny rules like Bash(rm *), and pick a permission mode.
Add custom tools, subagents, MCP servers, hooks and skills
Custom tools run on an in-process MCP server as mcp__<server>__<name>; subagents are AgentDefinitions reached through the Agent tool; hooks can log any event or deny a PreToolUse; skills are SKILL.md files.
Download and run
npm install, set ANTHROPIC_API_KEY, then npm start -- "your question". The entry point prints the session id, each tool call, the result and the cost.
What the download contains
- src/options.ts
- The Options object — systemPrompt, tools, allowedTools, disallowedTools, permissionMode, mcpServers, agents, hooks, settingSources, skills, outputFormat, maxTurns, maxBudgetUsd.
- src/system-prompt.md
- Your prompt, whether it is the whole system prompt or the appendix to the preset.
- src/server.ts and src/tools/*.ts
- createSdkMcpServer holding one tool() per file, each with a Zod shape and a stub handler.
- src/agents/*.ts
- AgentDefinitions with description, prompt, tools, model, effort and background.
- src/hooks/*.ts
- HookCallbacks — a PreToolUse deny with permissionDecisionReason, or a log on any lifecycle event.
- .claude/skills/<name>/SKILL.md
- Skills discovered through settingSources: ["project"] and allowed by name.
- src/index.ts
- One query() with a canUseTool callback in the modes that prompt, and the result, structured output and cost printed.
The Claude Agent SDK, answered
The longer version is in the guide Claude Agent SDK: permissions, custom tools and subagents in the Options object. This is an unofficial tool built against the public SDK documentation — the SDK itself, and the last word on anything below, lives at code.claude.com/docs.
Design the app the agent works for
An agent usually sits behind a product. In the Nodlume workspace you draw that product on a visual structure canvas and export a real Next.js, Tauri, Expo, Ink or extension project from it. This page's siblings cover the OpenAI Agents SDK, LangChain Deep Agents, Google ADK and Vercel Eve — the same form, for five runtimes.