Skip to content

Add stash plugin: multi-slot message storage with push/pop/apply/list#29470

Open
leonardocardoso wants to merge 1 commit intoanthropics:mainfrom
leonardocardoso:plugin/stash
Open

Add stash plugin: multi-slot message storage with push/pop/apply/list#29470
leonardocardoso wants to merge 1 commit intoanthropics:mainfrom
leonardocardoso:plugin/stash

Conversation

@leonardocardoso
Copy link

@leonardocardoso leonardocardoso commented Feb 28, 2026

Summary

Adds a new plugin that provides git-stash-like message storage for Claude Code, addressing the limitations of the built-in Ctrl+S single-slot stash.

Fixes #26615
Related: #24776, #20068 (provides a workaround — messages persist to disk)

Motivation

The built-in Ctrl+S stash has three limitations reported across multiple issues (#26615, #24776, #20068, #20806):

  • Single slot — stashing again overwrites the previous stash
  • Not persisted to disk — lost on crashes, errors, or session changes
  • No history — no way to browse or select from multiple stashes

This plugin provides a proper stack persisted to ~/.claude/stash.jsonl.

Commands

Command Description
/stash <message> Push a message to the stash stack
/stash-pop Apply and remove the last stashed message
/stash-apply <id> Apply and remove a specific stash by ID
/stash-list List all stashed messages

Implementation

  • Storage: JSONL file at ~/.claude/stash.jsonl (one JSON object per line)
  • Runtime: Python 3 (pre-installed on macOS/Linux, consistent with hookify and security-guidance plugins)
  • Each command runs a single python3 -c invocation for atomicity

Testing

Tested all commands end-to-end:

  • Stash multiple messages, verify sequential IDs
  • List with truncation for long messages
  • Apply by ID, verify removal from stack
  • Pop last entry, verify removal
  • Edge cases: empty stash, non-existent ID, pop until empty

Git-stash-like message storage for Claude Code. Provides a proper stack
persisted to ~/.claude/stash.jsonl with push/pop/apply/list operations.

Addresses anthropics#26615 — the built-in Ctrl+S stash is single-slot and not
persisted to disk.

Related: anthropics#24776, anthropics#20068 (provides a workaround — messages persist to disk)

Commands: /stash, /stash-pop, /stash-apply, /stash-list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Improve stash reliability

1 participant