<< All versions

Skill v1.0.0

currentLLM-judged scan90/100
regression-io/claude-config-plugins/flush
──Details
PublishedOctober 21, 2026 at 05:26 PM
Content Hashsha256:904a4b875ce78a3a...
Git SHA73c85930b9c3
──Files
Files (1 file, 2.8 KB)
SKILL.md2.8 KBactive
SKILL.md · 83 lines · 2.8 KB

version: "1.0.0" name: flush description: Save current session context to a resumable document. Use when ending a session, switching tasks, or wanting to preserve context for later continuation.


Flush Context to Resumable Doc

Save all current session context to a per-session file .claude/session-context.<session-id>.md for seamless continuation. Per-session naming means parallel sessions never overwrite each other's flush.

When to Use

  • Ending a work session
  • Switching to a different task
  • Before a long break
  • When context is getting complex and you want a checkpoint
  • User says "save context", "flush", "checkpoint", or similar

Process

Step 1: Pick the .claude Directory (anchor to the project root)

  1. Run git rev-parse --show-toplevel from the cwd. If it succeeds, use <repo-root>/.claude/.
  2. If cwd is not in a git repo, use <cwd>/.claude/ (the "working directly in ~" case → ~/.claude).
  3. Create the dir if it doesn't exist — no prompt, the location is deterministic. Do not offer /init. Print the resolved absolute path so the location is never a surprise.

Do not walk up the tree looking for an ancestor .claude/: that made flush drift into the nearest ancestor (including the global ~/.claude config dir) instead of the project you're working in.

Step 2: Create Session Summary

Summarize the session:

SectionContent
Task SummaryWhat the user asked for
Current Statecompleted / in-progress / blocked
Key DecisionsImportant choices and rationale
Files ModifiedWhat was created/changed
Pending WorkWhat still needs to be done
Important ContextCritical info for continuation

Step 3: Write to File

Resolve the session id (printenv CLAUDE_CODE_SESSION_ID) and write to .claude/session-context.<session-id>.md in the chosen directory. If the env var is empty, fall back to the legacy global name .claude/session-context.md.

Then reap stale resume prompts (per-session files older than 14 days; the glob skips the legacy global file and won't touch the one just written):

bash
find "<chosen-dir>/.claude" -maxdepth 1 -name 'session-context.*.md' -type f -mtime +14 -delete

Output Format

markdown
# Session Context - YYYY-MM-DD
## Task Summary
[What the user wanted to accomplish]
## Current State
**[status]**
[Brief description]
## Key Decisions
-**[Decision]**: [Rationale]
## Files Modified
-`path/to/file` - [what changed]
## Pending Work
-[ ] Task 1
-[ ] Task 2
## Important Context
[Critical information for continuation]

Notes

  • Resume a saved context with /unflush, which finds the right per-session file (preferring the current session id, else the most recent) and acts on it
  • Keep summaries concise but complete enough to resume without re-reading code
  • Focus on the "why" not just the "what"
All versions