# How can my application tell whether a Claude Agent SDK run actually succeeded?

Exam: CCAR-F — Claude Certified Architect - Foundations (CCAR-F)
Knowledge domain: Agentic Architecture & Orchestration
Updated: 2026-11-25T09:22:54.773389+00:00
HTML: https://learningpathx.com/faq/CCAR-F/ccarf-agent-run-completion.html

## Also asked as

- Does a successful Claude Agent SDK result prove that the requested work happened?
- How should I verify a Claude agent’s result before marking the task complete?

Treat Claude Agent SDK success as a runtime outcome and verify the user’s acceptance criteria in application code. Inspect the SDK result subtype and make a separate check of the requested output or external effect. For example, a claimed write is complete when the expected external record can be read back with the correct content and approval.

In Python, inspect the `ResultMessage`. In TypeScript, inspect the message whose `type` is `result`. These messages report the subtype, session ID and usage or cost information. Handle error subtypes explicitly and use the SDK’s exception path for stream, connection or process failures. In a single-shot SDK query, the harness can emit an error result before the iterator raises, so retain the result and handle the exception. Some system events can follow the result.

Record the task ID, final status, any denied or incomplete actions, and the check that proved completion. Route ambiguous outcomes to reconciliation or a human decision before attempting a consequential action again.

[Agent-loop result handling](https://code.claude.com/docs/en/agent-sdk/agent-loop#handle-the-result) · [Define measurable success criteria](https://platform.claude.com/docs/en/test-and-evaluate/develop-tests)

Source: [Claude Agent Loops, Sessions, and Runtime Controls](https://learningpathx.com/news/claude-agent-loops-sessions-and-runtime-controls.html)
