TIL: /btw VS --fork-session

Thariq
Thariq @trq212
We just added /btw to Claude Code! Use it to have side chain conversations while Claude is working. https://t.co/hjO3YqvrPr

I tried out the new /btw.

It was nice to fire off a follow up question while Claude was working away

But if you want to to ask a another follow-up question, you are out of luck.

I'll go back to my keybinding in tmux that allows me to branch at anytime into a new pane, --fork-session is doing all the work:

# ~/.tmux.conf

# Fork Claude conversation with | and _
# Uses @claude_session_id pane option set by SessionStart hook in ~/.claude/settings.json
bind | run-shell 'SID="#{@claude_session_id}"; if [ -n "$SID" ]; then tmux split-window -h -c "#{pane_current_path}" "claude --dangerously-skip-permissions --resume $SID --fork-session"; else tmux split-window -h -c "#{pane_current_path}" "claude --dangerously-skip-permissions --continue --fork-session"; fi'

Here is the referenced hook:

# ~/.claude/settings.json
...
 "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "if [ -n \"$TMUX\" ]; then SESSION_ID=$(jq -r '.session_id' 2>/dev/null); [ -n \"$SESSION_ID\" ] && [ \"$SESSION_ID\" != \"null\" ] && tmux set-option -p @claude_session_id \"$SESSION_ID\"; fi"
          }
        ]
      }
    ],
...