Back to MD Exchange
    Agent Configurationsclaudeagent-sdkanthropictools

    Claude Agent SDK Starter Kit

    Read-only Agent SDK starter using built-in file tools, a bounded agent loop, and streamed text output.

    T
    tomnakamura|March 15, 2026|Updated Oct 8
    462 downloads9 stars

    Uploaded markdown content, not a verification of tool compatibility or results. Review the raw text, commands, and permissions before using it. Stars require an account.


    name: agent-sdk-starter


    Claude Agent SDK Starter

    Setup

    npm install @anthropic-ai/claude-agent-sdk

    Basic Agent

    Configure SDK authentication through the environment as described in the [official quickstart](https://code.claude.com/docs/en/agent-sdk/quickstart). Save this as agent.mts and run it with npx tsx agent.mts after installing tsx. API usage may incur charges; do not hard-code credentials. The enabled tools are read-only.

    import { query } from "@anthropic-ai/claude-agent-sdk";
    
    for await (const message of query({
      prompt: "Find how authentication works in this project. Do not modify files.",
      options: {
        model: "claude-sonnet-4-6",
        tools: ["Read", "Glob", "Grep"],
        allowedTools: ["Read", "Glob", "Grep"],
        maxTurns: 6
      }
    })) {
      if (message.type === "assistant") {
        for (const block of message.message.content) {
          if ("text" in block) console.log(block.text);
        }
      }
    }
    

    Best Practices

    • Tool descriptions under 200 chars
    • Structured data from tools, not raw text
    • Set maxTurns in TypeScript (max_turns in Python) to limit agent turns