[FEATURE] Archive cloud sessions in bulk or programmatically (CLI / bulk UI / auto-archive on completion). Heavy --cloud users accumulate 90+ finished sessions

Status Open
Maintainer reply None cached
Activity 0 comments · opened Sep 26, 2026

Summary
We run Claude Code cloud sessions at scale: a local "coordinator" session dispatches work with claude --cloud, one session per task, and re-dispatches whenever a session needs another round. In 2 days this created 90+ active sessions in the sidebar. Most of them have finished (their PRs are merged or closed), and the only documented way to archive them is one at a time in the UI: hover, "⋯", "Archive".

What we tried

  • claude --help: there are --cloud, --teleport and -p … --cloud <id> (send a message), but no archive or close command.
  • The desktop app's session tool (archive_session) only sees local sessions. Given a cloud session_… id, it returns "not found".
  • Confirmed from inside a running cloud session (26/09): its only session-related tool is ListAgents (list and address sessions for messaging). There is no archive tool of any kind (no archive_session or equivalent, loaded or deferred).
  • The desktop setting "auto-archive when the PR closes" does not seem to cover cloud sessions that were superseded or that never opened a PR.

What would solve it (any one of these)

  1. claude --cloud-archive <session-id…> (or claude sessions archive …) in the CLI.
  2. Bulk selection plus "Archive" in the claude.ai/code sidebar.
  3. Auto-archive for cloud sessions: when their PR merges or closes, and/or after N days idle with no open PR.
  4. A way for a session to end itself when its task is done (for example an "archive on completion" option in claude --cloud).

Why it matters
Cloud sessions are meant for parallel, fire-and-forget work. Without a way to clean up, the sidebar grows every day, finished and active sessions get mixed together, and people stop using the feature at scale.

— Rafael (Rendizy), Claude Max plan, Claude Code desktop on Windows.

Related issues: #93988 (retention policy / auto-archive), #87877 (no way to clean up disconnected sessions on claude.ai), #91194 (cloud/routine sessions with no Archive). This one asks specifically for a programmatic or bulk way to archive cloud sessions (CLI, bulk UI, or auto-archive on completion).

View original on GitHub ↗