Cursor CLI: Add /undo command to revert agent changes

Feature request for product/service

Cursor CLI

Describe the request

The Cursor CLI currently has no way to undo the last agent action. This is a critical gap for context engineering — the practice of deliberately managing what the agent sees, does, and builds upon at each step.

Here’s why this matters beyond simple “oops, wrong output”:

Context poisoning — A bad agent turn doesn’t just produce bad code; it contaminates the conversation context. Subsequent prompts now reason on top of broken assumptions. You can’t fix this by just deleting files — the model’s in-context state is already dirty.

Iterative prompting requires rollback — Good context engineering means running a prompt, evaluating the result, and rewinding if the direction is wrong. Without undo, every bad turn forces a full git reset and a fresh session, destroying accumulated context that was working.

Claude Code has /rewind. OpenCode has /undo. This is becoming table stakes for any agentic CLI.

Request: A /undo command (or equivalent flag) that reverts the agent’s last turn changes and pops it from the active context window.
The main Cursor IDE supports this and I hope it can be brought to the CLI as well.

1 Like