Snapshot

From mikeprasad/aria-knowledge · View interactive version

Snapshot is an AI agent skill from the GitHub repository mikeprasad/aria-knowledge. Save the current Claude Code transcript to the knowledge intake on demand. Use when user says '/snapshot', 'snapshot the session', 'save this conversation', 'capture the transcript', 'archive this session'. Same archival output as the pre-compact hook, but triggered explicitly. Distinct from /extrac

How to use this skill

Skill file

/snapshot — On-Demand Transcript Snapshot

Archive the current session's raw transcript to intake/pre-compact-captures/ for later review. This is the same artifact the pre-compact hook produces — just invoked by the user instead of waiting for compaction.

Runtime Gate (per ADR-094)

Canonical resolution: This is the Claude Code variant. When both plugin-claude-code and plugin-claude-cowork are loaded in the same session (most common in Claude Desktop), bare /snapshot resolves to this skill — aria-knowledge (Code) is the canonical owner of all 24 dual-port skills per ADR-094 §Part 1. The Cowork variant is namespaced-only: /aria-cowork:snapshot.

Before Step 0 — runtime self-correction. Check whether the Bash tool is available in this session. If Bash is NOT available (you are running in Claude Cowork or another non-Code runtime), this invocation reached the wrong variant for the runtime. Do not ask — redirect. Announce it in one line, then use the Skill tool to invoke aria-cowork:snapshot with the same arguments the user provided, and do not run this skill's steps:

↪️ Redirecting to /aria-cowork:snapshot — you invoked the aria-knowledge (Code) variant, but you are running in Claude Cowork or another non-Code runtime.

This variant requires Bash to run save-transcript.sh against ~/.claude/projects/{cwd-encoded}/{session-id}.jsonl — Cowork has neither shell access nor that transcript path. For the Cowork-native variant (uses 3-path source acquisition: transcript MCP → user-paste → Claude-recall fallback), use /aria-cowork:snapshot.

⛔ The redirect is unconditional — every mode including auto, and no opt-out. Reaching this variant under that condition is always a mis-invocation, so there is nothing for the user to decide. Design record: docs/superpowers/specs/2026-08-28-runtime-gate-auto-redirect-design.md (D2 auto-redirect, D3 no escape hatch, D6 announce-don't-swap-silently).

If Bash is available, proceed to Step 0.

When To Use This vs. /extract vs. /intake

/snapshot is intentionally orthogonal: it preserves the raw record so /extract (or a human review) can work from it later.

Step 1: Run The Helper

Execute:

bash "${CLAUDE_PLUGIN_ROOT}/scripts/save-transcript.sh" ${CLAUDE_SESSION_ID}

The script:

  1. Reads ~/.claude/aria-knowledge.local.md via config.sh — stops with a setup message if unconfigured.
  2. Locates this session's transcript by session id: $CLAUDE_CODE_SESSION_ID (set by Claude Code in Bash tool shells), then the id passed as the argument above, matched to ~/.claude/projects/<project>/<id>.jsonl. If an id is known but no transcript matches, it exits 1 and writes nothing — it never falls back to another session's file. Only when no id is available at all (older Claude Code) does it take the most recently written top-level transcript, and then it prints a ⚠ GUESSED line.
  3. Copies it to {knowledge_folder}/intake/pre-compact-captures/{YYYY-MM-DD}_{session-id-8-chars}.md.
  4. Prints the snapshot path, the source transcript path, and pointers to the two review paths — /extract for in-context synthesis now, or /audit knowledge which will review the snapshot at the next audit cycle via digest mode.

Step 2: Relay The Output

Print the script's stdout to the user verbatim. Do not paraphrase — the path and source filename are both useful for verification (see "Concurrent Sessions" below).

If the script exits non-zero, relay the stderr message. Common causes:

Rules

Concurrent Sessions

Concurrent Claude Code sessions are safe: the script copies the transcript whose filename is this session's id, not the most recently written one. (Before this, it picked the newest *.jsonl, which with several sessions live was often another session's — and it still reported success.)

If the output contains ⚠ GUESSED, no session id reached the script and it fell back to the newest transcript. Compare the Source: id with your own session; if they differ, relay that to the user and do not delete the captured file — it is a valid snapshot of another session that may have no other record. To capture the right one, copy ~/.claude/projects/<project>/<your-session-id>.jsonl to intake/pre-compact-captures/<YYYY-MM-DD>_<first-8-chars>.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.