snapshot · diff
git:20260524.8acc86a to git:20260524.cafe2bc
21 added, 26 removed. Audit B to B.
---
- description: "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 /extract (which synthesizes knowledge) and /clip (which captures a URL or snippet)."
+ description: "Save the current Antigravity 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 canonical pre-compact hook, just triggered explicitly (Antigravity has no PreCompact event). Distinct from /extract (synthesizes knowledge) and /clip (URL/snippet)."
---
- # /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.
+ # /snapshot — On-Demand Transcript Snapshot (Antigravity)
- ## Runtime Gate (per ADR-094)
+ Archive the current Antigravity conversation transcript to `intake/pre-compact-captures/` for later review. The mechanism differs from the Claude Code variant: Antigravity puts the conversation transcript at a single known path delivered via hook stdin (`transcriptPath`), not in a per-cwd directory of jsonl files.
- **Before continuing:** Check that `Bash` is available. If `Bash` is NOT available (e.g., Cowork), surface:
+ ## How the transcript is located
- > ⚠️ **Runtime mismatch — you invoked aria-knowledge's `/snapshot` from a non-Code runtime.**
- >
- > This variant requires Bash to run `save-transcript.sh` against `~/.gemini/antigravity/transcripts/{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`.
- >
- > Proceed with the aria-knowledge variant anyway? (`y` / `n`)
+ The `aria-pre-invocation` hook (fires before every model call) caches `transcriptPath` from its stdin payload to `~/.gemini/antigravity/.last-transcript-path`. This skill reads that cache.
- Wait for `y` / `yes`. **Gate applies even in `auto`** (ADR-094 §Part 3). If `Bash` is available, proceed.
+ If the cache doesn't exist yet, the most likely cause is that the agent hasn't completed a model call in this session — `transcriptPath` only becomes available once the pre-invocation hook has fired at least once. Solution: have the agent respond to one message first, then re-run `/snapshot`.
- ## When To Use This vs. /extract vs. /clip
+ ## When to use this vs. /extract vs. /clip
- **/snapshot** — raw archive, no synthesis. Use before switching context, before a risky operation, or any time you want the full conversation preserved.
- **/extract** — synthesizes knowledge from the current conversation into backlogs/ideas. Use when you want captured *insights*, not the full transcript.
- **/clip** — saves a single URL or snippet. Unrelated to session transcripts.
`/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
+ ## Step 1: Run the Helper
Execute:
```
bash ${CLAUDE_PLUGIN_ROOT}/bin/save-transcript.sh
```
- The script:
+ The script (port-specific behavior):
1. Reads `~/.gemini/antigravity/aria-knowledge.local.md` via `config.sh` — stops with a setup message if unconfigured.
- 2. Locates the current session's transcript by picking the most recently modified `*.jsonl` under `~/.gemini/antigravity/transcripts` (fractional-second mtime, to disambiguate concurrent Claude Code windows).
- 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.
+ 2. Reads `~/.gemini/antigravity/.last-transcript-path` to locate the current conversation transcript. If the cache file doesn't exist, exits with a clear "no transcript cached yet — let the pre-invocation hook fire first" message.
+ 3. Copies the transcript to `{knowledge_folder}/intake/pre-compact-captures/{YYYY-MM-DD}_{conversationId-8-chars}.md` (using the conversationId from the transcript itself, or falling back to a timestamp).
+ 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.
- ## Step 2: Relay The Output
+ ## 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).
+ Print the script's stdout to the user verbatim. The path and source filename are both useful for verification.
If the script exits non-zero, relay the stderr message. Common causes:
- `aria-knowledge is not configured` → user needs to run `/setup`
- `Knowledge folder not found` → folder was moved or deleted; `/setup` repairs it
- - `No transcript file found` → shouldn't happen in a live session; surface it verbatim
+ - `Transcript cache not found at ~/.gemini/antigravity/.last-transcript-path` → pre-invocation hook hasn't fired yet (let the agent respond once, then re-try) OR the hook is disabled (check Customizations panel)
+ - `Transcript file not found at <path>` → cache points to a file that no longer exists; the conversation may have been compacted or moved
## Rules
- - **Bypasses `auto_capture`.** The `auto_capture` config key scopes to hook-driven auto capture. `/snapshot` is explicit user intent and always runs regardless of that flag.
- - **Overwrites same-session repeats.** Re-running `/snapshot` in the same session and date overwrites the previous snapshot (same `{date}_{sid8}.md` filename). This matches the pre-compact hook behavior. If you need multiple snapshots, copy the file aside manually before re-running.
- - **One invocation, one file.** No arguments, no options. The script picks the transcript; the user verifies via the output path.
+ - **Bypasses `auto_capture`.** The `auto_capture` config key in the canonical port scopes to the pre-compact hook (which doesn't exist in Antigravity). `/snapshot` is explicit user intent and always runs.
+ - **Overwrites same-conversation repeats.** Re-running `/snapshot` in the same conversation overwrites the previous snapshot (same `{date}_{conv-id-8}.md` filename). If you need multiple snapshots, copy the file aside manually before re-running.
+ - **One invocation, one file.** No arguments, no options.
- ## Concurrent Sessions
+ ## Antigravity vs. Claude Code parity note
- If you have multiple Claude Code windows open on the same machine, the script picks the most-recently-written transcript. In practice this is the window you invoked `/snapshot` in, because the tool call itself just wrote to that file. The source path is shown in the output so you can verify the right session was captured. If it picked the wrong one, the fix is to run `/snapshot` again from the intended window after a small new interaction (to make that session's transcript the newest).
+ In Claude Code, `/snapshot` walks `~/.claude/projects/{cwd-encoded}/*.jsonl` and picks the most-recently-modified file — this distinguishes concurrent windows. In Antigravity, each workspace has one persistent `transcript.jsonl` so the disambiguation isn't needed; the cached transcriptPath always points to *this* conversation's transcript.