Context management means keeping the files, decisions, and evidence needed for the current task available to Autohand Code. A handoff is a concise record of that task's state for a later session or another developer. Preserve durable instructions in AGENTS.md and verify repository state when resuming work.

Choose the right place for information

Information Where it belongs Example
Shared project conventions Repository AGENTS.md Test commands and compatibility requirements
Current task requirement Session prompt Repair one failing behavior
Reusable procedure A project skill Release review steps
Current investigation state A handoff document Hypothesis, files inspected, and next experiment
Credentials Approved credential storage A provider key kept outside repository text

See AGENTS.md, skills, and memory for the supported mechanisms. A saved conversation does not make source facts permanently current.

Keep a long investigation focused

Ask the agent to inspect the smallest relevant file set. Replace repeated full logs with the failing command, first relevant error, and a short excerpt. After a major decision, request a summary of the chosen behavior and rejected alternatives that affect implementation.

For supported compaction behavior, follow context compaction. After compaction, confirm the objective, non-negotiable constraints, and next check. Do not assume every previous file read remains in active context.

Write a handoff before changing sessions

Create HANDOFF.md for this task. Include:
- Objective and acceptance criteria.
- Current branch and files changed by this task.
- Decisions, with source paths that support them.
- Commands actually run, their results, and checks still outstanding.
- Remaining work and the next concrete action.
Exclude credentials and unrelated conversation content.

Review the file before sharing it. Keep uncertain findings labeled as hypotheses. A command that failed because a service was unavailable should be recorded as incomplete validation, with the service dependency named.

Resume and revalidate

Use /resume in an interactive session to choose saved work. Use session commands for the installed version's session controls. When moving to a fresh session, point the agent at the handoff:

Read AGENTS.md and HANDOFF.md. Check git status and inspect the current diff.
Revalidate the referenced symbols and the last failing test before editing.
Continue the unfinished acceptance criteria. Preserve unrelated local work.

The branch may have moved, files may have changed, and dependencies may differ from the previous session. Re-run the relevant check when those inputs changed.

Troubleshooting and checkpoint

If the handoff is mostly a transcript, shorten it to decisions and evidence. If the agent restarts completed work, ask it to compare the current implementation with each acceptance criterion. You are ready to hand off when another developer can name the next action and understand which checks remain unproven. Practice this in review and handoff.

Frequently asked question

Does resuming a session verify the repository state?

No. Resuming restores conversation context, but the branch, source files, dependencies, or services may have changed. Inspect Git state and rerun relevant checks before continuing.