> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plannotator.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# What Should an AI Coding Agent Hand Back After It Changes Code?

> A practical team handoff contract for AI-generated code: the request, exact revision, change map, validation evidence, risks, and documentation impact.

After changing code, an AI coding agent should hand back a compact completion contract that connects the patch to the request: the exact revision, a map of the consequential changes, validation evidence, unresolved questions and risks, and the effect on maintained documentation. The handoff should help the team verify the work, not recount the agent's session or certify the patch as safe.

*Last reviewed July 18, 2026. Maintained by the Plannotator project.*

For a small, reversible edit, those facts may fit in six lines. A cross-cutting authorization change may need an approved plan, migration output, screenshots, and rollout notes. Choose evidence based on the consequences of the change, not the amount of AI used to produce it.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/plannotator/jg-H3JIQzhQ8Zo4n/images/ai-coding-agent-handoff-v2.webp?fit=max&auto=format&n=jg-H3JIQzhQ8Zo4n&q=85&s=770f65be5808db6cb487be29126fba01" alt="An AI coding agent hands a team one versioned evidence folio containing the code diff, decision context, validation, risks, review artifact, and follow-up work." width="1600" height="800" data-path="images/ai-coding-agent-handoff-v2.webp" />

  <img className="hidden dark:block" src="https://mintcdn.com/plannotator/V-2WYiOx7kFind6Z/images/ai-coding-agent-handoff-v2-dark.webp?fit=max&auto=format&n=V-2WYiOx7kFind6Z&q=85&s=f732b080d6188bcbe54207a78ec2ecef" alt="An AI coding agent hands a team one versioned evidence folio containing the code diff, decision context, validation, risks, review artifact, and follow-up work." width="1600" height="800" data-path="images/ai-coding-agent-handoff-v2-dark.webp" />
</Frame>

## What the patch and summary leave out

The Git diff is the implementation record. It does not say which request authorized the work, which paths the agent exercised, which assumptions remain unresolved, or whether a polished screenshot belongs to the current revision.

A prose summary helps a reviewer get oriented, but it is still an interpretation of the patch. GitHub recommends that pull request authors provide the purpose, an overview, links to context, and guidance about where to begin reviewing. Authors should also review, build, and test their changes before requesting review. See [GitHub's guidance for making changes easier to review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/helping-others-review-your-changes).

GitHub and Codex already expose parts of this record. GitHub lets reviewers query a Copilot-created pull request's session logs to ask what changed, what was validated, and why. OpenAI's Codex reports citations, terminal logs, and test results. See [GitHub's pull request exploration guide](https://docs.github.com/en/copilot/tutorials/explore-pull-requests) and [OpenAI's introduction to Codex](https://openai.com/index/introducing-codex/). Both vendors still instruct users to review agent-created code before integration. GitHub says to [review Copilot's pull requests thoroughly](https://docs.github.com/en/copilot/how-tos/copilot-on-github/use-copilot-agents/review-copilot-output).

Use the handoff as a stable index into the request, code, and evidence a reviewer needs to decide. The diff, CI results, and agent logs remain the source records.

<div className="not-prose my-10 overflow-hidden rounded-2xl border border-slate-200 bg-white p-5 shadow-sm dark:border-white/10 dark:bg-[#0B0B0D] sm:p-7">
  <div className="mb-6 flex flex-col gap-1">
    <span className="text-xs font-semibold uppercase tracking-[0.18em] text-violet-600 dark:text-violet-300">Evidence topology</span>
    <p className="m-0 text-lg font-semibold tracking-tight text-slate-950 dark:text-white">One index, six source records</p>
  </div>

  <div className="grid gap-3 md:grid-cols-3">
    <div className="rounded-xl border border-slate-200 p-4 dark:border-white/10 dark:bg-white/[0.03]"><p className="m-0 text-sm font-semibold text-slate-950 dark:text-white">Approved request</p><p className="mb-0 mt-1 text-xs leading-5 text-slate-600 dark:text-slate-300">Intent and constraints</p></div>
    <div className="rounded-xl border border-slate-200 p-4 dark:border-white/10 dark:bg-white/[0.03]"><p className="m-0 text-sm font-semibold text-slate-950 dark:text-white">Exact revision</p><p className="mb-0 mt-1 text-xs leading-5 text-slate-600 dark:text-slate-300">SHA, diff, change map</p></div>
    <div className="rounded-xl border border-slate-200 p-4 dark:border-white/10 dark:bg-white/[0.03]"><p className="m-0 text-sm font-semibold text-slate-950 dark:text-white">Validation</p><p className="mb-0 mt-1 text-xs leading-5 text-slate-600 dark:text-slate-300">Checks and runtime proof</p></div>
    <div className="rounded-xl border border-slate-200 p-4 dark:border-white/10 dark:bg-white/[0.03]"><p className="m-0 text-sm font-semibold text-slate-950 dark:text-white">Review artifacts</p><p className="mb-0 mt-1 text-xs leading-5 text-slate-600 dark:text-slate-300">UI, video, traces</p></div>
    <div className="rounded-xl border border-violet-300 bg-violet-50 p-4 ring-2 ring-violet-100 dark:border-violet-400/40 dark:bg-violet-400/10 dark:ring-violet-400/10"><p className="m-0 text-sm font-semibold text-violet-950 dark:text-violet-100">Handoff index</p><p className="mb-0 mt-1 text-xs leading-5 text-violet-700 dark:text-violet-200">Points to evidence</p></div>
    <div className="rounded-xl border border-slate-200 p-4 dark:border-white/10 dark:bg-white/[0.03]"><p className="m-0 text-sm font-semibold text-slate-950 dark:text-white">Risks and questions</p><p className="mb-0 mt-1 text-xs leading-5 text-slate-600 dark:text-slate-300">What remains unresolved</p></div>
    <div className="rounded-xl border border-slate-200 p-4 md:col-start-2 dark:border-white/10 dark:bg-white/[0.03]"><p className="m-0 text-sm font-semibold text-slate-950 dark:text-white">Documentation</p><p className="mb-0 mt-1 text-xs leading-5 text-slate-600 dark:text-slate-300">Maintained truth changed</p></div>
  </div>

  <p className="mb-0 mt-5 text-sm leading-6 text-slate-600 dark:text-slate-300">The diff, CI results, artifacts, and approved request remain the source records.</p>
</div>

## The compact agent handoff contract

Use six required fields. Add conditional evidence only when it applies.

| Field                        | What the agent must provide                                                                                                                                                                            |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Request**                  | The issue, request, or [reviewed plan](/learn/code-context/approve-ai-coding-plan-before-execution) that authorized the work, including its revision or date when relevant. State material deviations. |
| **Revision**                 | The repository, branch or pull request, and exact head commit SHA being handed over.                                                                                                                   |
| **Change map**               | The user-visible behavior and affected components, with a suggested review order for a multi-file change.                                                                                              |
| **Validation**               | The exact checks run, their results, and anything skipped, unavailable, or still failing.                                                                                                              |
| **Open questions and risks** | Unresolved decisions, assumptions, known failure modes, and any follow-up that must happen before or after merge. Say **none identified** when appropriate; do not omit the field.                     |
| **Documentation impact**     | The maintained product or technical documents updated by the change, or a brief reason that no durable documentation changed.                                                                          |

Add these fields only when they apply:

* **Review artifacts:** screenshots, recordings, HTML walkthroughs, traces, benchmark results, or migration evidence that make behavior inspectable. Explain which claim each artifact supports.
* **Data and rollout:** schema changes, compatibility window, backfill, deployment order, feature flag, rollback trigger, and operator ownership.
* **Security and privacy:** changed trust boundaries, permissions, secrets, customer data, threat assumptions, and the responsible reviewer.
* **Follow-up work:** deferred cleanup or monitoring with an owner and a concrete issue, not vague “future improvements.”

Use this template:

```text theme={null}
Request:
Revision:
Changed:
Validated:
Open questions / risks:
Documentation:

Conditional evidence:
Rollout / rollback:
Follow-up:
```

Put the fields in a pull request template if that makes them easier to complete. The agent can populate them, but the person or team presenting the change for review owns their accuracy.

## Make validation evidence specific and revision-bound

“Tests pass” is not useful evidence without scope. A reviewer needs to know whether the agent ran one targeted unit test, the repository's complete test suite, a browser flow, or only a type-check. Record the command or named CI job and its result:

* `pnpm test --filter authorization`: 42 passed;
* `pnpm typecheck`: passed;
* checkout browser flow at mobile and desktop widths: passed, screenshots attached;
* production-like migration rehearsal: not run; staging database unavailable.

Tie that evidence to the handed-off SHA. GitHub status checks are reported against commits, and its Checks view can display results for different commits in the same pull request. See [GitHub's status-check documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks).

When the agent pushes another commit, the code under review changes. The handoff and any manually produced evidence may need to change with it. A [revision diff](/learn/code-review/what-is-a-revision-diff) helps a returning reviewer isolate what moved since the last checkpoint instead of assuming an earlier test report or screenshot still applies.

Do not paste every successful log into the pull request. Link to full CI output and surface the evidence that changes the decision. State plainly when a check failed, was skipped, or cannot reproduce the target environment.

## Use artifacts to show behavior the diff cannot show

Visual and operational changes often need more than textual test output. A UI change may need before-and-after screenshots and a short recording. A parser change may need a table of difficult inputs and outputs. A data migration may need rehearsal counts, timing, and rejected-row samples.

These [code review artifacts](/learn/code-review/what-are-code-review-artifacts) provide evidence beside the patch. Claude Code, for example, can publish session artifacts such as pull request walkthroughs, system explainers, and release checklists. Anthropic describes them as pages built from the codebase, connected tools, and session context. See [Anthropic's Claude Code artifacts announcement](https://claude.com/blog/artifacts-in-claude-code).

An artifact is not proof merely because it looks complete. Identify its source, revision, and supported claim. Reviewers must still inspect the underlying behavior and code. For format guidance, read [When Should AI Coding Agents Produce HTML Instead of Markdown?](/learn/code-context/ai-agent-html-vs-markdown).

## Small-change fast path

Suppose an agent fixes an off-by-one error in pagination, changes one implementation file, and adds one regression test. No API contract, customer-visible workflow, or maintained architecture document changes.

The handoff can stay compact:

> **Request:** Fix issue #184: page 2 repeats the final item from page 1. <br />
> **Revision:** PR #219 at `71be993`. <br />
> **Changed:** Corrected the cursor offset in `pagination.ts`; added the boundary case in `pagination.test.ts`. <br />
> **Validated:** Targeted test file, 18 passed; type-check passed. <br />
> **Open questions / risks:** None identified. <br />
> **Documentation:** None; the public behavior now matches the existing API documentation.

These six lines identify the request, code, and validation claim. A formal planning package or long session transcript would not help the reviewer decide whether to merge this fix.

## Use the full handoff for a cross-cutting change

Now suppose a team replaces a synchronous customer-data export endpoint with a queued export service. The implementation touches the public API, a jobs table, a background worker, encrypted object storage, download authorization, the account UI, audit events, retention cleanup, and operator documentation.

A useful handoff might say:

* **Request:** Export-service plan version 6, approved by product, data, and security. The agent deviated from emailing export files after the security review required a short-lived authenticated download.
* **Revision:** Pull request head `c4a912e` in the API repository plus `7b21d0a` in the web repository.
* **Change map:** Read the export state machine first, then the jobs migration, worker, object-storage adapter, download authorization, account UI, and retention cleanup.
* **Validation:** Unit and integration suites passed; the migration was rehearsed against a sanitized production-shape snapshot; expired and cross-organization download links were rejected; the browser flow passed with screenshots attached. Queue-saturation testing was not run because the staging capacity was unavailable.
* **Open questions and risks:** Download links expire after 24 hours. Rollback disables new export requests but allows already queued jobs to finish. Security review and an alert on failed retention cleanup remain required before launch.
* **Documentation:** Updated `PRODUCT.md` with the customer-visible lifecycle, `TECH.md` with the storage and authorization boundaries, and the operator runbook with rollout, rollback, queue recovery, and retention steps.

Several teams must verify different claims and operate the export service, so the handoff needs more evidence. It remains a map, not an agent transcript. The project's issue, plan, or review system records what was authorized; the handoff records what the agent produced and any deviations. Plannotator's [local plan review loop](/learn/code-context/approve-ai-coding-plan-before-execution) can help refine the plan before that external record is made. After merge, durable decisions should enter [living codebase documentation](/learn/code-context/living-documentation-for-ai-agents).

For the complete path from request through team decision, implementation evidence, and shipping, read [How Teams Understand AI-Generated Code Before Shipping It](/learn/code-context/understand-ai-generated-code-before-shipping).

## What a handoff cannot establish

* It is authored by the same agent that may have misunderstood the request or missed a failure. Treat its claims as review leads, not independent verification.
* Passing tests demonstrate only the paths and assertions they cover. They do not prove the change satisfies the product decision.
* A commit SHA identifies code, not every external dependency, service response, or mutable artifact used during validation.
* Logs and artifacts can expose secrets or customer data. Redact and retain them according to the repository's access rules.
* A large handoff cannot rescue a pull request that is too broad to review. Split the implementation when reviewers cannot form a reliable mental model.

Anthropic's long-running agent harnesses used structured updates alongside Git history so the next session could resume the work. A team handoff uses the same practice to prepare an implementation for review. See [Anthropic's long-running agent harness research](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents).

## Frequently asked questions

### What should an AI coding agent include in a pull request?

Include the authorizing request, exact head revision, a change map, validation commands and results, unresolved questions and risks, and documentation impact. Add screenshots, HTML, migration evidence, rollout instructions, or security notes only when the change requires them.

### How detailed should an AI coding agent handoff be?

Use the smallest handoff that lets another engineer verify the work without reconstructing the agent session. A local fix may need six short lines; a cross-service migration needs more evidence.

### Should the agent include every command and log?

No. Include decision-relevant commands and results, note anything skipped or failing, and link to complete logs when useful. Large pasted logs hide signal and can leak sensitive data.

### How can a reviewer verify an agent's handoff?

Confirm the request and revision, inspect the diff in the suggested order, open the linked evidence, check that CI belongs to the current commit, and rerun consequential validation when appropriate. Resolve discrepancies against the code and executable behavior, not the agent's prose.

### Who owns the accuracy of an AI coding agent handoff?

The person or team delegating the change owns the handoff presented for review. The agent can draft and update it, but it should not certify its own work as correct or ready to merge.

## Handoff readiness checklist

Before handoff, a reviewer should be able to answer three questions without reopening the private agent session:

1. What exact request and revision am I reviewing?
2. What evidence supports the agent's claims, and what remains uncertain?
3. Which durable documents and operating assumptions change if we merge it?

If any answer requires reopening the private session, the handoff is incomplete.

<Card title="Review the returned code" icon="clipboard-check" href="/open-source/workflows/local-changes" arrow="true">
  Open the current local changes in Plannotator and compare the handoff with the actual diff and validation evidence.
</Card>
