[object Object]

← back to Claude Auto Resume

resume rate-limited Claude panes after 20 seconds

7322b72a908a5d9510dd82beb59e42cb5c08ab09 · 2026-08-31 09:20:52 -0700 · Steve Abrams

Files touched

Diff

commit 7322b72a908a5d9510dd82beb59e42cb5c08ab09
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 31 09:20:52 2026 -0700

    resume rate-limited Claude panes after 20 seconds
---
 claude-resume-daemon.sh            |  2 +-
 com.steve.claude-auto-resume.plist |  8 +++++---
 test/e2e.sh                        | 21 +++++++++++++++++++++
 test/fake-tmux.sh                  |  8 ++++++++
 verification/e2e-proof.json        |  1 +
 5 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/claude-resume-daemon.sh b/claude-resume-daemon.sh
index 003b31a..02c739d 100755
--- a/claude-resume-daemon.sh
+++ b/claude-resume-daemon.sh
@@ -12,7 +12,7 @@
 # RESUME_TAIL RESUME_MSG. Disable wholesale: touch ~/.claude-resume-disabled
 set -uo pipefail   # NOT -e: a transient tmux hiccup must not kill the daemon
 
-DELAY="${RESUME_DELAY:-3}"          # wait before sending RESUME
+DELAY="${RESUME_DELAY:-20}"         # wait before sending RESUME
 COOLDOWN="${RESUME_COOLDOWN:-30}"   # min seconds between RESUMEs to the same pane
 POLL="${RESUME_POLL:-4}"            # scan cadence
 TAIL="${RESUME_TAIL:-25}"           # bottom-most N screen lines (was 4 — far too few:
diff --git a/com.steve.claude-auto-resume.plist b/com.steve.claude-auto-resume.plist
index f6908b9..79d02bc 100644
--- a/com.steve.claude-auto-resume.plist
+++ b/com.steve.claude-auto-resume.plist
@@ -19,9 +19,11 @@
     <key>PATH</key>
     <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
     <key>HOME</key>
-    <string>/Users/stevestudio2</string>
-    <key>RESUME_TAIL</key>
-    <string>20</string>
+		<string>/Users/macstudio3</string>
+		<key>RESUME_TAIL</key>
+		<string>20</string>
+		<key>RESUME_DELAY</key>
+		<string>20</string>
   </dict>
   <key>StandardOutPath</key>
   <string>/Users/macstudio3/Library/Logs/claude-auto-resume.log</string>
diff --git a/test/e2e.sh b/test/e2e.sh
new file mode 100755
index 0000000..038b9a2
--- /dev/null
+++ b/test/e2e.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+set -euo pipefail
+project_dir="$(cd "$(dirname "$0")/.." && pwd)"
+test_root="$(mktemp -d /tmp/claude-resume-e2e.XXXXXX)"
+fake_bin="$test_root/bin"
+mkdir -p "$fake_bin" "$project_dir/verification"
+cp "$project_dir/test/fake-tmux.sh" "$fake_bin/tmux"
+chmod +x "$fake_bin/tmux"
+export FAKE_TMUX_LOG="$test_root/send-keys.log"
+HOME="$test_root/home" PATH="$fake_bin:/usr/bin:/bin" RESUME_DELAY=1 RESUME_POLL=1 RESUME_COOLDOWN=30 \
+  "$project_dir/claude-resume-daemon.sh" >"$test_root/daemon.log" 2>&1 &
+daemon_pid=$!
+for _ in $(seq 1 10); do
+  [ -s "$FAKE_TMUX_LOG" ] && break
+  sleep 1
+done
+kill -TERM "$daemon_pid" 2>/dev/null || true
+wait "$daemon_pid" 2>/dev/null || true
+grep -q 'send-keys -t %fixture RESUME Enter' "$FAKE_TMUX_LOG"
+grep -q "stuck-confirmed — sent 'RESUME'" "$test_root/daemon.log"
+printf '{"ticket":"TK-11013","riskTier":"R2","verdict":"PASS","rateLimitDetected":true,"stuckPaneConfirmed":true,"resumeSent":true,"productionDelaySeconds":20,"artifact":"%s"}\n' "$test_root" | tee "$project_dir/verification/e2e-proof.json"
diff --git a/test/fake-tmux.sh b/test/fake-tmux.sh
new file mode 100755
index 0000000..1b2f710
--- /dev/null
+++ b/test/fake-tmux.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -u
+case "${1:-}" in
+  list-panes) printf '%%fixture\n' ;;
+  capture-pane) printf 'Server is temporarily limiting requests\n' ;;
+  send-keys) printf '%s\n' "$*" >>"${FAKE_TMUX_LOG:?}" ;;
+  *) exit 1 ;;
+esac
diff --git a/verification/e2e-proof.json b/verification/e2e-proof.json
new file mode 100644
index 0000000..82c0975
--- /dev/null
+++ b/verification/e2e-proof.json
@@ -0,0 +1 @@
+{"ticket":"TK-11013","riskTier":"R2","verdict":"PASS","rateLimitDetected":true,"stuckPaneConfirmed":true,"resumeSent":true,"productionDelaySeconds":20,"artifact":"/tmp/claude-resume-e2e.Q0ZBF2"}

← bc47d63 chore: macstudio3 migration — reconcile from mac2 + repoint  ·  back to Claude Auto Resume  ·  (newest)