Agent skill
stash
This skill should be used when the user asks to "stash with session", "save work for later session", "link stash to session", "find stash by session ID", or "restore session stash". Saves git changes associated with Claude Code session ID for later retrieval.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/stash
SKILL.md
Stash Session
Save git changes to stash with Claude Code session ID for later retrieval and session continuity.
Purpose
Link git stash entries to Claude Code sessions. When resuming work, find the exact stash associated with a previous conversation.
Message Format
claude:[session_id] [user_message]
Example: claude:abc123de My feature work in progress
Operations
Save (Default)
Stash current changes with current session ID tag.
Current Session ID: ${CLAUDE_SESSION_ID}
Workflow
-
Call AskUserQuestion to collect stash message:
- Prompt: "Enter a description for this stash (optional):"
- Default to "WIP" if empty
-
Execute stash:
bashgit stash push -m "claude:${CLAUDE_SESSION_ID} [message]" -
Confirm success with stash reference.
List
Show stash entries for a specific session or all claude-tagged stashes.
Workflow
-
Call AskUserQuestion:
- Prompt: "Enter Session ID to filter (leave empty for all claude stashes):"
-
Execute based on input:
bash# All claude stashes git stash list | grep "claude:" # Specific session git stash list | grep "claude:[session_id]" -
Present results as table: | Index | Session ID | Message | Date |
Pop
Restore stash by session ID.
Workflow
-
Call AskUserQuestion:
- Prompt: "Enter the Session ID to restore:"
-
Find matching stash:
bashgit stash list | grep "claude:[session_id]" -
If multiple matches, call AskUserQuestion with options list.
-
If single match, apply:
bashgit stash pop stash@{n} -
Report restored files.
Drop
Remove stash by session ID (irreversible).
Workflow
-
Call AskUserQuestion:
- Prompt: "Enter the Session ID to drop:"
-
Find and display matching stash.
-
Call AskUserQuestion for confirmation:
- Prompt: "Confirm drop stash@{n}? (yes/no)"
-
Execute only on explicit "yes":
bashgit stash drop stash@{n}
Session ID Format
- Save: Uses
${CLAUDE_SESSION_ID}(full UUID, e.g.,02349458-8910-4228-b931-ac9f0c83081e) - List/Pop/Drop: Accepts both full UUID and short hash (first 8 characters)
Notes
- Stash includes untracked files by default (
-uflag available) - Multiple stashes per session allowed
- Empty working directory: stash command will fail gracefully
- Full UUID enables direct matching with session files in
~/.claude/projects/
Didn't find tool you were looking for?