CLAUDE LABJP
CODE — Claude Code ships a broad quality and reliability update with /rewind, stronger MCP resilience, and steadier OAuth handlingCODE — CPU and memory use drops during streaming and long sessions, keeping always-on automation stableADMIN — New org model restrictions let administrators control which models are availableMCP — Structured output, remote MCP, and session resume all get more reliableMODEL — Claude Fable 5 is generally available, with a 1M-token context window, always-on adaptive thinking, and 128K outputLINEUP — Opus 4.8, Sonnet 4.6, and Haiku 4.5 lead the lineup; pick the right one per taskCODE — Claude Code ships a broad quality and reliability update with /rewind, stronger MCP resilience, and steadier OAuth handlingCODE — CPU and memory use drops during streaming and long sessions, keeping always-on automation stableADMIN — New org model restrictions let administrators control which models are availableMCP — Structured output, remote MCP, and session resume all get more reliableMODEL — Claude Fable 5 is generally available, with a 1M-token context window, always-on adaptive thinking, and 128K outputLINEUP — Opus 4.8, Sonnet 4.6, and Haiku 4.5 lead the lineup; pick the right one per task
Articles/Claude Code
Claude Code/2026-06-27Intermediate

When You've Gone Five Steps in the Wrong Direction: Rewinding Conversation and Code with Claude Code's /rewind

Claude Code's /rewind is a safety net that returns both conversation and code to an earlier checkpoint. Here is how it differs from git, what it restores, and the pitfalls that bite in automated runs.

Claude Code167rewindcheckpointssession management3

Have you ever let Claude Code run five steps forward while it was quietly working from the wrong interpretation of your request? Three files have changed, the tests look different, and when you finally want to back out, you can't tell how far back to go. Undo it by hand and the conversation context and the actual code drift apart. As an indie developer running automated posting across several sites, I have been tripped up by this "half-finished wrong turn" more times than I'd like to admit.

The June 2026 Claude Code update gave /rewind a meaningful boost in behavior and stability. The feature itself isn't new, but combined with lower memory use in long sessions and improved agent behavior, it has become a safety net you can actually lean on in production. Let me walk through when it earns its keep, how it differs from git, and the part that's easy to misread when you run things unattended.

What /rewind restores, and what it doesn't

During a session, Claude Code automatically records a checkpoint at each editing milestone. Run /rewind (or press the escape key twice in quick succession) and you get a list of those checkpoints to jump back to.

The most important thing to understand is that there are two separate things it can restore.

One is the conversation (the context): it rewinds your exchange with Claude back to the point you choose. The other is the code (the file contents): it returns the files Claude Code edited in that session to their state at the chosen point. The /rewind menu lets you pick between restoring both, restoring code only, or restoring the conversation only.

Knowing what it does not restore prevents most accidents. Files you edited by hand without going through Claude Code, side effects from bash commands like git or rm, and writes that already left the machine over the network (API calls, pushes, deploys) are all outside /rewind's reach. Think of a checkpoint as a snapshot of "edits Claude Code is aware of," nothing more.

How it differs from a git reset

You might think git already covers this. The use cases do overlap, but the two watch different things.

git reset and git stash restore only the state of your code — commits and the working tree. The story of how you and Claude arrived at that implementation, the conversation, lives nowhere in git. /rewind, by contrast, rewinds code and conversation together. You can step back, dialogue and all, to the moment just before you agreed on a direction.

Here's how I split them. For returning to a committed stable point, or any large redo that crosses branches, I reach for git. For backing out just the spot where "things drifted a moment ago" in the middle of uncommitted experimentation, I use /rewind. The latter cleanly recovers something git struggles to express: a state where conversation and code drifted at the same time. They don't compete. Rewinding conversation and code close together first, then finishing with git if needed, is the safer layering.

The actual rewind procedure

The more tangled the situation, the safer it is to keep the operation simple. This is the basic flow I use.

First, before rewinding, stash any uncommitted hand edits. Because /rewind may discard hand edits outside its checkpoints, get them out of the way as a precaution.

# Stash what you touched by hand before rewinding
git stash push -u -m "before-rewind"
 
# Confirm it was stashed
git stash list

Next, open /rewind in Claude Code, find from the conversation history where the direction drifted, and select the checkpoint just before it. The trick is to pick the step before the off-course message, not the message itself. Rewind to a point that includes the drift and you'll simply resume from the same misunderstanding.

After rewinding, check just once that code and conversation aren't out of sync. Concretely, look for files that "shouldn't exist yet" at the restored point, and confirm the tests are back to their earlier shape. If that's clean, bring back only the hand edits you actually need from the stash.

# Verify the restored state, then pick up only the hand edits you need
git diff
git stash pop   # if it conflicts, fold changes in one at a time

Make "stash, rewind, verify, selectively restore" a single habit and you'll remember the steps even in a moment of panic.

The part that's easy to misread in automation

This is the corner the official description doesn't quite show. /rewind is a safety net for interactive sessions, not an undo mechanism for unattended scheduled runs.

I run article generation across several sites automatically, but I do not design those jobs to be rescued after the fact with /rewind. The reason is simple: an unattended job usually races all the way to committing operations that reach outside — pushes, deploys — which is well beyond what /rewind can restore (local files and conversation). You can rewind what's on your machine, but published results don't come back.

So on the automation side, I don't count on /rewind at all. Instead I place a separate gate that can stop before any committing operation. Split the stage that edits code from the stage that sends it outward, and slot verification in before sending. /rewind shines when you're sitting in front of the screen, working things out through dialogue. Keep the two roles straight and they divide cleanly.

If the long session itself feels unstable, context degradation may be happening before any rewind even enters the picture. I cover the warning signs and remedies in How to Keep Accuracy in Long Claude Code Sessions: Signs of Context Degradation and What to Do. For cases where the session itself won't restore, see also Fixing Claude Code When resume Won't Restore Your Previous Session.

Designing so you rarely need to rewind

/rewind is a reassuring safety net, but reaching for it often is also a signal that there are a lot of misreads you could have headed off earlier. What I try to do is put "what changes, and how" into words and agree on it once before handing over anything large. A short confirmation of the direction up front steadily reduces the situations where you go five steps and then rewind.

Things will still drift sometimes. And simply knowing /rewind is there widens how boldly you can delegate. A safety net is something you set up so you'll need it less often — seen that way, the value of this feature is less "you can rewind" and more "you can move forward without fear."

Next time you open Claude Code, try pressing the escape key twice to bring up the checkpoint list once. Just seeing with your own eyes where you could return to will make your decision faster when it matters. Thank you for reading.

Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

Claude Code2026-06-25
Higher Rate Limits Don't Mean Tighter Schedules — Spend the Headroom on 429 Recovery
When Claude Code's rate limits went up, the instinct was to pack the schedule tighter. Here's why I did the opposite and routed the new headroom into retry budget instead — a pacing note for unattended pipelines.
Claude Code2026-06-24
Productionizing a Claude Design Prototype — Single Source, CI, and OGP Auto-Generation
Turn a Claude Design prototype into something that survives production with Claude Code. The call to keep the generated runtime as your foundation, separating logic with a mixin, a single-source data design around a ledger CSV, and CI auto-updates with real-browser OGP capture — implementation included.
Claude Code2026-06-24
I Watched an Agent Try to Fix a File It Had Already Fixed — Stale Shallow Clones and Refreshing Before You Decide
An unattended agent tried to re-fix a file it had already fixed. The cause was a days-old shallow clone it kept reading. Here is how to detect that staleness numerically and re-clone only before decisions.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →