| name | compress |
| description | Snapshots session work state into per-stream handoff files under .wisci/handoff/ so a fresh session can resume exactly where this one stopped. Use when ending a session, switching to other work, saving progress before context runs out, or after a context compaction. |
| argument-hint | [stream name] (optional — omit to match or create streams automatically) |
| allowed-tools | Read Write Edit Glob Grep Bash(git *) Bash(python3 *) |
| compatibility | Requires git and python3 (bundled wisci.py script) |
/compress — Session Handoff Snapshots
Capture everything a fresh session needs to resume the current work. Each independent work stream gets its own file in .wisci/handoff/ — one writer per stream, so snapshots from different sessions never clobber each other. An index (.wisci/handoff.md) is regenerated by script, never written by hand.
Boundary: /compress stores work state (goal, progress, next steps). Reusable knowledge (research results, architecture notes, decisions worth keeping after the work ships) belongs in /write. If the session produced knowledge, tell the user to run /write <topic> — do not bury it in a handoff.
Current state
Timestamp: !date '+%Y-%m-%d %H:%M'
Existing handoff streams:
!python3 "${CLAUDE_PLUGIN_ROOT}/scripts/wisci.py" index --list
If the streams listing above shows an error or an unexpanded variable, run the bundled script manually: it is at scripts/wisci.py relative to this skill's directory. Run python3 <that path> index --list with Bash.
Execution Flow
-
Identify work streams. Review the session and list the independent streams of work it contains (usually one). A stream is work that would be resumed as a unit.
-
Match streams to leaves. Compare each session stream against the existing streams listed above (slug + goal):
- Clear match — this session continued that stream: update its leaf.
- No match — new leaf. Derive a slug from the stream's goal (kebab-case, lowercase, max 4 words). Never derive slugs from dates or branch names.
- Ambiguous match — create a new leaf. A fragmented stream is cheap to merge later; a wrongly merged one loses state. When creating due to ambiguity, mention the similar existing stream in your report.
- If
$ARGUMENTS names a stream, use it verbatim as the slug and skip matching.
-
Write each leaf to .wisci/handoff/<slug>.md (create directories as needed) using the leaf format below.
- Union snapshot within the stream: capture the stream's full current state — including still-open items carried from the existing leaf — not just this session's delta.
- Never touch leaves for streams this session did not work on.
- A stream that finished: set
status: done. A stream waiting on something external: status: blocked and name the blocker.
-
Regenerate the index. Run python3 "${CLAUDE_PLUGIN_ROOT}/scripts/wisci.py" index (or the relative-path fallback above). Never edit .wisci/handoff.md directly.
-
Report. For each leaf: path, created or updated, stream status. If the session spanned multiple streams, note: "Split across N streams — resume any one with /select ." Suggest starting a fresh session and running /select to reload.
Leaf Format
---
status: active # active | blocked | done
updated: <timestamp from above>
goal: <one-line goal of this stream>
---
# Handoff: <stream summary>
## Completed
- <change: file path, what changed, why>
## In Progress
<Partially done work and its exact current state>
## Next Steps
1. <Immediate next action>
2. <Following action>
## Blockers / Open Questions
- <Unresolved issues; empty section may be omitted>
## References
- `src/auth/middleware.ts` — modified, added token refresh logic
- `src/auth/session.ts:42` — session expiry config, relevant to next steps
The frontmatter drives the generated index — keep status, updated, and goal accurate on every write. ## References is always the last section; each entry gets a one-line annotation. This manifest powers staleness detection when /select loads the leaf.
Preservation Rules
Compression is intentionally lossy — summarize verbose exploration, dead ends, and raw tool output. Always preserve what a fresh session would otherwise re-discover:
- File paths modified or relevant to resuming, with line numbers where they matter
- Decisions made and their rationale
- Error messages, error codes, and root causes identified
- Exact endpoints, API routes, configuration values discovered
- Names of functions, classes, modules changed or next to change
- Current state of in-progress work (what is done, what is not)
Never reduce specifics to vague summaries. "The 401 from /api/auth/login was caused by an expired Redis session store" must not become "configuration problems". When you drop bulky detail, keep its pointer (file path or URL) so it can be restored on demand.
Key Constraints
- Each leaf is the current state of one stream, not a history — git preserves old versions.
- Leaves for untouched streams are never modified, merged, or deleted by this skill.
- The index is script-generated only. With fewer than 2 streams the script removes it — that is expected.
done leaves may be deleted once committed; suggest this in the report when marking a stream done.
- Results go to
.wisci/handoff/ only.