agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/stash/SKILL.md

stash

Skill2 starsChanged 4 months agoMITView on GitHub

Save, restore, and manage work-in-progress with git stash — shelve uncommitted changes to switch context, then bring them back without losing work. Use when the user says "stash my changes", "shelve this work", "save my work in progress", "pop the stash", "I need to switch branches but have uncommitted changes", "restore my stashed changes", or "clean up my stashes".

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use a descriptive message: git stash push -m "<what this is>" so the entry is identifiable later — never an anonymous stash when several …

    line 25
  2. Very specific:

    Prefer git stash apply <ref> over pop when unsure — apply keeps the stash so a botched restore is recoverable.

    line 29
  3. Very specific:

    If applying may conflict (the branch moved on), say so first.

    line 31
  4. Very specific:

    Default to non-destructive actions: apply over pop, named saves over anonymous, and never drop/clear without explicit confirmation of which …

    line 37
  5. Very specific:

    Always give saved stashes a descriptive -m message, and target restores by explicit stash@{N} rather than assuming the top of the stack.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Working tree & stash state

!git status --short 2>/dev/null

!git stash list 2>/dev/null | head -20

!git branch --show-current 2>/dev/null

Instructions

Help the user shelve or restore work with git stash based on $ARGUMENTS. Stashing touches uncommitted work, so default to the non-destructive option and confirm before anything that can discard changes (drop, clear, or a conflicting pop).

Method

  1. Read the intent. Common cases: save current changes to switch context, restore (pop/apply) a previous stash, inspect what's in a stash, or clean up old stashes. If $ARGUMENTS is empty and there are local changes, assume they want to save; if the tree is clean and stashes exist, assume they want to restore.
  2. When saving:
    • Use a descriptive message: git stash push -m "<what this is>" so the entry is identifiable later — never an anonymous stash when several may pile up.
    • Include untracked files only when needed (-u/--include-untracked); warn that -a/--all also stashes ignored files and is rarely wanted.
    • To stash only some files, use a pathspec (git stash push -m "..." -- path/...) or --keep-index to keep staged changes in the tree.
  3. When restoring:
    • Prefer git stash apply <ref> over pop when unsure — apply keeps the stash so a botched restore is recoverable; pop deletes it on success. Reach for pop only once the right stash is confirmed.
    • Identify the target explicitly (stash@{N}) rather than assuming the top of the stack, especially when git stash list shows several.
    • If applying may conflict (the branch moved on), say so first; on conflict, resolve like a merge (see the resolve-conflicts skill) — and note that a failed pop leaves the stash intact.
  4. When inspecting: git stash show -p stash@{N} shows the diff; list with git stash list and map each entry to its branch/message before acting.
  5. When cleaning up: confirm exactly which entries before git stash drop stash@{N}. Treat git stash clear as destructive — it removes all stashes and is not part of normal undo. Always confirm explicitly, and mention entries linger in the reflog briefly if recovery is needed.

Rules

  1. Default to non-destructive actions: apply over pop, named saves over anonymous, and never drop/clear without explicit confirmation of which entries are affected.
  2. Always give saved stashes a descriptive -m message, and target restores by explicit stash@{N} rather than assuming the top of the stack.
  3. Warn before restoring onto a tree that has moved on (conflicts likely) and before stashing untracked/ignored files unless the user asked.
  4. A stash is not a backup — surface that dropped/cleared stashes are only briefly recoverable via the reflog, and prefer a commit for anything that must not be lost.
  5. End by showing the resulting git status --short and git stash list so the user can see exactly what was saved or restored.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.