Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.309 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial
HomeDocsSearch
Search the documentation

14 pages for loop.md.

Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.

Configure your agent Claude Code CLI · in the page agent-sdk/configuration …t in either language. Set the [effort level](/docs/en/agent-sdk/agent-loop.md#effort-level) or a [spend cap](#limit-turns-and-spend) instead, or call the Messages API when you need those parameters di… Hosting the Agent SDK Claude Code CLI · in the page agent-sdk/hosting …eds to exit cleanly. See [Handle the result](/docs/en/agent-sdk/agent-loop.md#handle-the-result) for the error subtypes. ### Long-running sessions Run persistent container instances, often hosting m… Agent SDK overview Claude Code CLI · in the page agent-sdk/overview …t SDK gives you the same tools, [agent loop](/docs/en/agent-sdk/agent-loop.md), and context management that power Claude Code, programmable in Python and TypeScript. ## Compare the Agent SDK to other… Agent SDK reference - Python Claude Code CLI · in the page agent-sdk/python …ate can pass this value, so [leave headroom](/docs/en/agent-sdk/agent-loop.md#budget-headroom). Counts only the call's own spend; totals restored from a resumed session don't count. For accuracy cavea… Quickstart Claude Code CLI · in the page agent-sdk/quickstart …Permission mode in How the agent loop works](/docs/en/agent-sdk/agent-loop.md#permission-mode). ## Next steps Now that you've created your first agent, learn how to extend its capabilities and tailo… Work with sessions Claude Code CLI · in the page agent-sdk/sessions …ror_max_budget_usd` (see [Handle the result](/docs/en/agent-sdk/agent-loop.md#handle-the-result)); resume with a higher limit. In a single-shot `query()` call the SDK raises after yielding that error… Extend agents with skills Claude Code CLI · in the page agent-sdk/skills …ror-result contract, see [Handle the result](/docs/en/agent-sdk/agent-loop.md#handle-the-result). If your command might hit the limit, wrap the loop in a `try`/`catch` in TypeScript or `try`/`except`… Streaming Input Claude Code CLI · in the page agent-sdk/streaming-vs-single-mode …e needs to continue. See [Handle the result](/docs/en/agent-sdk/agent-loop.md#handle-the-result) for the result subtypes. ### Implementation Example ```typescript TypeScript theme={null} import { qu… Subagents in the SDK Claude Code CLI · in the page agent-sdk/subagents …/docs/en/env-vars.md) and [turns and budget](/docs/en/agent-sdk/agent-loop.md#turns-and-budget) record the Claude Code version that added each variable and the spend cap's subagent enforcement. Claud… Track todos Claude Code CLI · in the page agent-sdk/todo-tracking …y when that happens. See [Handle the result](/docs/en/agent-sdk/agent-loop.md#handle-the-result) for the result subtypes. > [!NOTE] > > The task system messages, [`SDKTaskNotificationMessage`](/docs/… Scale to many tools with tool search Claude Code CLI · in the page agent-sdk/tool-search …on result messages, see [Handle the result](/docs/en/agent-sdk/agent-loop.md#handle-the-result). ## Optimize tool discovery The search mechanism matches queries against tool names and descriptions.… Agent SDK reference - TypeScript Claude Code CLI · in the page agent-sdk/typescript …ate can pass this value, so [leave headroom](/docs/en/agent-sdk/agent-loop.md#budget-headroom). Counts only the call's own spend; totals restored from a resumed session don't count. For accuracy cavea… Commands Claude Code CLI · in the page commands …ocs/en/scheduled-tasks#run-the-built-in-maintenance-prompt) or your [`loop.md`](/docs/en/scheduled-tasks#customize-the-default-prompt-with-loop-md). Example: `/loop 5m check if the deploy finished`. S… Run prompts on a schedule Claude Code CLI · in the page scheduled-tasks …ntenance prompt](#run-the-built-in-maintenance-prompt) runs, or your `loop.md` if one exists | You can also pass a skill as the prompt, for example `/loop 20m /review-pr 1234`, to re-run that skill e…
Feedback