Authorization notice. Code Agent is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.
Who it is forA developer who let the agent run for a while, saw the result drift from the goal, and wants to try again from an earlier point.
The problemA long agent run can take a wrong turn, and starting over loses the useful context from the session so far.
The outcomeThe session returns to a chosen checkpoint so the next attempt starts from that point.
What you need first
- Python 3.11 or newer
- uv, the Python package manager
- An API key for a supported model provider, such as DeepSeek, OpenAI, Anthropic, OpenRouter, or ZhipuAI
- A local Git repository or project folder to point the agent at
Steps
- Run
uv run python main.py -cto resume the most recent session. - Run
/sessionsto see the list of saved sessions if the one you want is not the latest. - Run
/rewindand pick the checkpoint you want to return to. - Restate the task with a narrower instruction and continue in the same session.
Prompt for your agent
In the Harvil1/codeAgent repo, run `uv run python main.py -c` to resume the last session, then run `/rewind` to return to <checkpoint name or position>. Expect the session to show the chosen checkpoint as the current point. Verify by asking the agent to restate the last step it will take before it runs anything.
Caveat. The README says /rewind returns to a checkpoint but does not say whether file changes on disk are reverted, so check your files after a rewind.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for Harvil1/codeAgent and "Roll back an agent session to an earlier checkpoint"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer