Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

opencode-memoryopencode 记忆

Agent Skill

opencode-memory 用于处理浏览器自动化、网页检查和页面信息提取,适合在 Codex、Claude、Cursor、Gemini CLI 中需要让 Agent 打开页面、读取网页或验证前端流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,363

周安装

180

GitHub Stars

106

下载量

1,426
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:opencode-memory(opencode 记忆)
来源仓库:https://github.com/carson2222/skills
仓库路径:skills/opencode-memory
安装命令:
npx skills add https://github.com/carson2222/skills --skill opencode-memory
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/carson2222/skills --skill opencode-memory

简介

opencode-memory 用于处理浏览器自动化、网页检查和页面信息提取。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中让 Agent 打开页面、读取网页或验证前端流程。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

OpenCode Memory Browser

Lightweight, read-only access to your local OpenCode history. No injection, no bloat — just the ability to look things up when it would help.

This skill is specifically about OpenCode data stored on the local machine. It is not for ChatGPT history, Claude cloud history, generic browser history, or external memory products.

All data lives in a local SQLite database and plain files. You query them directly using sqlite3 via bash. No bundled scripts or external dependencies needed.

When to Use

Auto-trigger (agent decides)

  • You are resuming work on a project and suspect prior sessions exist.
  • The user references something done previously ("we did this before", "last time", "that plan we made").
  • A recurring issue suggests checking if it was encountered before.
  • The user asks about the state of plans, past decisions, or previous approaches.
  • You need context that might exist in history but is not in the current session.

User-triggered (explicit request)

  • "Check my history"
  • "What did we do in the last session?"
  • "Show me my plans"
  • "Search for when we discussed X"
  • "What projects have I worked on?"
  • "Look at previous conversations about Y"

Do NOT use when

  • The task is clearly brand new with no relevant history.
  • Fresh repo context (files, git log) is sufficient.
  • The user explicitly says they don't care about prior work.

Storage Locations

