Context Save context-save
Save working context.
Use it when save progress, save state, save my work, context save. (gstack)
- Our test
- 8/10✓ Verified
- tested Dec 6, 2026
- GitHub stars
- 143k
- garrytan/gstack
- Added by
- 0
- members
- Updated
- Dec 6
- commit d08eb76
- Content
- 2 files
- no scripts · 10 KB
- License
- MIT
- free to use
What our test found
Le skill fournit un format de checkpoint concis et des garde-fous utiles contre les décisions obsolètes, mais son exécution dépend d’outils locaux non disponibles ici.
Limits spotted
- Actually saving depends on a local helper and writing tools; without them, the assistant can only draft the checkpoint.
- The procedure is very prescriptive and can be costly for a simple request.
- It says the temporary file must remain private without specifying its location or cleanup.
name: context-save preamble-tier: 0 version: 1.0.0 description: "Save working context. Use for: save progress, save state, save my work, context save. (gstack)" allowed-tools: - Bash - Read - Write - Glob - Grep - AskUserQuestion triggers: - save progress - save state - save my work - context save
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: bun run gen:skill-docs -->
/context-save — Save Working Context
Capture a lean ~20–30 line checkpoint (active decisions, reversals, open promises, minimal workspace state) in one fast pass so /context-restore resumes with zero stale decisions.
HARD GATE: Do NOT implement code changes. Capture state only.
Detect command
/context-saveor/context-save <title>→ Save (infer a 3–6 word title if omitted)/context-save listor/context-save list --all→ List/context-save resumeor/context-save restore→ reply:"Use /context-restore to resume — restoring is a separate skill."
Save flow
Write in one fast pass from session context — skip git diff --stat, git log, and directory dumps (run git status -sb only if branch or key modified files are not already in context).
Step 1: Draft the lean checkpoint (~20–30 lines)
## Working on: {3-6 word title}
### Active Decisions
- {Current binding decision, 1 line. On any change or reversal, REPLACE the old entry — never keep superseded choices here.}
### Reversals / Do-Not-Repeat
- ~~{Superseded approach or dropped choice}~~ -> {Current choice} ({short reason dropped})
### Open Promises / Next Step
1. Open. {Exact next step: concrete file, symbol, command, or pending deliverable} {(provenance marker)}
### Workspace
- Branch: `{branch}`
- Key files: `path/a`, `path/b`- Reversal hygiene: Replace changed entries in Active Decisions and log each dropped approach + reason in Reversals / Do-Not-Repeat so a returning session never regresses (
- None.only if none). - Decisions & file claims: Back any claim about a concrete file's contents with a read/grep/wc in this turn, or mark it
(path assumed)under Open Promises for restore to verify first. - Remaining Work provenance: Every item starts with
Open.(never[done]or[executed]) and ends with the first applicable English literal marker (Markers stay English literals — never translate; fix missing or invalid markers before saving): - Writing step (migration, sync, insert, import, mutating dialog):
(target state checked)|(code read)|(path assumed) - Concrete path (command, flag, config key/value, file/dir):
(path run)+ outcome |(path read)|(path assumed) - Otherwise: none (
Open.alone).
Step 2: Save and stamp in one call
Write the lean checkpoint markdown from Step 1 to a private temp file using the Write tool (so untrusted body text never enters a shell command), then pass that path to save --body-file. The helper derives the filename slug safely from ## Working on: in the body (never interpolate titles into the shell command), adds YAML frontmatter (status, branch, timestamp, session_duration_s, files_modified), stamps remote:, project_root:, worktree:, and head: (do not write remote:, project_root:, worktree: or head: yourself), carries forward open Active Decisions, Reversals / Do-Not-Repeat, and Open Promises / Next Step from the prior same-branch checkpoint on stub or non-code saves (pass --replace or --clear when prior items are resolved), publishes atomically without overwriting, and records a nested-repo pointer when CLAUDE_PROJECT_DIR differs:
# Bash-side title sanitize. Pass the raw title via TITLE_RAW when running this block.
~/.claude/skills/gstack/bin/gstack-context-checkpoint save --body-file "<the FILE path printed above>"Confirm in one line: Saved: {title} ({BRANCH}, {MODIFIED} modified) -> {FILE}. Restore with /context-restore.
List flow
Run one command (add --all when passed):
~/.claude/skills/gstack/bin/gstack-context-checkpoint listNO_CHECKPOINTS→"No saved contexts yet. Run /context-save to save your current working state."NO_CHECKPOINTS_ON_BRANCH→ say none on this branch and suggest/context-save list --all.NO_VERIFIED_CHECKPOINTS/IDENTITY_CHECK_FAILED→ report unverified (relayHIDDEN:).- Otherwise print a table (
#,Date,Title,Status;Branchfor--all) + anyHIDDEN:/TRUNCATED:.
Important Rules
- Never modify code. Append-only in
checkpoints/(helper guarantees collision-safe filenames). - Lean (~20–30 lines). Decisions, reversals, next steps, key files only — no narrative recaps or git log dumps.
- Infer, don't interrogate. Only ask via
AskUserQuestionif the title cannot be inferred. - Invoke via Skill tool —
/context-saveis a gstack skill, not a built-in.