Claude Code Runs sed -i as Written and No Longer Previews or Rewinds It

Claude CodeView original changelog

Claude Code 2.1.309 changes how sed -i is handled. It now gets the standard Bash permission prompt and runs exactly as written, instead of showing a simulated file-edit preview. Like other Bash edits, the result is no longer restored by /rewind.

Key Takeaways

  • sed -i now gets the standard Bash permission prompt, instead of a simulated file-edit preview.
  • The command runs exactly as written, which removes any difference between the previewed edit and the real one.
  • /rewind no longer restores sed -i changes, matching how other Bash edits behave.
  • Users who treated rewind as an undo for sed edits lose that safety net, and should lean on git commits.
  • The change brings sed -i under ordinary Bash permission rules, so allow and deny rules for Bash now apply to it.
  • The release is a behavior change, not a new feature, so the impact falls on existing habits and workflows.

What changed

Claude Code 2.1.309 changes how in-place sed edits are handled. Before this release, a sed -i command was shown to the user as a simulated file edit, a preview of what the file would look like afterward. From 2.1.309, sed -i is treated like any other Bash command: it gets the standard Bash permission prompt, and it runs exactly as written.

Effect on rewind

The practical consequence is on /rewind. Because the command no longer goes through the file-edit path, its changes are not checkpointed in the same way. Like other Bash edits, a sed -i change is no longer restored by /rewind. Users who relied on rewinding a sed edit as an undo should note that this safety net no longer applies, and should rely on git or their own backups for these changes.

Why it matters

The old preview was a simulation, which could differ from what the real sed did. Running the command as written removes that gap between what was approved and what executes, and puts sed -i under the same permission rules and prompts as other shell commands. The trade-off is the loss of the preview and of rewind support for this one pattern.