From 1f7f0779bdc04511d5f9b068bf79f1baf7e94505 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 26 Apr 2026 01:01:37 -0700 Subject: [PATCH] rclaude: launch path no longer forces --continue; resume path keeps it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conflating launch and resume was wrong: tmux already provides 'reattach to the live conversation' (named session keyed by dir). Adding --continue to the launch path also caused surprise replays of stale conversations and clashed with other claude processes holding the same on-disk session. - launch (rclaude HOST DIR): plain 'claude' — fresh session - transport-drop reattach: tmux session reattach (automatic, same command) - explicit on-disk resume: 'rclaude resume ' — sets RCLAUDE_RESUME=1 when re-execing, which adds --continue to the launch invocation --- bin/rclaude | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/rclaude b/bin/rclaude index d2ec117..3630083 100755 --- a/bin/rclaude +++ b/bin/rclaude @@ -152,8 +152,10 @@ cmd_resume() { fi ;; disk) - # Spawn a fresh tmux + claude --continue at the recorded cwd. - exec "$0" "$_host" "$_target" + # Spawn tmux + claude --continue at the recorded cwd. The env var + # tells the launch path below to add --continue (it doesn't by + # default, since --continue is the explicit-resume behavior). + RCLAUDE_RESUME=1 exec "$0" "$_host" "$_target" ;; esac } @@ -216,8 +218,15 @@ esac build_inner() { # Single-line, single-quote-safe. Variables prefixed with rc_ to avoid # collision with anything in the user's shell. + # + # Note: launch path uses plain `claude` (fresh session). Reattach to a + # live conversation is handled by tmux (named session keyed on dir, so + # re-running rclaude in the same dir reattaches). Disk-resume is the + # explicit `rclaude resume ` subcommand. + _resume_flag="" + [ "${RCLAUDE_RESUME:-0}" = "1" ] && _resume_flag="--continue" printf '%s' \ - "cd ${1} && rc_t=\$(date +%s); claude --continue ${flag}; rc_ec=\$?; " \ + "cd ${1} && rc_t=\$(date +%s); claude ${_resume_flag} ${flag}; rc_ec=\$?; " \ "rc_e=\$(date +%s); rc_d=\$((rc_e - rc_t)); " \ "if [ \$rc_ec -ne 0 ] || [ \$rc_d -lt 2 ]; then " \ "printf '\\n[rclaude] claude exited in %ds with code %d\\n' \$rc_d \$rc_ec; " \