diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-11 09:25:35 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-11 09:25:35 +0300 |
| commit | 8ff58de26b9b759be3ceec961ec198e6827b1455 (patch) | |
| tree | 78bce5a2a0f8d667a255ec7894e6faf45387244f | |
| parent | c09763944f6707495ef4ed3f2e60fbb7db6ee50c (diff) | |
Add continue-reminder skill with agent-specific sub-references
New skill: prompts/skills/continue-reminder/
- SKILL.md: common systemd + tmux resume skeletons
- references/claude.md: full concrete example (Claude Code rate-limit in tmux)
- references/codex.md: placeholder
- references/opencode.md: placeholder
- references/amp.md: placeholder
| -rw-r--r-- | prompts/skills/continue-reminder/SKILL.md | 99 | ||||
| -rw-r--r-- | prompts/skills/continue-reminder/references/amp.md | 31 | ||||
| -rw-r--r-- | prompts/skills/continue-reminder/references/claude.md | 114 | ||||
| -rw-r--r-- | prompts/skills/continue-reminder/references/codex.md | 28 | ||||
| -rw-r--r-- | prompts/skills/continue-reminder/references/opencode.md | 30 |
5 files changed, 302 insertions, 0 deletions
diff --git a/prompts/skills/continue-reminder/SKILL.md b/prompts/skills/continue-reminder/SKILL.md new file mode 100644 index 0000000..6ed360b --- /dev/null +++ b/prompts/skills/continue-reminder/SKILL.md @@ -0,0 +1,99 @@ +--- +name: continue-reminder +description: Resume a paused coding-agent session after a rate limit, cooldown, or scheduled break by using systemd user timers to send keystrokes to the correct tmux pane. Supports Claude, Codex, OpenCode, and AMP agents. +--- + +# Continue Reminder via Systemd + +Use this skill when a coding agent running inside a tmux pane gets paused (rate-limited, user-throttled, or intentionally interrupted) and you want to **automatically resume** it at a known future time using systemd user timers and services. + +## When to Use + +- You hit a rate limit in a coding agent (e.g., Claude Code "session limit") +- You need to schedule a delayed `continue` or equivalent command +- The agent lives in a tmux pane and accepts keyboard input to resume +- You want the resume to happen automatically even if you step away +- You support multiple coding agents (Claude, Codex, OpenCode, AMP) and need per-agent specifics + +## How It Works + +1. **Inspect** the tmux pane where the agent is blocked. +2. **Note** the reset time / condition. +3. **Create** a systemd user timer that triggers at (or after) that time. +4. **Create** a oneshot service that runs a script sending the right keystrokes to the tmux pane. +5. **Enable** the timer; systemd wakes up and resumes the session automatically. + +## Reference Files + +Each coding agent has its own quirks (prompt text, resume command, key sequences). See the agent-specific sub-references below: + +- [Claude](references/claude.md) — Claude Code CLI in tmux, rate-limit screen, `continue` +- [Codex](references/codex.md) — Placeholder for Codex CLI specifics +- [OpenCode](references/opencode.md) — Placeholder for OpenCode Agent specifics +- [AMP](references/amp.md) — Placeholder for AMP agent specifics + +## Common Ingredients + +These pieces are reused across all agent implementations: + +| Component | Typical Path / Value | +|-----------|---------------------| +| TMUX socket | `/tmp/tmux-$(id -u)/default` | +| Script dir | `~/.local/bin/` | +| Service dir | `~/.config/systemd/user/` | +| Timer type | `OnCalendar` for wall-clock triggers | +| Service type | `oneshot` | + +### Skeleton Script + +```bash +#!/bin/bash +set -euo pipefail + +TMUX_SOCKET="/tmp/tmux-$(id -u)/default" +TARGET="<session>:<window>.<pane>" + +# 1) Acknowledge / select "stop and wait" +tmux -S "$TMUX_SOCKET" send-keys -t "$TARGET" Enter + +# 2) Sleep past the reset window +sleep <buffer_seconds> + +# 3) Send resume command +tmux -S "$TMUX_SOCKET" send-keys -t "$TARGET" "<resume_command>" Enter +``` + +### Skeleton Service + +```ini +[Unit] +Description=Resume <agent> in tmux pane + +[Service] +Type=oneshot +ExecStart=%h/.local/bin/<script>.sh +Environment="PATH=/usr/local/bin:/usr/bin:/bin" +``` + +### Skeleton Timer + +```ini +[Unit] +Description=One-off timer for <agent> tmux resume + +[Timer] +OnCalendar=<ISO_datetime> +AccuracySec=1s +Persistent=false + +[Install] +WantedBy=timers.target +``` + +### Enable / Check + +```bash +systemctl --user daemon-reload +systemctl --user enable --now <timer>.timer +systemctl --user status <timer>.timer +``` diff --git a/prompts/skills/continue-reminder/references/amp.md b/prompts/skills/continue-reminder/references/amp.md new file mode 100644 index 0000000..7dfd2aa --- /dev/null +++ b/prompts/skills/continue-reminder/references/amp.md @@ -0,0 +1,31 @@ +# AMP Agent — Continue Reminder + +> **PLACEHOLDER** — This reference has not been populated yet because the AMP agent was not active in the originating session. + +## Known Differences from Claude + +| Aspect | Expected Behavior | +|--------|-------------------| +| Rate-limit screen | Unknown; AMP may handle throttling server-side | +| UI paradigm | Unknown; could be TUI, web UI, or API-driven | +| Resume command | Unknown | +| Session model | AMP might use long-running processes or ephemeral workers | + +## TODO + +1. Clarify what "AMP" refers to in this context: + - **Amplify** (AWS)? + - **AIX MP** (IBM)? + - A proprietary/multi-agent coding harness? + - Something else? + +2. Determine AMP's runtime environment: + - Does it run in a tmux pane? + - Is it daemonized? + - Does it expose a CLI that can be scripted? + +3. If AMP has a resumable terminal session, capture the pane state and record: + - Pause / limit indicator text + - Keystrokes or commands required to resume + +4. Update this file with a concrete example mirroring the Claude reference structure. diff --git a/prompts/skills/continue-reminder/references/claude.md b/prompts/skills/continue-reminder/references/claude.md new file mode 100644 index 0000000..10a4d37 --- /dev/null +++ b/prompts/skills/continue-reminder/references/claude.md @@ -0,0 +1,114 @@ +# Claude Code CLI — Continue Reminder + +Concrete example: Claude Code CLI running in a tmux pane hits a **session rate limit** and presents a `/rate-limit-options` menu. + +## Scenario + +- tmux session: `ior` +- Window: `0` +- Pane: `0.0` (Claude Code blocked) +- Message: *"You've hit your session limit · resets 1:10pm (Europe/Sofia)"* +- Menu option 1: **"Stop and wait for limit to reset"** +- Resume command after reset: **`continue`** + +## What the Blocked Pane Looks Like + +``` + ❯ 1. Stop and wait for limit to reset + 2. Upgrade your plan + 3. Upgrade to Team plan + + Enter to confirm · Esc to cancel +``` + +## Steps Taken + +1. **Capture the pane** to confirm state: + ```bash + tmux capture-pane -t ior:0.0 -p + ``` + +2. **Create the resume script** at `~/.local/bin/ior-tmux-resume.sh`: + ```bash + #!/bin/bash + set -euo pipefail + + TMUX_SOCKET="/tmp/tmux-$(id -u)/default" + TARGET="ior:0.0" + + tmux -S "$TMUX_SOCKET" has-session -t "$TARGET" || { + echo "Target pane $TARGET not found"; exit 1; + } + + # Select option 1: "Stop and wait for limit to reset" + tmux -S "$TMUX_SOCKET" send-keys -t "$TARGET" Enter + + # Wait 5 minutes past the advertised reset time + sleep 300 + + # Resume the Claude session + tmux -S "$TMUX_SOCKET" send-keys -t "$TARGET" "continue" Enter + ``` + +3. **Create the systemd user service** at `~/.config/systemd/user/ior-resume.service`: + ```ini + [Unit] + Description=Resume Claude in ior tmux pane after rate-limit reset + + [Service] + Type=oneshot + ExecStart=/home/paul/.local/bin/ior-tmux-resume.sh + Environment="PATH=/usr/local/bin:/usr/bin:/bin" + ``` + +4. **Create the systemd user timer** at `~/.config/systemd/user/ior-resume.timer`: + ```ini + [Unit] + Description=One-off timer for ior tmux resume at 13:10 today + + [Timer] + OnCalendar=2026-06-11 13:10:00 + AccuracySec=1s + Persistent=false + + [Install] + WantedBy=timers.target + ``` + +5. **Make executable and enable**: + ```bash + chmod +x ~/.local/bin/ior-tmux-resume.sh + systemctl --user daemon-reload + systemctl --user enable --now ior-resume.timer + systemctl --user status ior-resume.timer + ``` + +## Verification + +Check timer state: +```bash +systemctl --user status ior-resume.timer +``` + +Expected output: +``` + Trigger: Thu 2026-06-11 13:10:00 EEST; 4h 3min left + Triggers: ● ior-resume.service +``` + +## Key Details + +| Item | Value | +|------|-------| +| Rate-limit reset time | Shown in the Claude banner (tz-aware) | +| TMUX socket | `/tmp/tmux-$(id -u)/default` | +| First keystroke | `Enter` confirms menu option 1 | +| Buffer sleep | `300` seconds (5 min) past reset time | +| Resume command | `continue` | +| Command suffix | `Enter` | + +## Caveats + +- The `continue` command is specific to Claude Code CLI; other agents use different resume verbs. +- If Claude changes its rate-limit UI (e.g., adds a countdown instead of a menu), update the first `send-keys` accordingly. +- `tmux send-keys` injects literal keystrokes; if the pane has scrolled or lost focus, the keys may land in the wrong place. Consider pinning the pane or using `tmux select-pane` first. diff --git a/prompts/skills/continue-reminder/references/codex.md b/prompts/skills/continue-reminder/references/codex.md new file mode 100644 index 0000000..a754638 --- /dev/null +++ b/prompts/skills/continue-reminder/references/codex.md @@ -0,0 +1,28 @@ +# Codex CLI — Continue Reminder + +> **PLACEHOLDER** — This reference has not been populated yet because Codex CLI was not active in the originating session. + +## Known Differences from Claude + +| Aspect | Expected Behavior | +|--------|-------------------| +| Rate-limit screen | May differ; verify by capturing the tmux pane | +| Menu confirmation | May require `Enter` or a different key | +| Resume command | Likely **not** `continue`; inspect the prompt text | +| Session ID | Typically tied to a `codex` tmux session name | + +## TODO + +1. Capture a Codex rate-limit screen in a tmux pane and record: + - Exact prompt text + - Available options / key bindings + - Reset time format and timezone + - Correct resume command (e.g., `resume`, `go`, `y`, etc.) + +2. Update this file with a concrete example mirroring the Claude reference structure: + - Scenario + - Steps Taken + - Verification commands + - Key Details table + +3. Update `../SKILL.md` if Codex requires a fundamentally different approach (unlikely, but possible). diff --git a/prompts/skills/continue-reminder/references/opencode.md b/prompts/skills/continue-reminder/references/opencode.md new file mode 100644 index 0000000..f2fe7c7 --- /dev/null +++ b/prompts/skills/continue-reminder/references/opencode.md @@ -0,0 +1,30 @@ +# OpenCode Agent — Continue Reminder + +> **PLACEHOLDER** — This reference has not been populated yet because the OpenCode agent was not active in the originating session. + +## Known Differences from Claude + +| Aspect | Expected Behavior | +|--------|-------------------| +| Rate-limit screen | Unknown; OpenCode may throttle differently | +| UI paradigm | May be chat-based rather than menu-based | +| Resume command | Unknown; likely not `continue` | +| Integration | May run outside tmux (e.g., VS Code extension or standalone binary) | + +## TODO + +1. Identify how OpenCode signals a pause / rate limit: + - Does it print a message in the terminal? + - Does it spawn an interactive prompt? + - Is there a headless mode that behaves differently? + +2. If OpenCode runs in tmux, capture the pane state and record: + - Pause / limit indicator text + - Required keystrokes to acknowledge + - Resume command or hotkey + +3. If OpenCode runs outside tmux (e.g., via LSP or IDE), determine whether: + - `tmux send-keys` is still viable (IDE integrated terminal) + - An alternative IPC mechanism is needed (API, file watcher, signal) + +4. Update this file with a concrete example mirroring the Claude reference structure. |
