Chapter 10 of 14

When Things Go Sideways

Nine chapters of things going right. This one is about the other days — when the agent takes a confident wrong turn — and about why, in Elyra, that costs you two minutes instead of an afternoon.

The problem

You ask for a small polish pass on the tag input. The agent decides the component deserves a "clever" rewrite — a generic combobox abstraction with keyboard navigation and portal rendering. Five files later, the one thing SPEC.md holds sacred is broken: capture. The box doesn't focus on load anymore, and typing a comma does something baffling. Worse: it's not just your files that are polluted. The conversation is too. The bad idea is in context now, and everything the agent says next is built on top of it.

The hard way

Two separate cleanups, and only one of them works. The files: git checkout by hand — if you committed recently enough, and if you can tell which of the five changed files were the rewrite and which were the actual polish you asked for. The conversation: arguing the agent out of its rut. "Forget that approach, go back to the simple input" — and three turns later pieces of the combobox creep back in. Models anchor on their own recent output; telling one to forget something it can still see rarely fully works.

The Elyra way: checkpoints and /rewind

Elyra snapshots file state before the agent modifies files each turn. Those checkpoints have been accumulating silently since Chapter 1 — today they pay for themselves:

/rewind

A picker opens with the previous points in the session:

  Rewind to:
  > polish the tag input spacing        (5 files since)
    fix empty state copy on Browse
    add SearchResult keyboard focus
    ...

Pick the point just before "polish the tag input" — the turn where the rewrite began. Restoring does two things at once, and the second is the one that matters:

  • File state — all five files back exactly as they were. No archaeology over which changes were wanted.
  • Session state — the conversation rolls back too. The combobox idea isn't "disavowed"; it's gone. The agent can't anchor on output that no longer exists.

That's the total undo button. The bad idea never happened — in the code or in the context. Now re-prompt with the constraint that was missing:

> Polish the tag input spacing only. Do not restructure the
  component. Capture behavior per SPEC.md is untouchable.

The session is a tree

Here's the mental model shift: a rewind doesn't delete the abandoned turns. The session is a tree, not a line — the combobox branch is still there, parked, in case it turns out to have had one good idea in it.

/tree

The tree view shows every branch point from your rewinds and forks. Navigate, switch to any point, and label the good ones (shift+L in the tree view) so "the version where search worked and capture was fast" is a named place, not a memory. When a whole session is worth duplicating — say, as a starting point for a different experiment — /clone duplicates it at its current position.

Fork and replay

Rewind is for when things went wrong. Fork is for before they might: double-Escape (or /fork) branches from an earlier message, so you can try approach B while approach A stays intact on its own branch. About to attempt a risky refactor of the capture flow? Fork first. If it works, keep the branch; if not, the original is one /tree switch away.

And then there's the rut-breaker. Sometimes the problem isn't the prompt — it's that the daily driver is stuck in a loop, proposing the same shape of wrong answer over and over:

/replay

/replay reruns the last turn on a new branch with a different model. Same prompt, same context, fresh perspective — sonnet's turn gets replayed by gpt-5.6 from the Chapter 3 lineup. This is the same insight as Chapter 8's cross-vendor review, applied mid-conversation: when a model is anchored, don't argue with it — ask a model with different instincts the exact same question and compare the branches.

The economics of this chapter: when undo is total, experiments stop being scary. Try the weird refactor. Let the agent attempt the ambitious version. The worst case is no longer "an afternoon of cleanup" — it's /rewind, pick a point, two minutes.

What you learned

  • Experiments are cheap when undo is total. Checkpoints snapshot files before every modifying turn, automatically.
  • Rewind kills anchoring. /rewind restores files and conversation — the bad idea disappears from context, so the agent can't build on it.
  • Fork before risky refactors. Double-Escape or /fork branches the session; /tree navigates it; label the good points.
  • /replay is a second opinion on the exact same turn. Same prompt, different model, new branch — the fastest way out of a rut.
Next: in Chapter 11 Freddy stops being a solo project — and everything you've taught your Elyra becomes something the whole team inherits.