Turn Long Coding Agent Sessions Into Checkpoints
A long coding agent session becomes difficult to manage when decisions, unfinished edits, and test results accumulate in one conversation. A checkpoint turns that conversation into a recoverable working state: a clear objective, inspectable changes, evidence of progress, and instructions for continuing. The following walkthrough uses a background job retry feature as an example.
Define the outcome before the agent starts editing
Begin with a small working agreement. State what the feature must do, where the agent may work, and what evidence will demonstrate success. For the retry feature, specify that temporary failures should trigger bounded retries, permanent failures should stop immediately, and existing job behavior should remain compatible.
Ask the agent to inspect the repository instructions and current working tree before making changes. Record existing user edits so later checkpoints can distinguish them from agent work. This baseline prevents an apparently tidy commit from accidentally including unrelated changes.
Divide the work into independently reviewable checkpoints
Choose boundaries around observable outcomes. A useful sequence for this example is:
- Checkpoint one: Identify the job runner, failure categories, and relevant tests.
- Checkpoint two: Implement retry decisions and verify their behavior.
- Checkpoint three: Connect retries to job execution and test integration behavior.
- Checkpoint four: Review compatibility, update documentation, and prepare the handoff.
Each checkpoint should answer a specific question. For example, can the retry policy distinguish a temporary network failure from invalid credentials? Avoid boundaries based only on elapsed time or conversation length, because those measures say little about whether the work is ready to review.
Give each checkpoint an explicit completion contract
Before implementation, tell the agent what it must produce at the next boundary. Request a short account of changed files, decisions made, verification performed, unresolved issues, and the next action. Require it to distinguish completed work from proposed work.
For the retry policy, completion might mean that focused tests cover retry limits, permanent failures, and the delay calculation. If integration remains unfinished, say so explicitly. A checkpoint can preserve partial progress, provided its record accurately describes what works and what remains uncertain.
Save durable state alongside the code changes
Keep a concise checkpoint note in the workspace, using a location consistent with repository conventions. Include the objective, current checkpoint, relevant file paths, commands run, results, and open decisions. Update the note at meaningful boundaries rather than transcribing the conversation.
Use Git to inspect the changes and, where the project workflow permits, create a focused commit. A commit captures tracked file contents; it does not capture every dependency, environment setting, or external service state. Record any such requirements separately, and keep credentials out of checkpoint notes.
Verify the checkpoint before expanding the scope
Review the diff and run checks appropriate to the change. Start with focused behavioral tests, then run broader checks when integration or repository rules require them. Record the actual outcome, including failures and checks that could not run.
If retry tests pass but the integration suite cannot connect to its database, preserve both facts. Do not label the whole feature verified. Address failures introduced by the change before proceeding, or document the blocking condition precisely enough for another session to investigate.
Resume from evidence rather than conversational memory
At the next session, have the agent read the checkpoint note, inspect the working tree, and confirm that the recorded state still matches the files. Then ask it to restate the immediate objective and continue from the next unfinished action. This catches changes made by people or other tools between sessions.
BestRelay, which publishes this article, supports Claude Code, Codex, Gemini CLI, and OpenAI SDK clients through https://api.bestapirelay.com. Its quality-first relay forwards each request to the official model named in that request without substitution, across Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok, and more. A durable checkpoint helps preserve continuity when changing clients.
Use checkpoint records to understand session costs
Record available usage figures alongside completed milestones to see which stages consume the most work. BestRelay bills pay-as-you-go using provider-reported token counts, with cache reads and writes priced separately, so total tokens alone may not explain a bill. Members also earn referral commission when invited users top up; keep that separate from engineering cost comparisons.
Create a BestRelay account to try this checkpoint workflow with your preferred coding client.
Want to try the models discussed here? Sign up