一键导入
searching-sessions
Use when searching OpenCode session history for PRs, Jira tickets, commands, or any text across past sessions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when searching OpenCode session history for PRs, Jira tickets, commands, or any text across past sessions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use on any NixOS host (devbox on Hetzner, cloudbox on GCP) when SSH connection fails, host key mismatch, NixOS issues, CPU/IO contention (high load), or verifying the host is properly configured
Launch headless opencode sessions from CLI. Use when you need to start a new opencode session in the background to work on a task in parallel, or when spawning work on a specific directory.
How to apply configuration changes to NixOS hosts (devbox, cloudbox). Use when you need to rebuild the system, apply home-manager changes, or recover from issues.
Use when setting up or rotating PagerDuty MCP auth for OpenCode on macOS Keychain or cloudbox sops, or when debugging missing PagerDuty tools.
Use when setting up or rotating Rollbar MCP auth for OpenCode on macOS Keychain or cloudbox sops, when triaging a Rollbar error paged via PagerDuty, or when debugging missing Rollbar tools.
Documents the OpenCode agent set — what each does, when to use it, and why the others were cut. Use when questioning agent choices or considering adding/removing agents.
| name | searching-sessions |
| description | Use when searching OpenCode session history for PRs, Jira tickets, commands, or any text across past sessions. |
Search session transcripts with oc-search. Run oc-search --help for all options.
# Which session created a Jira ticket?
oc-search DATA-4297
# Which session opened a PR?
oc-search 'gh pr create'
# Search conversation text too, not just tool calls
oc-search --types tool,text 'authentication'
# Search everything
oc-search --all 'rules_oci'
Output's first column is the session id (e.g. ses_2645cd242ffewHTsOoDmVVWW9a). Pass it to opencode -s from the session's directory:
cd <directory-from-output>
opencode -s <id-from-output>
The full id is required — slugs are not unique and opencode -s won't accept them.
Queries the global OpenCode SQLite DB at ~/.local/share/opencode/opencode.db. Searches part.data JSON blobs using instr() substring matching.
Default scope is tool parts only (e.g. gh/kubectl commands and outputs). Use --types or --all for broader search.
Single global DB. Schema: project -> session -> message -> part. Content lives in part.data (JSON). Part types by size:
| Type | Content | Default? |
|---|---|---|
| tool | shell/tool commands, inputs, outputs | Yes |
| text | Conversation text | No |
| patch | File diffs | No |
| reasoning | Model reasoning | No |
| step-start/finish | Metadata | No |
| Decision | Chosen | Upgrade path |
|---|---|---|
| Search | instr() scan (~few seconds) | FTS5 index if too slow |
| Scope | Tool parts only by default | --types / --all |
| Output | Summary table | --json flag |
| Language | Bash | Python if string handling gets painful |
| DB access | Read-only (mode=ro) | n/a |
Full rationale: docs/plans/2026-04-13-oc-search-design.md