Agent skill

OpenCode History Browser

by carson2222 in carson2222/skills

Read-only lookup of local OpenCode history, including sessions, messages, plans, prompt history and prior decisions, queried through sqlite3 only when earlier context would help.

Apache-2.0Auto-check passedAgent Workflows

Install OpenCode History Browser

skills CLI
$ npx skills add carson2222/skills --skill opencode-memory -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install carson2222/skills opencode-memory --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/carson2222/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/opencode-memory .claude/skills/opencode-memory && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
opencode-memory
GitHub stars
113
Token cost
~1.1k tokens
SKILL.md length
196 words
Files
2 (incl. references)
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

Read-only lookup of local OpenCode history, including sessions, messages, plans, prompt history and prior decisions, queried through sqlite3 only when earlier context would help.

  • Recalling what was decided in a previous OpenCode session
  • SKILL.md covers Use When, Rules, Setup and Queries, plus 2 more sections
  • Calls sqlite3 and opencode
  • Finding an earlier plan for the current project

What it does

The skill lets the agent search what happened in earlier OpenCode sessions, but only when it helps: when you mention history, a previous session, last time or recall, when resuming a project, or when debugging an issue that may have appeared before. It is not for fresh tasks or for questions the repository or git already answer, and history is never injected by default.

Everything is read-only. The agent finds the database with opencode db path, opens it through sqlite3 with a read-only URI rather than file-read tools, limits results with LIMIT and targeted LIKE, and summarizes instead of dumping raw history. The authentication and provider tables (account, credential, control_account, account_state) are off limits. Other sources are plan Markdown files, a prompt-history JSONL file and per-session diff JSON, with a reference on the storage format.

When your agent uses it

  • Recalling what was decided in a previous OpenCode session
  • Finding an earlier plan for the current project
  • Debugging an issue that may have come up before
  • Checking prompt history for how a task was first described

Example prompts

  • “What did we decide last time about the auth refactor? Check my OpenCode history.”
  • “List my recent OpenCode sessions for this project and summarize the last one.”
  • “Find the earlier plan for the billing migration in my OpenCode plans.”

Requirements

  • OpenCode with local history
  • sqlite3
  • Compatibility (from SKILL.md): opencode

What it can do on your machine

Read from SKILL.md and the folder at commit c29af03. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • sqlite3
    • opencode

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    opencode

    From compatibility in the SKILL.md frontmatter.

Context cost

OpenCode History Browser loads about 1.1k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 93 tokens; SKILL.md has 196 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~93
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from carson2222/skills at commit c29af03, republished under its Apache-2.0 licence (© carson2222). 196 words, ~1,069 tokens.

Download SKILL.mdSave it as .claude/skills/opencode-memory/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
opencode-memory
description
Browse local OpenCode history: sessions, messages, plans, prompt history, and prior decisions. Use when the user says history, previous session, last time, remember, recall, plans, prior work, or when resuming/debugging repeated work where earlier OpenCode context may help. Do not use for fresh tasks or when current files/git already answer the question.
compatibility
opencode
license
Apache-2.0

OpenCode Memory Browser

Read-only lookup for local OpenCode history. Use it only when prior sessions, plans, or decisions would help. Do not inject history by default.

Use When

  • User asks for history, previous sessions, last time, plans, recall, or memory.
  • Resuming a project where prior OpenCode context may matter.
  • Debugging a repeat issue that may have appeared earlier.

Do not use when repo files/git already answer the question or the task is new.

Rules

  • Read-only. Never modify OpenCode DB/files.
  • Use sqlite3 with read-only URI. Do not read the DB with file-read tools.
  • Keep results small with LIMIT and targeted LIKE.
  • Summarize relevant findings; do not dump raw history.
  • Avoid auth/provider tables: account, credential, control_account, account_state.

Setup

Run this first in bash:

