skills/opencode-conversation-recall/SKILL.md
Find and inspect past OpenCode conversations stored in the local SQLite database. Use when the user asks to recall, search, find, or review a previous conversation, or asks "what did we talk about", "find that conversation where...", "show me past sessions", or any request to look up prior chat history.
npx skillsauth add 0xrichardh/agent-skills opencode-conversation-recallInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Query the OpenCode SQLite database to find and display past conversations.
Run queries via the opencode db CLI:
# Run a query (tsv is default and most token-efficient)
opencode db "SELECT ..."
# Get the database file path
opencode db path
session table (conversations)| Column | Type | Description |
|--------|------|-------------|
| id | text PK | Session ID (e.g. ses_...) |
| project_id | text | Project this session belongs to |
| directory | text | Working directory |
| title | text | Conversation title |
| time_created | integer | Creation timestamp (ms epoch) |
| time_updated | integer | Last update timestamp (ms epoch) |
message table| Column | Type | Description |
|--------|------|-------------|
| id | text PK | Message ID |
| session_id | text FK | References session.id |
| data | text | JSON: {role, time: {created, completed}, ...} |
part table (message content)| Column | Type | Description |
|--------|------|-------------|
| id | text PK | Part ID |
| message_id | text FK | References message.id |
| session_id | text | Session ID |
| data | text | JSON: {type, text, ...} |
| time_created | integer | Timestamp (ms epoch) |
Only parts with json_extract(data, '$.type') = 'text' contain conversation text. The text content is in json_extract(data, '$.text').
When the user asks to find a conversation, search the part table for matching text and group by session:
SELECT
p.session_id,
s.title,
s.directory,
datetime(s.time_created / 1000, 'unixepoch', 'localtime') as created,
COUNT(DISTINCT p.message_id) as matching_messages
FROM part p
JOIN session s ON s.id = p.session_id
WHERE json_extract(p.data, '$.type') = 'text'
AND json_extract(p.data, '$.text') LIKE '%SEARCH_TERM%'
GROUP BY p.session_id
ORDER BY s.time_updated DESC
LIMIT 10
SELECT
s.id,
s.title,
s.directory,
datetime(s.time_created / 1000, 'unixepoch', 'localtime') as created,
datetime(s.time_updated / 1000, 'unixepoch', 'localtime') as updated
FROM session s
ORDER BY s.time_updated DESC
LIMIT 20
Once a session is identified, retrieve the full conversation text in order:
SELECT
json_extract(m.data, '$.role') as role,
json_extract(p.data, '$.text') as text
FROM part p
JOIN message m ON m.id = p.message_id
WHERE p.session_id = 'SESSION_ID'
AND json_extract(p.data, '$.type') = 'text'
ORDER BY json_extract(m.data, '$.time.created') ASC
--format tsv (the default) to minimize token usage. Use --format json only when structured parsing is strictly required.LIKE '%term%' with COLLATE NOCASE for case-insensitive matching.datetime(ts / 1000, 'unixepoch', 'localtime').tools
Load when the user wants to call MCP tools, list MCP servers, manage MCP configuration, or interact with Model Context Protocol servers. Triggers include 'call MCP', 'list MCP servers', 'mcporter', 'MCP tool', 'run MCP', 'configure MCP'. Also load for ad-hoc MCP calls, OAuth setup, or code generation from MCP servers.
development
Load when the user needs web search, code examples, company intel, people lookup, or current information. Use for queries like 'search for', 'look up', 'find', 'what's the latest on', 'research company', 'code examples for'. Does not require a browser.
development
Load when the user wants to create, update, or refactor an agent skill, improve skill routing, split overlong skill instructions, or turn a repeated agent workflow into a reusable skill. Hand off to skill-creator for eval runs, packaging, and trigger-description optimization.
tools
Comprehensive guide and resources for developing Logseq plugins. Use this skill when asked to: (1) Create a new Logseq plugin, (2) Implement features using the Logseq Plugin API (Editor, App, DB, UI), (3) Debug or refactor existing Logseq plugins, (4) Set up a development environment for Logseq plugins.