/fork should display the parent session ID in the forked session

Resolved 💬 3 comments Opened Apr 9, 2026 by kandula-chakradhar Closed Apr 12, 2026

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:

  1. 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
``

  1. 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_id field in SessionStart hook stdin).
  1. A /back command: In a forked session, /back resumes 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