bash
DATA_ROOT="${XDG_DATA_HOME:-$HOME/.local/share}/opencode"
STATE_ROOT="${XDG_STATE_HOME:-$HOME/.local/state}/opencode"
DB="$(opencode db path 2>/dev/null || true)"
[ -n "$DB" ] || DB="${OPENCODE_DB:-$DATA_ROOT/opencode.db}"
case "$DB" in :memory:|/*) ;; *) DB="$DATA_ROOT/$DB" ;; esac
if [ ! -f "$DB" ]; then
  for candidate in "$DATA_ROOT"/opencode*.db; do
    [ -f "$candidate" ] && DB="$candidate" && break
  done
fi
DB_URI="file:${DB}?mode=ro"

Useful files:

  • Plans: $DATA_ROOT/plans/*.md
  • Prompt history: $STATE_ROOT/prompt-history.jsonl
  • Session diffs: $DATA_ROOT/storage/session_diff/<session-id>.json

Queries

Summary
bash
sqlite3 "$DB_URI" "
  SELECT 'projects', COUNT(*) FROM project
  UNION ALL SELECT 'main sessions', COUNT(*) FROM session WHERE parent_id IS NULL
  UNION ALL SELECT 'messages', COUNT(*) FROM message
  UNION ALL SELECT 'parts', COUNT(*) FROM part
  UNION ALL SELECT 'todos', COUNT(*) FROM todo;
"
Recent sessions
bash
sqlite3 "$DB_URI" "
  SELECT s.id, COALESCE(s.title, 'untitled') AS title,
    COALESCE(p.name, p.worktree, '') AS project,
    datetime(s.time_updated/1000, 'unixepoch', 'localtime') AS updated,
    (SELECT COUNT(*) FROM message m WHERE m.session_id = s.id) AS messages
  FROM session s
  LEFT JOIN project p ON p.id = s.project_id
  WHERE s.parent_id IS NULL
  ORDER BY s.time_updated DESC
  LIMIT 10;
"
Search text

Replace SEARCH_TERM first.

bash
sqlite3 "$DB_URI" "
  SELECT s.id, COALESCE(s.title, 'untitled') AS title,
    json_extract(m.data, '$.role') AS role,
    datetime(m.time_created/1000, 'unixepoch', 'localtime') AS time,
    substr(json_extract(p.data, '$.text'), 1, 200) AS snippet
  FROM part p
  JOIN message m ON m.id = p.message_id
  JOIN session s ON s.id = m.session_id
  WHERE s.parent_id IS NULL
    AND json_extract(p.data, '$.type') = 'text'
    AND json_extract(p.data, '$.text') LIKE '%SEARCH_TERM%'
  ORDER BY m.time_created DESC
  LIMIT 10;
"
Read session text

Replace SESSION_ID_HERE first. Text parts only; use the reference for tool, patch, file, reasoning, or V2 internals.

bash
sqlite3 "$DB_URI" "
  SELECT json_extract(m.data, '$.role') AS role,
    datetime(m.time_created/1000, 'unixepoch', 'localtime') AS time,
    GROUP_CONCAT(json_extract(p.data, '$.text'), char(10)) AS text
  FROM message m
  LEFT JOIN part p ON p.message_id = m.id
    AND json_extract(p.data, '$.type') = 'text'
  WHERE m.session_id = 'SESSION_ID_HERE'
  GROUP BY m.id
  ORDER BY m.time_created ASC
  LIMIT 50;
"

Plans And Prompt History

bash
ls -lt "$DATA_ROOT"/plans/*.md 2>/dev/null | head -20
tail -20 "$STATE_ROOT"/prompt-history.jsonl 2>/dev/null

Prompt history entries currently use input, mode, and parts[]; do not assume root text.

Deep Reference

Use references/storage-format.md only when you need table details, part/tool shapes, legacy JSON paths, or debug queries.

© carson2222, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in opencode-memory of carson2222/skills.

  • SKILL.md
  • references/storage-format.md

Open the folder on GitHubat commit c29af03

Compare with similar skills

OpenCode History Browser next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

OpenCode History Browser compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
OpenCode History Browser this skillcarson2222/skills113—~1.1kAutomated safety check: PassApache-2.0
Beads Task Memorygastownhall/beads28k—~1.2kAutomated safety check: PassMIT
Session History Searchslopus/happy24k—~3.1kAutomated safety check: PassMIT
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
Coding Agent Session Findercode-yeongyu/oh-my-openagent70k—~2.8kAutomated safety check: PassCustom licence
Deja History Searchvshulcz/deja-vu1.1k1 repos~1.3kAutomated safety check: PassMIT

Similar skills

  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check: notes
  • Coding Agent Session Finder

    code-yeongyu/oh-my-openagent

    Finds, reads and reconstructs past coding-agent sessions across Codex, Claude, OpenCode, Senpi and many other local agent logs.

    70k GitHub stars~2.8k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Deja History Search

    vshulcz/deja-vu

    Searches this machine's own history of past AI coding sessions across every tool used on it, before work is redone or something is denied.

    1.1k GitHub starsUsed in 1 repo~1.3k tokens
    Agent WorkflowsAuto-check passed
  • Memori MCP Memory Usage

    MemoriLabs/Memori

    Teaches an MCP-connected agent when and how to call Memori's recall, summary, compaction, augmentation, feedback and quota tools to keep context across sessions.

    17k GitHub stars~3.8k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check passed

More from carson2222/skills

  • X Algorithm Post Writing

    carson2222/skills

    Writes and reviews X posts, threads and replies using what the open-sourced For You ranking system rewards, and explains why a post may have underperformed.

    113 GitHub stars~3.8k tokensUpdated 3 mo ago
    Auto-check passed
  • Design Exploration

    carson2222/skills

    Generates several visual directions for a component or page, lets you compare them, then fully implements the one you pick.

    113 GitHub stars~3.3k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about OpenCode History Browser

What does OpenCode History Browser do?

Read-only lookup of local OpenCode history, including sessions, messages, plans, prompt history and prior decisions, queried through sqlite3 only when earlier context would help. The skill lets the agent search what happened in earlier OpenCode sessions, but only when it helps: when you mention history, a previous session, last time or recall, when resuming a project, or when debugging an issue that may have appeared before. It is not for fresh tasks or for questions the repository or git already answer, and history is never injected by default.

When should I use OpenCode History Browser?

OpenCode History Browser fits situations like: recalling what was decided in a previous OpenCode session; finding an earlier plan for the current project; debugging an issue that may have come up before; checking prompt history for how a task was first described.

How do I install OpenCode History Browser in Claude Code?

Run `npx skills add carson2222/skills --skill opencode-memory -a claude-code`. Or copy the skill folder (opencode-memory in carson2222/skills) into .claude/skills/opencode-memory in your project. Claude Code loads it when a task matches its description.

How do I install OpenCode History Browser in Codex?

Run `npx skills add carson2222/skills --skill opencode-memory -a codex`. Or copy the skill folder (opencode-memory in carson2222/skills) into .agents/skills/opencode-memory in your project. Codex loads it when a task matches its description.

Can I use OpenCode History Browser in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add carson2222/skills --skill opencode-memory -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/opencode-memory, .gemini/skills/opencode-memory, .github/skills/opencode-memory and .opencode/skills/opencode-memory in your project.

What does OpenCode History Browser need to run?

Going by SKILL.md and its folder, OpenCode History Browser needs the command-line tools its instructions call (sqlite3 and opencode). Our summary lists: OpenCode with local history; sqlite3. Compatibility (from SKILL.md): opencode.

Does OpenCode History Browser access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is OpenCode History Browser safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does OpenCode History Browser use?

OpenCode History Browser is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does OpenCode History Browser use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to OpenCode History Browser?

Skills that share tags, products or a category with OpenCode History Browser: Beads Task Memory (gastownhall/beads, 28k stars), Session History Search (slopus/happy, 24k stars), Memori Long-Term Memory (MemoriLabs/Memori, 17k stars) and Coding Agent Session Finder (code-yeongyu/oh-my-openagent, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains OpenCode History Browser?

carson2222 (a GitHub user) maintains it in carson2222/skills, which has 113 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on June 28, 2026.

Source: carson2222/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.