SKILL.md--- name: coding-agent-sessions description: "Finds, reads, and reconstructs coding-agent sessions across Codex, Claude, OpenCode, OMO/Senpi, agy (Antigravity), omo-harness threads (agy, Claude Agent SDK, Codex app-server, omp, omo children) and 20 other local agent logs, through a typed TypeScript SDK. Use when asked to find or search past sessions, transcripts, or subagent runs, or to recover what an earlier session did." --- # Coding Agent Sessions Find local coding-agent sessions across agent products before answering from memory. The skill is a typed SDK on Bun (`scripts/sdk.ts`); the same operations run as a command line (`scripts/cli.ts`) and as an MCP server (`bun scripts/cli.ts mcp`). ## Start narrow `sessions.list`, `sessions.search` and `sessions.get` scan the stores of the sources they select, so **`source` is what makes them cheap**: one source reads one product's store, no source reads every store on the machine. `since`, `until`, `cwd`, `model` and `limit` filter what the scan found; they do not shrink the scan. Read a transcript as a slice with `transcript.read({ path: row.path })`, which opens that one file and nothing else; `sessions.get` returns every event. From a `js` eval cell or a bun script (`skillDir` is the folder holding this SKILL.md): ```js const { connect } = await import(`${skillDir}/scripts/sdk.ts`) const cas = connect() // 1. Recent work in one product: the cheapest useful call. const recent = await cas.sessions.list({ source: ["senpi"], since: "7d", limit: 10 }) // 2. Which session did X: two or three query lanes, one or two sources, a time window. const found = await cas.sessions.search({ source: ["claude", "codex"], query: ["dashboard PR", "대시보드"], since: "30d", limit: 5 }) // 3. Open the hit as a slice of its own file: the newest 8 KiB of whole events, with byte offsets. No scan. if (found.kind === "ok" && found.results[0]) { const hit = found.results[0] const tail = await cas.transcript.read({ path: hit.path, maxBytes: 8192 }) const head = await cas.transcript.read({ path: hit.path, from: "head", maxBytes: 4096 }) // the first prompt and setup } ``` The same calls from a shell: ```bash bun scripts/cli.ts sessions list --source senpi --since 7d --limit 10 bun scripts/cli.ts sessions search --source claude --source codex --query "dashboard PR" --since 30d --limit 5 bun scripts/cli.ts transcript read --path <row path> --max-bytes 8192 ``` Every SDK call answers `{ kind: "ok", ... }` or `{ kind: "error", error: { code, message, next_action } }` and never throws for a refusal. Act on `next_action`. The CLI prints the same JSON and exits non-zero on an error. ## What each call costs | Call | Reads | Use it for | |---|---|---| | `sources.list()` | nothing | source ids and aliases | | `sessions.list` / `sessions.search` with `source` | the newest 2,000 transcripts of each selected source, parsed whole | finding session