Session Sweep

    1

    Detect a Claude Code update and safely cycle stale cmux-hosted sessions (idle now; busy via interrupt-or-wait).

    $10

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    session-sweep

    Example session with this skill installed

    A new Claude Code version is out. Sweep the open cmux sessions. Preview with a dry run first, then cycle the idle stale panes. Ask me before interrupting a busy one.

    • Read your context and instructions
    • Compiled the session-sweep

    Protocol lines from sweep.sh (interactive). Report these counts. Do not invent a cycle that did not print.

    CYCLED <surface_id>
    GRACE <surface_id>
    INTERACTIVE_PROMPT <surface_id>
    CYCLE_FAILED <surface_id>
    
    LineAgent action
    CYCLED <surface_id>Done for that pane. Verified back up on the new version.
    CYCLE_FAILED <surface_id>Pane was respawned but did not come back in the verification window. Tell the user to look manually. Do not report it as updated.
    GRACE <surface_id>Stale and idle, still inside the idle grace window (default 15 min, SWEEP_GRACE_SECONDS). No action.
    CYCLE <surface_id>Dry-run preview only (sweep.sh --dry-run). Nothing was cycled.
    INTERACTIVE_PROMPT <surface_id>Busy and stale. Ask Wait vs Interrupt. On Interrupt, run sweep.sh --force-cycle=<surface_id> and check the exit status. Non-zero with FORCE_CYCLE_FAILED means no resume command was found.

    Order: handle every other surface first, report the counts to the user, then optionally self-refresh this driver last via self-cycle /self-refresh. Skip that refresh if the driver is mid-task, a /goal is in flight, or background monitors still need to report.

    If stdout looks empty, read state/last-sweep.log. Output filters can hide the protocol lines; prefer rtk proxy.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    session-sweep

    Check for a Claude Code update and safely cycle open cmux-hosted sessions still on an older version. Idle sessions restart in place (same pane, same conversation via cmux's tracked resume). Busy sessions get an interrupt-or-wait choice.

    Canonical repo: https://github.com/chendrizzy/session-sweep
    Install: npx skills add chendrizzy/session-sweep

    The engine is sweep.sh in that repo (with sweep.bats). This listing is the operating procedure. It does not inline the script.

    Companion: self-cycle (https://github.com/chendrizzy/self-cycle) for refreshing this driver session last.

    When to use

    • User asks to update Claude Code sessions, refresh stale sessions, or mentions a new Claude Code version.
    • Fleet of cmux panes; some still running an older claude binary.
    • Preview: sweep.sh --dry-run before enabling any LaunchAgent.

    When not to use

    • Not on cmux — same hard dependency as self-cycle; no tmux/iTerm fallback.
    • Background-agent surfaces (cmux cannot respawn/restore those).
    • Looping --force-cycle across many surfaces (each call re-runs claude update and serializes on the lock) — cycle one, confirm, then next.
    • Refreshing your own driver mid-sweep — that must be last, via self-cycle /self-refresh, and skipped if mid-task / /goal / pending monitors.
    • Trusting a missing version banner alone — verify with process age (etime).

    Permissions

    NeedWhy
    sweep.sh + bashEngine
    rtk proxy (recommended)Prevents output filters from hiding protocol lines
    cmux with workspace-scoped respawnCycle panes in other workspaces
    claude updateVersion bump + lock
    AskUserQuestionBusy stale sessions
    Writable state / logsstate/last-sweep.log, optional LaunchAgent log

    Expected output

    Run interactive mode:

    rtk proxy ~/.claude/skills/session-sweep/sweep.sh --mode=interactive
    

    If stdout looks empty, read state/last-sweep.log (mirrored each run).

    LineAgent action
    CYCLED <surface_id>Done for that pane
    CYCLE_FAILED <surface_id>Tell user to look manually — do not claim updated
    GRACE <surface_id>Waiting out idle grace; no action
    CYCLE <surface_id>Dry-run preview only
    INTERACTIVE_PROMPT <surface_id>AskUserQuestion Wait vs Interrupt; on Interrupt run --force-cycle=<id> and check exit status

    Order: handle all other surfaces first, report to the user, then optionally self-refresh this driver via self-cycle.

    Install / enable notes (honest)

    Scheduled LaunchAgent must not exec through an external-volume symlink (launchd EX_CONFIG). Prefer a plist that runs /bin/bash <script> and logs under ~/Library/Logs/. Leave enable/disable to the operator.

    Requires cmux. Not compatible with tmux or iTerm. Cannot refresh background-agent surfaces. Each cycle call serializes on the claude update lock.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Requires

    cmux
    macOS
    bash
    Node.js

    Permissions

    Terminal / Shell
    Write Files
    Read Files

    Runs sweep.sh, reads cmux session state, and writes state/last-sweep.log. claude update takes the single-instance lock. Busy panes need an interrupt-or-wait choice before --force-cycle.

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    It cycles idle stale cmux panes in place and asks before interrupting a busy one. You still report the protocol lines. It does not replace looking at a pane that prints CYCLE_FAILED.

    No. It requires cmux, the same hard dependency as self-cycle. There is no tmux or iTerm path.

    Interactive mode prints INTERACTIVE_PROMPT for a busy stale pane and waits for Wait vs Interrupt. It does not interrupt on its own. A dry run only prints CYCLE lines and changes nothing.

    This listing is the operating procedure. sweep.sh and sweep.bats install from https://github.com/chendrizzy/session-sweep (`npx skills add chendrizzy/session-sweep`). self-cycle is a separate companion and is not included.

    The sweep is meant to be run interactively. A LaunchAgent is optional and left to the operator. launchd fails with EX_CONFIG if the job runs through an external-volume symlink; exec /bin/bash and log under ~/Library/Logs/.

    New in Workflow Automation