Back to home

Conversation Branching

Agents sometimes take the wrong path. Cogpit lets you explore alternative approaches and switch between branches — all without losing a single line of work.

Try it yourself

Open the branches modal to navigate between alternative approaches — OAuth, magic links, and WebAuthn passkeys — and switch the active branch.

Components marked Interactive are live demos — click, expand, and explore them right here on this page.
Interactive
Youturn 1

Build a user authentication system with JWT

Claudeturn 2

I'll set up the authentication system. Let me start with the user model and auth routes.

Read
Write
Write
Youturn 3

Add password hashing and input validation

Claudeturn 4

Added bcrypt hashing and Zod validation schemas. All tests passing.

Edit
Write
Bash

How it works

1

Agent makes tool calls

Each turn is recorded as a node in the conversation graph. Tool calls like Edit Write Bash are tracked with their full input/output and success status.

T1 T2 T3 T4 T5
2

Undo rewinds turns

Each undo dims the most recent turn. The turn isn't deleted — it's marked as "undone" and can be restored with redo. The graph visually shows undone turns as dashed connections with faded nodes.

undone undone
3

Branch from any point

When you undo some turns and give a new instruction, the conversation forks. The undone turns are archived as a branch. You can switch between branches at any time through the branch modal — nothing is ever lost.

main new branch

When to branch

Wrong approach

Agent chose Passport.js but you want a simpler solution. Undo those turns and try magic links instead — the OAuth approach stays archived.

A/B exploration

Try two different implementations from the same starting point. Compare the branches side-by-side and keep the one that works best.

Error recovery

A bad edit broke the build. Instead of trying to fix it forward, rewind to the last good state and take a different path.