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

@cooperwhy/opencode-local-memory

v1.0.4

Published

Local memory plugin for OpenCode

Downloads

71

Readme

opencode-local-memory

本地记忆插件,让 opencode 拥有跨会话的记忆能力。

功能

  1. 记忆注入 - 新会话自动加载历史记忆
  2. 关键词保存 - 说 "记住" 自动保存
  3. 自动压缩 - 上下文达阈值时自动总结保存
  4. 实时显示 - 控制台显示上下文使用率

安装

cd memory_control
npm install
npm run build
npm link

配置

编辑 ~/.config/opencode/local-memory.json

{
  "compactionThreshold": 0.5,  // 压缩阈值 (0.3 = 30%, 0.8 = 80%)
  "keywordPatterns": [         // 触发保存的关键词
    "记住",
    "remember",
    "保存",
    "save this"
  ],
  "autoSave": true
}

实时显示

运行 opencode 时,控制台会显示:

[local-memory] 上下文 35.2% | 阈值 50% | ███████░░░░│░░░░░░░░░
[local-memory] 上下文 48.5% | 阈值 50% | █████████░░│░░░░░░░░░
[local-memory] ⚠ 接近阈值 50%
[local-memory] 上下文 52.1% | 阈值 50% | ██████████│█░░░░░░░░░
[local-memory] >>> 触发压缩 <<<

记忆文件

~/.opencode/local-memory/
├── global.md                    # 全局记忆
└── projects/
    └── {project-hash}.md        # 项目记忆

调节阈值

实时修改配置文件,插件每 5 秒自动重新加载:

# 修改阈值为 30%
echo '{"compactionThreshold": 0.3}' > ~/.config/opencode/local-memory.json