Database:       ${XDG_DATA_HOME:-$HOME/.local/share}/opencode/opencode.db
Plans:          ${XDG_DATA_HOME:-$HOME/.local/share}/opencode/plans/*.md
Session diffs:  ${XDG_DATA_HOME:-$HOME/.local/share}/opencode/storage/session_diff/<session-id>.json
Prompt history: ${XDG_STATE_HOME:-$HOME/.local/state}/opencode/prompt-history.jsonl

The database path respects $XDG_DATA_HOME if set (default: ~/.local/share).

Database Schema (what matters)

  • projectid (text PK), worktree (path), name (often NULL, derive from worktree basename)
  • sessionid (text, e.g. ses_xxx), project_id (FK), parent_id (NULL = main session, set = subagent), title, summary, time_created, time_updated
  • messageid, session_id (FK), data (JSON with $.role = "user" or "assistant"), time_created
  • partid, message_id (FK), session_id (FK), data (JSON with $.type = "text" and $.text = content)

Timestamps are Unix milliseconds. Use datetime(col/1000, 'unixepoch', 'localtime') to display them.

Ready-to-Use Queries

All queries use sqlite3 in read-only mode. Always run via bash.

Shorthand used below:

DATA_ROOT="${XDG_DATA_HOME:-$HOME/.local/share}/opencode"
STATE_ROOT="${XDG_STATE_HOME:-$HOME/.local/state}/opencode"
DB="$DATA_ROOT/opencode.db"
DB_URI="file:${DB}?mode=ro"

Quick summary

sqlite3 "$DB_URI" "
  SELECT 'projects', COUNT(*) FROM project
  UNION ALL SELECT 'sessions (main)', COUNT(*) FROM session WHERE parent_id IS NULL
  UNION ALL SELECT 'sessions (total)', COUNT(*) FROM session
  UNION ALL SELECT 'messages', COUNT(*) FROM message
  UNION ALL SELECT 'todos', COUNT(*) FROM todo;
"

List projects

sqlite3 "$DB_URI" "
  SELECT
    COALESCE(p.name, CASE WHEN p.worktree = '/' THEN '(global)' ELSE REPLACE(p.worktree, RTRIM(p.worktree, REPLACE(p.worktree, '/', '')), '') END) AS name,
    p.worktree,
    (SELECT COUNT(*) FROM session s WHERE s.project_id = p.id AND s.parent_id IS NULL) AS sessions
  FROM project p
  ORDER BY p.time_updated DESC
  LIMIT 10;
"

List recent sessions

sqlite3 "$DB_URI" "
  SELECT
    s.id,
    COALESCE(s.title, 'untitled') AS title,
    COALESCE(p.name, CASE WHEN p.worktree = '/' THEN '(global)' ELSE REPLACE(p.worktree, RTRIM(p.worktree, REPLACE(p.worktree, '/', '')), '') END) AS project,
    datetime(s.time_updated/1000, 'unixepoch', 'localtime') AS updated,
    (SELECT COUNT(*) FROM message m WHERE m.session_id = s.id) AS msgs
  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;
"

Sessions for a specific project

Replace the worktree path with the actual project path:

sqlite3 "$DB_URI" "
  SELECT s.id, COALESCE(s.title, 'untitled'),
    datetime(s.time_updated/1000, 'unixepoch', 'localtime')
  FROM session s
  JOIN project p ON p.id = s.project_id
  WHERE p.worktree = '/path/to/project'
    AND s.parent_id IS NULL
  ORDER BY s.time_updated DESC
  LIMIT 10;
"

To find the worktree for the current directory: git rev-parse --show-toplevel

Read messages from a session

Replace the session ID:

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;
"

Search across all conversations

Replace the search term:

sqlite3 "$DB_URI" "
  SELECT
    s.id AS session_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;
"

List saved plans

ls -lt "$DATA_ROOT"/plans/*.md 2>/dev/null | head -20

To read a specific plan:

cat "$DATA_ROOT"/plans/FILENAME.md

Show recent prompt history

tail -20 "$STATE_ROOT"/prompt-history.jsonl

Each line is a JSON object. The user's input is typically in the input or text field.

Workflow

Quick recall (most common)

  1. Run the summary query to see what's available.
  2. If you need sessions for the current project, get the worktree with git rev-parse --show-toplevel, then run the project sessions query.
  3. If you need a specific topic, run the search query.
  4. If you need full conversation detail, run the messages query with the session ID.

Plan review

  1. List plans with ls -lt "$DATA_ROOT"/plans/*.md.
  2. Read a plan with cat "$DATA_ROOT"/plans/<filename>.md.

Deep investigation

  1. Run projects to see all tracked repos.
  2. Run sessions for a specific project.
  3. Run messages for full conversation content.
  4. Cross-reference with search across all projects.

Critical Rules

  1. Read-only. Never write to or modify the database or any OpenCode files.
  2. Use bash + sqlite3. Do not try to read opencode.db with the Read tool — it is a binary file. Always query via sqlite3 in bash.
  3. Don't dump everything. Use LIMIT and LIKE to keep output focused. The database can contain tens of thousands of messages.
  4. Summarize for the user. After retrieving data, distill the relevant parts. Don't paste raw query output.
  5. Respect privacy. Session history may contain sensitive data. Only surface what is relevant to the current task.
  6. Set path variables first. At the start of any memory lookup, set DATA_ROOT, STATE_ROOT, DB, and DB_URI exactly as shown above so the commands work on XDG and non-XDG setups and keep SQLite access read-only.

Fallback: Web UI

If the user needs visual dashboards or a browsable interface:

  1. Check if OpenCode web is running: curl -s http://127.0.0.1:4096/api/health 2>/dev/null || echo "not running"
  2. If running, direct the user to http://127.0.0.1:4096.
  3. If not running, suggest opencode web.
  4. Note: opencode.local only works with mDNS enabled (opencode web --mdns). Don't assume it exists.

Deep Reference

See references/storage-format.md for the full storage layout, all table schemas, and additional query examples.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.56%
按下载量换算521

Claude

28.62%
按下载量换算408

Cursor

21.28%
按下载量换算303

Gemini CLI

10.47%
按下载量换算149

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills