4. Steer without stopping#
Typing mid-turn queues a message injected at the next model call — you redirect
without cancelling. Esc interrupts. /rewind returns to any node in the session
tree. /undo reverts the last tool batch's file changes from a per-batch snapshot
held in a shadow git object store — no commits in your repository.
Sessions#
JSONL under ~/.local/share/earshot/sessions/<cwd-hash>/<id>.jsonl, tree
structured (id, parentId) so /fork, /rewind, --resume and --continue
are all navigation over one file. Append-only: compaction and rewind add entries
rather than rewriting history. Permissions are deliberately not restored on
resume.
Two details that are easy to get wrong and were: an append reads its parent
inside the write queue, not at call time — reading it eagerly makes concurrent
appends siblings of one entry rather than a chain — and session ids carry a
time-ordered prefix, because UUIDs do not sort by creation and mtimes tie within
a millisecond, which left --continue picking arbitrarily.
Undo#
Per-tool-batch snapshots in a git object database under the data dir, with
GIT_DIR pointed away from the project. The user's repository is never touched —
no commits, no stash, no index changes. An agent that commits to manage its own
undo has silently rewritten the user's history.
Per batch rather than per call, so undo restores a coherent unit. git being absent disables undo rather than failing.
Scoped to the session that took the snapshot. The store is keyed by working
directory, so every session in a project shares it, and an unscoped /undo
stepped back through whatever was most recent in the directory — after a crash
and a resume, that meant reverting a batch the user had never watched run. Older
snapshots stay on disk and stay restorable by the session that made them; they
are simply not offered to anyone else. A snapshot written before sessions were
recorded belongs to none of them, because crediting it to whoever asks is the
bug itself.
Navigate the session#
| Command | Behavior |
|---|---|
/tree | List numbered prompts |
/rewind <n> | Return to the state before prompt n; append navigation, delete nothing |
/fork <n> | Branch from prompt n into a new transcript |
/undo | Revert the last file-change batch for this session |
earshot --continue | Resume the most recent session for this working directory |
Rewind navigates conversation state; undo restores file state. They are different operations. An interrupted tool call still receives a result part so the next provider request has a complete history.