Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Building Agents with Claude and eve

Free · sign in to start and track progress

1 · Harnesses

  • 1Choosing a harness
  • 2The Claude Agent SDK

    Exercise answers

    • Answer: Guardrails in Claude Code: tool, permissions, hooks
    • Answer: Run the title-review agent on the SDK
  • 3Agents as files with eve

2 · Composition and control

  • 4Skills and subagents
  • 5Human approval for high-stakes actions
  • 6Shipping agents
CapstoneA drafting agent with human approval in eveReference implementation

Module 1 · Harnesses · Lesson 2

The Claude Agent SDK

How query() drives Claude Code's agent loop from your own TypeScript, and how custom tools, permissions, hooks, sessions and structured output work, with the Claude Code equivalent of each.

70 min 1 video 3 exercises 7-question quiz Answers
Setup for the exercises:Install Claude CodeNode.js, pnpm and TypeScriptMCP servers in Claude CodeGet an OpenRouter keyLocal models with OllamaOpenRouter or a local model?

By the end of this lesson you can

  • Explain what query() does, which messages it yields, and how a run ends (success, turn limit, budget limit)
  • Implement a custom tool with tool() and createSdkMcpServer(), and predict its model-facing name
  • Trace a tool call through the six-step permission evaluation order and predict whether it runs, is denied or reaches canUseTool
  • Use PreToolUse and PostToolUse hooks to enforce a write boundary and keep an audit trail
  • Map every SDK option used in this lesson to its Claude Code equivalent so you can prototype on a subscription

On this page

  • The loop you are driving
  • A custom tool
  • Running it
  • Permissions: the evaluation order
  • Hooks: deterministic guardrails
  • Sessions
  • Skills and subagents, briefly
  • The Claude Code equivalent of every option
  • Worked example: predict the permission outcome
  • Misconceptions and limits
  • How this connects
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01The loop you are driving
  2. 02A custom tool
  3. 03Running it
  4. 04Permissions: the evaluation order
  5. 05Hooks: deterministic guardrails
  6. 06Sessions
  7. 07Skills and subagents, briefly
  8. 08The Claude Code equivalent of every option
  9. 09Worked example: predict the permission outcome
  10. 10Misconceptions and limits
  11. 11How this connects
  12. 12Summary

Sources & further reading

  • ReAct: Synergizing Reasoning and Acting in Language ModelsPaper · Yao et al. · 2022The research ancestor of the loop query() runs: interleaving reasoning with tool actions and observations. Read the introduction and Figure 1.
  • Building agents with the Claude Agent SDKLab research · Thariq Shihipar · Anthropic · 2025The design philosophy behind the SDK. The sections on gathering context, taking action and verifying work explain why the built-in tools look the way they do.
  • Agent SDK reference - TypeScriptDocs · AnthropicThe authoritative API. Read the query() function, the Options table, CanUseTool and PermissionResult, and the hook input types.
  • Configure permissionsDocs · AnthropicThe permission evaluation order (hooks, deny rules, ask rules, mode, allow rules, canUseTool) and the warning that auto-approved calls never reach canUseTool. The most important page for safe SDK agents.
  • Give Claude custom toolsDocs · Anthropictool(), in-process MCP servers, tool annotations, error handling with isError, and the always_ask permission policy for a single tool.
  • Intercept and control agent behavior with hooksDocs · AnthropicThe list of hook events and the PreToolUse output fields for denying or rewriting a call.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 12 more sections
  • 3 hands-on exercises
  • A 7-question quiz
  • Progress, quiz scores and bookmarks