Feature request: lightweight session archive for `claude --resume` (no background process involved)

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Jul 1, 2026 · closed Jul 1, 2026

Sessions under ~/.claude/projects/<workspace-slug>/*.jsonl just accumulate forever — there's no sessions subcommand and no flag to hide old/finished ones from the --resume picker (checked claude --help, confirmed nothing exists today).

The desktop app already has an "archive" action, but it solves a different, heavier problem: each desktop conversation tab keeps a persistent background process (and possibly a worktree) alive, so its archive has to stop that process and clean up the worktree before it can hide the session. That's implemented via an MCP tool (archive_session) injected by the desktop shell.

Bare CLI doesn't have that problem — there's no persistent background process per session to manage; the process just ends when you exit the terminal. So a CLI-native archive doesn't need any of that machinery. It only needs to solve list hygiene:

Minimal proposal:

  • claude --resume gains a way to mark a session archived — either (a) move <id>.jsonl into ~/.claude/projects/<workspace-slug>/archive/, or (b) leave the file in place and record archived ids in a small sidecar index (e.g. .archived.json) in the same folder.
  • The default --resume picker skips archived sessions; a flag (e.g. --resume --include-archived) shows them.

This is purely local session-listing logic — no MCP server, no IPC bridge, no process management required. Wanted to flag the actual minimal scope explicitly, since it's much smaller than feature-parity with the desktop app's archive button.

View original on GitHub ↗

3 Comments

github-actions[bot] · 3 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/65615
  2. https://github.com/anthropics/claude-code/issues/72214
  3. https://github.com/anthropics/claude-code/issues/69639

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Pual-Xiao · 3 months ago

Duplicate of #65615 — closing per the bot's suggestion, upvoted the existing request there instead.

github-actions[bot] · 1 month ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.