JavaRush /Courses /Claude Code SELF /The cancel button and the control panel

The cancel button and the control panel

Claude Code SELF
Level 3, Lesson 3
Available

1. /rewind — rewind what the agent has done

Tommy grins slyly in the office coffee corner, holding a coffee cup, a bottle of soda and a plate with a sandwich, a banana and cookies, next to a sign about free espresso with “tachycardia included”

Tommy went for coffee and then back to Alex again:

“Okay, I get the theory. States, history, git — got it written down. Where is the button?”

“Here it is.” Alex opens a session with the AI agent. “The main thing today is the /rewind command. You type it right in the conversation with the agent — and it rewinds what it has done. In other words, a big Ctrl+Z for the current work. Or, even closer, loading a save in a game: it went bad — you returned to the moment when it was good.”

“Exactly what I wanted.” Tommy perks up. “Show me on a live example.”

“Let’s break something on purpose and roll it back. You are building Tetris, right? So let’s add something risky to the spec.”

Add level-based acceleration to Tetris.

“The agent changed the spec,” Alex comments, “and, say, went overboard: the pieces now fall like crazy, and it is impossible to play. Before, you would have sat there wondering how to clean up this mess by hand. Now watch.”

2. Rollback menu: what exactly to restore

Alex enters one line in the session:

/rewind
The /rewind menu in the AI agent's terminal: a list of past prompts with timestamps, with the latest one, “Add level-based speed-up to Tetris” from 2 minutes ago, selected

“You can also call the same thing, by the way, with a double tap of Esc on an empty input line,” he adds. “Esc Esc. Handy when you are too lazy to type.”

A menu opens. The AI agent does not roll back blindly — it shows the previous points and asks what exactly to restore:

Restore code and conversation   # roll back both the code and the conversation history
Restore conversation            # roll back only the conversation
Restore code                    # roll back only the changes on disk
The /rewind confirmation screen with three restore options, Restore code and conversation, Restore conversation and Restore code, and a warning below that files edited manually or via bash are not rolled back

“There are three options here, and the difference is huge,” Alex explains, not letting Tommy get lost. “The first one brings back both the code and the conversation history: as if this run never happened at all. The second one rolls back only the conversation, while leaving the code changes alone. The third one is the opposite: roll back only the changes on disk, and leave the conversation as is. Right now we need to remove the breakage in the code/spec — we choose Restore code.”

He selects Restore code.

“And that is it. The speed-related changes rolled back as if they never happened. Tetris falls normally again. You can try again, differently, even ten times. Do you feel what happened? The doubts are gone. Any failed attempt is erased with a single move.”

Tommy looks at the screen, at the spec he spent so long on, and something eases in his chest.

“So that is it. My button. No gits, no folders.”

3. Where the button hits a fence: what /rewind will not bring back

Tommy runs through different scenarios in his head and is very pleased, his eyes shining:

“Awesome. So now I am basically immortal? I can do whatever I want, any nonsense — and it will all be rewound back for me, right? Broke it, did not break it, who cares, nobody is going to find out anyway.”

“Hold on there, and this is important.” Alex becomes a little more serious. “So there are no unpleasant surprises later. /rewind rewinds two things: the changes the agent made in files, and the history of your conversation in this session. That is its territory; that is where it is god.”

“And what will it not bring back?”

“Remember two things. First — commands in the terminal. If the agent deleted something through the terminal — there is such a command, rm, it wipes a file out completely — then /rewind will not resurrect it. Rollback watches code changes, not everything that happened in the system. Second — changes outside the session: anything changed not through the agent, behind its back. It also does not see that and will not bring it back.”

Where the button’s fence is: /rewind rolls back what happens inside the session with the agent — the agent’s edits to files and the conversation history; it won’t bring back terminal commands — if rm deleted a file, it can’t be resurrected — or changes made behind the agent’s back, by hand or by another program; /rewind is session-level insurance, not a time machine for the whole computer Where the button’s fence is /rewind zone: the session with the agent The agent’s edits to files get rolled back Conversation history gets rolled back Beyond the fence: won’t come back Terminal commands rm deleted a file — it can’t be resurrected Changes behind the agent’s back by hand or by another program /rewind is session-level insurance, not a time machine for the whole computer

