---
name: resume-any-chat
description: Use when the user wants to inspect, search, normalize, resume, hand off, or optionally import local Codex, Claude, or Antigravity CLI conversation history. This plugin skill wraps the local viewer, provider-specific parsers, native resume commands, a Codex handoff flow, and an explicit experimental Codex-history import path.
---

# Resume Any Chat

Use this plugin skill for local multi-provider chat history work across the current user's home directory:

- `Codex` from `.codex/sessions`
- `Claude` from `.claude/projects` plus `.claude/history.jsonl`
- `Antigravity` from `.gemini/antigravity-cli/brain/*/.system_generated/logs`

## Workflow

1. Default to listing useful recent sessions directly in-chat.
Show recent `Codex`, `Claude`, and `Antigravity` sessions first unless the user already named a provider/session.
The default professional list format is:
- recent `10`
- per item show:
  - `id`
  - `title`
  - `last message`
- then show exactly these next actions:
  - `Continue in Codex`
  - `Continue Native`
  - `Summarise`
  - `Import into Codex History (Experimental)`
- if session `cwd` and current workspace differ, say that briefly and suggest the safer option
- stop there unless the user explicitly picks one of those actions

2. Refresh/export the current index:

```bash
node ../../runtime/cli.js export
```

3. Useful commands:

```bash
node ../../runtime/cli.js latest
node ../../runtime/cli.js latest claude --limit 15
node ../../runtime/cli.js session claude <session-id>
node ../../runtime/cli.js handoff antigravity <session-id>
node ../../runtime/cli.js import-history claude <session-id>
```

Command mapping:
- `show all history`
- `show history`
- `list history`
- `show recent`
- `show me all history`

For any of the above, you must run:

```bash
node ../../runtime/cli.js latest
```

If the user names a provider, you must run:

```bash
node ../../runtime/cli.js latest <provider>
```

4. Launch the local 3-tab viewer:

```bash
node ../../runtime/cli.js serve
```

5. Use the built-in flows:
- Native resume:
  - `codex resume <session-id>`
  - `claude --resume <session-id>`
  - `agy --conversation <session-id>`
- Cross-provider continuation:
  - create a Codex handoff file
  - launch a fresh Codex session from that handoff
- Experimental import:
  - only when the user explicitly chooses `Import into Codex History (Experimental)`
  - import a foreign session into Codex history without replacing the safer default flows

## Rules

- Do not treat foreign-session import as the default continuation path.
  - prefer native resume or Codex handoff first
  - use experimental Codex-history import only after explicit user choice
- Do not read Antigravity token-monitor/auth cache unless the user explicitly asks for that risk.
- Prefer `transcript_full.jsonl` for Antigravity when available.
- If no trustworthy `cwd` exists, do not auto-launch the foreign CLI.
- `show session <provider> <id>` should include recent turns by default.
  - default: show the overview plus last `5-8` meaningful messages
  - `verbose`: include more context, including thinking/tool lines when useful
- If the user says `continue here`, do not push them into an external resume flow first.
  - run `handoff <provider> <session-id>` without `--launch`
  - use that summary and handoff file to continue inside the current Codex thread
- Never auto-resume, auto-handoff, auto-summarise, or auto-open anything immediately after listing.
  - listing is one step
  - action happens only after the user explicitly chooses it
- `Import into Codex History (Experimental)` is opt-in only.
  - add it as a selectable action
  - do not use it unless the user explicitly chooses it
- Do not answer `show all history` by describing, linking, or summarizing `state.json`.
  - `state.json` is an internal cache/export artifact
  - mention it only if the user explicitly asks for raw JSON, export files, cache debugging, or file paths
- For `show all history` and similar list requests, return the direct `latest` output itself.
  - do not replace it with totals-only summaries
  - do not ask for `provider + session id` before showing the actual list
- If the session already has a clear unfinished task, continue that task directly instead of ending with `If you want, I can...`
  - ask only if the next task is ambiguous or risky
- The rule above applies only after the user has already chosen `Continue in Codex` or equivalent.
- Do not invent a different menu or a generic conversational close.
  - follow the list-first flow above
  - avoid endings like `If you want, I can...` when the user already asked to continue
- Avoid rigid command-only replies.
  - accept natural requests such as `show me more Claude`, `continue the latest Antigravity here`, `open viewer`, `resume this Codex session`
