npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@max10240/opencode-plugin-session-search

v1.0.26

Published

Search user and agent messages in the current OpenCode session and jump to a result

Readme

@max10240/opencode-plugin-session-search

English | 简体中文

找到你或 Agent 说过的任何一句话,然后直接跳过去。

一个 OpenCode session 可能连续跑好几个小时。你需要的决定、跑通过的命令、正在排查的报错,早就被推到几千行之前。压缩(compaction)会让情况更糟:早期消息从可见对话里消失,虽然它们仍然保存在历史里。

当前对话检索给 session 加了一个真正的搜索框。输入你还记得的内容,预览匹配项,按 Enter 跳到对应消息。也可以只复制原文, 不改变当前位置。

什么时候需要它

  • 你正处在很长的调试、规划或实现 session 中。
  • 压缩把早期消息藏了起来,但你仍然需要它们。
  • 你想找一小时前的命令、文件路径、决定或报错。
  • 你想复制以前的指令或回答,不想一路滚动。
  • 你想搜索 Agent 的消息,而不只是自己的 prompt。

它能给你什么

  • 搜索完整保存历史。 不只是当前加载的消息,也不只是模型上下文。
  • 压缩前后都能用。 真实的用户和 Agent 消息仍然可搜索;压缩摘要不会被当成原始对话。
  • 跳回原文。 按 Enter 滚动到匹配的消息或文字段落。
  • 复制而不跳转。 Ctrl+Y 复制选中文本,不改变当前位置。
  • 选择搜索范围。 默认只显示用户消息;按 Tab 加入 Agent 消息。
  • 绝不修改对话。 搜索、跳转、复制都不会插入、提交、重发或撤回任何内容。

快速开始

在 TUI 配置中加载:

{
  "$schema": "https://opencode.ai/v2/cli.json",
  "plugins": [{
    "package": "@max10240/opencode-plugin-session-search",
    "options": { "keybind": "ctrl+shift+f" }
  }]
}

使用 Unicorn 时:

{
  "plugins": [{
    "package": "@max10240/opencode-plugin-unicorn",
    "options": {
      "features": { "sessionSearch": true },
      "sessionSearch": { "keybind": "ctrl+shift+f" }
    }
  }]
}

使用

按 ctrl+shift+f,或在命令面板选择 Search current session。

| 按键 | 操作 | | --- | --- | | 输入 | 过滤匹配项;空白分隔的词按 AND 组合,不区分大小写 | | ↑ / ↓ | 选择匹配项 | | Enter | 跳到对应消息或文字段落 | | Ctrl+Y | 复制选中文本,不跳转 | | Tab | 在“仅用户消息”和“用户 + Agent 消息”之间切换 | | Esc | 关闭弹窗;跳转加载中时取消跳转 |

一次最多显示 100 条匹配,继续输入可以缩小范围。复制后弹窗内会出现提示,几秒后消失;修改查询或切换消息范围会立即清除提示。

配置

| 参数 | 默认值 | 作用 | | --- | --- | --- | | keybind | ctrl+shift+f | 打开当前对话检索的快捷键 |

通过 Unicorn 使用时,features.sessionSearch: false 可以关闭插件。

注意事项

  • 跳转定位到消息或文字段落的开头。 很长的 Markdown 段落不保证精确滚动到匹配字符所在行。
  • 跳得很远时可能需要等一会儿。 很早的消息要先加载;超长 session 不承诺即时完成。
  • Server 上已删除的内容无法恢复。 搜索只能看到 OpenCode 仍然保存的内容。
  • 排队中的 prompt 只可复制,不可跳转。 选择搜索结果不会把它们发送出去。
  • 撤回边界之后的匹配不可跳转。 搜索会尊重撤回状态,不会为了跳转取消撤回。
  • 索引只在内存中。 需要时重建,不写入磁盘。
  • 已在 OpenCode v2.0.21 和 v2.1.0 验证。 其他版本尚未确认。