memorylisted
Install: claude install-skill shekohex/dotai
# OpenCode Memory
Read-only access to local OpenCode history through the `opencode` CLI.
Use this skill only for OpenCode local history on this machine. Not for ChatGPT history, Claude cloud history, browser history, or external memory tools.
## When to Use
- Resume work and recover prior session context.
- Check what was discussed previously about a repo, bug, feature, or plan.
- Search past OpenCode conversations for a topic or decision.
- List projects or recent sessions stored by OpenCode.
## Do Not Use
- Fresh tasks where current files or git history already answer the question.
- Anything unrelated to OpenCode local history.
## Command Surface
Run `opencode db --help` first if you need to confirm the current CLI behavior.
- `opencode db path` prints the active database path.
- `opencode db "<SQL>"` runs a query directly.
- `--format json` is better when you want structured output.
- Default output format is `tsv`.
## Relevant Tables
- `project`: tracked worktrees
- `session`: sessions; `parent_id IS NULL` means top-level session
- `message`: message metadata; `json_extract(data, '$.role')`
- `part`: message content; `json_extract(data, '$.type') = 'text'`
- `todo`: saved todos for a session
Use `datetime(col/1000, 'unixepoch', 'localtime')` for readable timestamps.
## Queries
### Quick summary
```bash
opencode db "
SELECT 'projects' AS metric, COUNT(*) AS count FROM project
UNION ALL SELECT 'sessions_main', COUNT(*) FROM session WHERE parent_id IS NUL