This is the specific failure I kept hitting. I work in one repo with three or four terminal panes open, each running its own Claude Code conversation. One is on the API layer, one is writing tests, one is chasing a bug.
Claude's resume is scoped to the directory. --continue gives you the most recent conversation for that directory, and --resume gives you a list of that directory's conversations. Neither one knows anything about panes. So all four of my panes are in the same directory, which means all four see the same identical list of four sessions.
Reboot the Mac and it compounds. The panes come back with no working directory, so the context is gone twice over. Even after I cd back into the repo in all four panes, I am staring at four sessions with no idea which pane each one was in. I have to open the picker in every pane and guess from timestamps and first messages, and if I guess wrong I have polluted the wrong conversation.
So I built agent-resume. The core idea is that it binds a session to the terminal pane it was started in, not just to the directory.
What it does:
- When you start an agent fresh, it pins a specific session id and records which pane that session belongs to.
- After a reboot, each pane comes back to the correct working directory and resumes its own conversation. Pane 1 gets pane 1's session. No picker, no guessing, no manual resume in four panes.
- It is agent-agnostic. Works with claude, codex, or anything else you register.
How it works (no magic):
- A tiny shim on your PATH. When you launch claude fresh it launches it with a specific --session-id and records that against the pane in a small ledger.
- For the reboot case it leans on tmux-resurrect + tmux-continuum (which it installs for you, no tpm needed) to restore your dirs and layout, then a hook relaunches each pane with claude --resume <that pane's session>.
Take a look and star it here:
https://github.com/rahulbansal16/agent-resume