UNRELEASED DEVELOPMENT SNAPSHOT · READ-ONLY EXCERPT
skills/context-save/SKILL.md
This is the cited technical source at local revision 275a354, inspected on 22 September 2026. It differs from the public release. This reference publishes only the cited sections, not an installable release or the development branch.
Line numbers refer to the complete recorded file. Uncited lines are omitted. Full-file SHA-256: ecfb867ad49df94b98ba9b148222ad2599bbf4d3986d71a1d0f42c22bc2a8d32.
1
---2
name: context-save3
layer: foundation4
description: Use before the context window fills up or before clearing the session to save the current state to a checkpoint file. Reach for it when a session is getting heavy and you want to preserve where you are so a later session can pick up exactly here.5
color: blue6
tools: Read, Write, Bash, Grep, Glob7
voice: internal8
cli_support: [claude-code]9
---11
# /context-save13
Save the current session's load-bearing state to a checkpoint file so a fresh session can resume cold. Use **before** context bloat hits productivity, OR when handing off to a teammate, OR when ending a session mid-task.15
## When to use… omitted uncited lines …
30
- Current branch via `git branch --show-current`31
- SLUG via `_context_repo_slug` from `bin/_context.sh` (native — basename of the repo root; no external binary)32
- Recent uncommitted work via `git status -s` + `git diff --stat HEAD`33
- Active TODOs (this skill's own TodoWrite state if available, else `.claude/plans/todo.md`)34
- Last 3 user turns (operator pastes them if not introspectable)36
- **Optional argument:** a short label describing the in-flight task (used as filename suffix, passed to `context_save_path` as `[label]`). `--label` covers the named-snapshot use case — the former standalone snapshot skill is folded into this one (its old name routes here via `config/aliases.yaml`).38
## Workflow40
1. Resolve slug + branch + timestamp.41
2. Compute the checkpoint path via the mechanical core (`bin/_context.sh` owns naming + directory creation; checkpoint CONTENT stays LLM-written):43
```bash44
source "${LINTEL_SOURCE_ROOT:-$LINTEL_REPO_ROOT}/bin/_context.sh" # fallback: "${LINTEL_SOURCE_ROOT:-$(git rev-parse --show-toplevel)}/bin/_context.sh"45
path=$(context_save_path [label])46
```48
`context_save_path` echoes `.claude/runtime/sessions/<branch>/<YYYYMMDD-HHMMSS>-<slug>[-<label>]-context-save.md` and creates the directory. The filename ends `-context-save.md` so `/context-restore` and `/context-warm-sessions` globs match.49
3. Gather:50
- **What the task is** — one-line description (operator-provided or inferred from recent turns).51
- **What got done** — bulleted from todo-list completed items + recent commit messages on this branch.52
- **What's in-flight** — active todo items + dirty git tree summary.53
- **What's next** — top 1-3 next steps.54
- **Decisions taken** — surface any AskUserQuestion answers from the session (operator-noted).55
- **Failed attempts** — patterns/approaches tried that didn't work (so next session doesn't re-try).56
- **Files touched** — `git diff --name-only HEAD` + any uncommitted-but-staged files.57
4. Write the checkpoint content to `$path` with this structure:… omitted uncited lines …
110
```111
✓ Checkpoint saved112
Path: <full path>113
Size: <bytes>114
Resume: /context-restore <path>115
```117
## Edge cases119
- **No git repo:** still save, but `branch` field is `no-git`. Slug derived from cwd basename.120
- **No `.claude/runtime/sessions/<branch>/`:** `context_save_path` creates it.121
- **Existing checkpoint with same timestamp:** suffix with `-2`, `-3`, etc. Never overwrite.122
- **Operator pastes recent turns inline:** capture them verbatim under a `## Recent turns (operator-pasted)` section.124
## Compliance integration126
This skill writes a checkpoint outside the committed tree (to the gitignored `.claude/runtime/sessions/`). Per Lintel Layer 2:127
- The checkpoint file may contain references to in-flight work that touched files in the repo. Operator confirms NO customer-data is captured in the checkpoint before saving.128
- Default sanity-grep before write: if the checkpoint text matches secret-shaped patterns, halt and surface to operator.130
## Failure modes132
- **Write fails (disk full / permission denied):** report error, print checkpoint content to stdout so operator can copy it manually.133
- **Slug resolution fails:** fall back to `unknown-project`.