He chooses the wording so it sticks:

“Tell yourself this: /rewind is session-level insurance, not a time machine for the whole computer. For light experiments in current work, it is exactly what you need. But the real big safety net, at the whole-project level, in case of serious failures, is a separate grown-up topic. Remember what it is called? Right, git. We will get to it later. And today it is a light, quick button, and for a sandbox it is more than enough.”

4. Slash-command control panel: /help and /clear

“Hey, why does /rewind have a slash?” Tommy notices. “I usually write to the agent in words, and here there is some kind of slash.”

“Oh, good that you caught that.” Alex was clearly waiting for it. “Since I gave you your first such command, here is the general principle. Besides tasks written in normal words, the agent has a control layer — commands that start with a slash /. Imagine a control panel with buttons on top of your free-form conversation: with free text you assign tasks, and with the control panel you manage the agent itself. This control panel also has a grown-up name — slash commands (from the slash, that very /). You will hear that name everywhere now, so keep both the control-panel analogy and the word itself in your head.”

“And how many buttons are there?”

“Quite a few, but two are enough for you today. Here they are:”

/help    # show a list of all available commands — what the control panel can do
/clear   # clear the conversation, start from a clean slate 
The /help screen on the Commands tab: a list of the agent's built-in slash commands with short descriptions, such as /add-dir, /agents, /branch, /bug and more

“/help is your reference guide,” Alex continues. “Forgot a command, do not remember what you have at hand, type /help, look at the list. And /clear is an important thing: the conversation with the agent can be reset. Sometimes a session accumulates a pile of old stuff, and it gets in the way of a new task, the agent gets confused about what happened an hour ago. Clean it up with /clear — and it works with a fresh head. Note: the previous conversation will not disappear — you can always return to it — and you just keep going from a clean slate.”

“And why does it need its head ‘cleaned’ anyway? What accumulates there?”

“That is a separate big topic, what exactly the agent keeps in mind and why it sometimes needs to be cleaned — we will sort that out much later, separately. For now just remember that such a button exists and that a cluttered conversation can be reset.”

5. Work does not evaporate: --continue and --resume

“And the last thing for today, so you can sleep peacefully,” says Alex. “So in the evening you got up from the desk, closed the terminal, turned off the computer. You think that is it, the conversation is gone, tomorrow from scratch?”

“Well… yes?” Tommy really thought so.

“No. Work does not disappear. The session can be continued:”

claude --continue    # continue the last session in this folder
claude --resume      # choose from the list of past sessions

“--continue will pick up the last session right in this folder, from where you left off. And --resume will show a list of past sessions — you choose which one to bring back to life. Start in the evening, continue in the morning — the agent remembers where you left off. No need to start over every time.”

Tommy sums it up in his own words:

“In short, I used to have a folder zoo like a cave person, and now I have a control panel like a pilot. /rewind — rewind a failed attempt. /help — see what the panel can do. /clear — clear the conversation. And the session does not get lost even if I slammed the lid shut and walked away. No more chaos disguised as safety. I told you — I catch on the fly.”

“Well, now go and break Tetris however you want.” Alex smiles. “You have something to rewind with.”

1
Task
Claude Code SELF, level 3, lesson 3
Locked
Risky change and rollback 🔥
Risky change and rollback 🔥
1
Task
Claude Code SELF, level 3, lesson 3
Locked
Immortal Button 🔙
Immortal Button 🔙
1
Task
Claude Code SELF, level 3, lesson 3
Locked
Control panel 🎛️
Control panel 🎛️
1
Task
Claude Code SELF, level 3, lesson 3
Locked
Yesterday's Session 💾
Yesterday's Session 💾
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION