Answer: Create agent.py (Python) or agent.ts (TypeScript, or agent.mts for CommonJS projects) using the query function with a prompt to review and fix bugs, then run it with `uv run agent.py`, `python agent.py`, or `npx tsx agent.ts`. Status: Confirmed Entry: tool/claude-code/agents-and-automation/build-bug-fixing-agent Revision: 3 Digest: sha256:4d4d7360dd3befb8 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:55Z Last changed: 2026-11-18T12:12:55Z (Example prompt: — → Review utils.py for bugs that would cause crashes. Fix any issues you find.) Last verified: 2026-11-20T12:17:07Z Next check: 2026-11-21T12:17:07Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Python run command | uv run agent.py | [1] | 2026-11-20 Python pip run command | python agent.py | [1] | 2026-11-20 TypeScript run command | npx tsx agent.ts | [1] | 2026-11-20 TypeScript CommonJS filename | agent.mts | [1] | 2026-11-20 Example prompt | Review utils.py for bugs that would cause crashes. Fix any issues you find. | [1] | 2026-11-20 Allowed tools | Read | [1] | 2026-11-20 Permission mode | acceptEdits | [1] | 2026-11-20 Sources: [1] Anthropic. "Quickstart". https://code.claude.com/docs/en/agent-sdk/quickstart.md Role: primary. Accessed: 2026-11-20T12:17:07Z Quote: "uv run agent.py" (Supports: Python run command) Quote: "python agent.py" (Supports: Python pip run command) Quote: "npx tsx agent.ts" (Supports: TypeScript run command) Quote: "Use `agent.mts` instead if your existing project uses CommonJS" (Supports: TypeScript CommonJS filename) Quote: "prompt="Review utils.py for bugs that would cause crashes. Fix any issues you find."" (Supports: Example prompt) Quote: "allowed_tools=["Read", "Edit", "Glob"], # Auto-approve these tools" (Supports: Allowed tools) Quote: "permission_mode="acceptEdits", # Auto-approve file edits" (Supports: Permission mode) Published: 2026-11-20T03:54:49Z Snapshot SHA-256: 21749cf4c7bf98376902e28573ea9b220a780af8fa03ed97dd181e57c323e438 (captured 2026-11-17T12:21:13Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-17T12:21:15Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:17:07Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:17:07Z Last attempt: 2026-11-20T12:17:07Z Notes and limitations: Extracted automatically from a single official source (section "Build an agent that finds and fixes bugs"). Related: https://latestn.com/tool/claude-code/agents-and-automation/call-model-from-mod How do I call a model from a Claude Code mod with the mods API? https://latestn.com/tool/claude-code/agents-and-automation/capture-session-id How do I capture the session ID in Claude Code SDK? https://latestn.com/tool/claude-code/agents-and-automation/change-system-prompt-existing-session How do I change the system prompt of an existing Claude Code session? https://latestn.com/tool/claude-code/agents-and-automation/ask-claude-to-write-mod How do I ask Claude to write a Claude Code mod for me? https://latestn.com/tool/claude-code/agents-and-automation/auto-format-after-edits How do I make Claude Code auto-format code after it edits files using hooks? https://latestn.com/tool/claude-code/agents-and-automation/available-hook-events What hook events are available in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T12:12:55Z | changed | Example prompt: — → Review utils.py for bugs that would cause crashes. Fix any issues you find. | [1] 2026-11-18T12:12:55Z | changed | Prompt: Review utils.py for bugs that would cause crashes. Fix any issues you find. → — | [1] 2026-11-15T12:16:37Z | changed | Prompt: — → Review utils.py for bugs that would cause crashes. Fix any issues you find. | [1] 2026-11-15T12:16:37Z | changed | Example prompt: Review utils.py for bugs that would cause crashes. Fix any issues you find. → — | [1] 2026-11-13T03:02:55Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/build-bug-fixing-agent/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/agents-and-automation/build-bug-fixing-agent POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/build-bug-fixing-agent with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/build-bug-fixing-agent?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I build and run an agent with the Claude Code Agent SDK that finds and fixes bugs? Revision 3, last verified 2026-11-20T12:17:07Z. https://latestn.com/tool/claude-code/agents-and-automation/build-bug-fixing-agent (accessed 2026-11-21T10:02:06Z). @misc{LatestN_tool_claude_code_agents_and_automation_build_bug_fixing_agent_r3, title = {How do I build and run an agent with the Claude Code Agent SDK that finds and fixes bugs?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/build-bug-fixing-agent}}, note = {Revision 3; digest sha256:4d4d7360dd3befb8; last verified 2026-11-20T12:17:07Z; accessed 2026-11-21T10:02:06Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/agents-and-automation/build-bug-fixing-agent