Accidental merge
Resuming on main when the session lived on feature/x means merging unfinished changes into the main branch.
Git + AI guide · 3 min
An interrupted AI session isn't just lost context: it's also a git state. Resuming in the wrong worktree risks a dirty merge or a silent regression. Here's the procedure to follow.
The real problem
Resuming on main when the session lived on feature/x means merging unfinished changes into the main branch.
An agent often leaves exploration files behind. Without the original worktree, it can't find them and regenerates an inconsistent state.
The summary is built on the fly from the repository's current state. If the repo has moved on, the summary describes a project that no longer exists.
Procedure
Filter by project, sort by date. The record shows: git branch, worktree path, agent used, last known commit.
Tramya compares the current HEAD with the expected branch. A difference? A visual alert before any action.
A "git worktree add" button: the exact command, with the right path and the right branch. No other worktree is touched.
The original agent or another agent of your choice. Tramya injects the context summary based on the state from back then, not the current state.
Tramya offers to recreate it from the last known commit or from a closed PR. Nothing automatic.
Yes. The handoff is agent-agnostic: Claude Code → Codex, Cursor, Hermes, with no loss of project context.
Yes, if it's clean. Otherwise, Tramya creates a fresh worktree on the same branch to avoid conflicts.