/fork should display the parent session ID in the forked session
Problem
When using /fork, the new session has no reference back to the parent session. If you want to return to the original session after exploring a fork, you have to remember or look up the parent session ID manually — which is easy to forget.
Proposed solution
One or more of:
- At fork time: Print the parent session ID in the output, e.g.:
````
Forked from session: abc-123. Resume parent with: claude --resume abc-123
- In the forked session: Make the parent session ID available as an environment variable (e.g.
CLAUDE_PARENT_SESSION_ID) or in the hook context (parent_session_idfield inSessionStarthook stdin).
- A
/backcommand: In a forked session,/backresumes the parent session directly.
Current workaround
I've written a UserPromptSubmit hook that intercepts /fork and saves the current session_id to ~/.claude/fork_parent.txt before the fork happens. This works but requires the user to set it up manually.
Why it matters
/fork is most useful for exploratory experiments — you want to try something risky and return safely. But without easy navigation back, the fork/parent mental model breaks down.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