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

@omnimer/context-manager

v0.1.2

Published

Turn agent conversations into reusable guidance and context.

Downloads

400

Readme

context-manager

Turn agent conversations into reusable guidance and context.

把对话整理成后续 agent 可以直接复用的经验和上下文。

context-manager 帮助 agent 从历史对话里保留真正重要的信息,避免每次都从头再来。当前先服务于 Codex,后续会扩展到 Claude Code 等其它 agent。

背景与问题

Agent 用久了以后,历史对话会越来越长,但真正有用的信息很难留下来。

结果通常是两种:

  • 上下文越来越重,但真正重要的内容越来越难找
  • 会话结束或被压缩后,已经验证过的做法又要重新想一遍

context-manager 会自动整理这些对话,把有价值的内容沉淀下来,供后续 agent 继续使用。

核心工作流

对话
  -> 提炼
  -> working-memory/
  -> guidance/
  -> 后续 agent 按需读取

它会做的事情很简单:

  • 捕获对话产物
  • 提炼出高信号内容
  • 写入 working-memory/
  • 再提炼成更精炼的 guidance/
  • guidance/ 会简单分成三类:决策、流程、约定
  • 让后续 agent 在需要时直接读取这些结果

快速开始

当前有两种使用方式:

通过 npm:

  1. 进入你要接入的目标 repo
  2. 运行 npm install -g @omnimer/context-manager
  3. 运行 context-manager init --repo-root .

通过源码仓库:

  1. 克隆这个仓库
  2. 进入 context-manager/
  3. 运行 npm install
  4. 进入你要接入的目标 repo
  5. 运行 node /path/to/context-manager/bin/context-manager.mjs init --repo-root .

如果你当前就在 context-manager/ 目录里,也可以直接指定目标 repo:

  • node ./bin/context-manager.mjs init --repo-root /path/to/target-repo

init 会在目标 repo 里写入 Codex hook 配置。配置会指向已安装的 context-manager 运行代码,不会在目标 repo 里复制或链接 hooks/scripts/

常用命令:

  • npm test
  • node scripts/compile.mjs
  • node scripts/lint.mjs
  • node scripts/replay_pending.mjs
  • node scripts/smoke_e2e.mjs

当前状态

当前实现是 Codex-first:

  • 目前通过 Codex hooks 接入
  • 会生成 working-memory/guidance/
  • 会在后续会话里通过 guidance-recall 供 agent 按需读取
  • 后续会扩展到其它 agent,而不是停留在 Codex 专用实现

开发与实现约定

  • scripts/prompts/flush.mdscripts/prompts/compile.md 是默认提示词模板
  • 可通过 CODEX_MEMORY_COMPILER_PROMPTS_DIR 覆盖模板目录
  • reports/pending-flush/ 只承担可重放入口
  • reports/llm-failures/ 只承担失败诊断记录
  • 项目级 hook 定义位于 .codex/config.toml
  • init 只写目标 repo 的 Codex 配置,不复制或链接运行时代码
  • guidance-recall skill 安装到 ~/.codex/skills/guidance-recall/
  • compile 在来源冲突时以后来的、已验证的当前状态为准,不继续固化过时 guidance
  • activate_hooks.mjsinit 命令的内部实现
  • 日常是否触发通过 reports/runtime/ 下的被动痕迹判断,不依赖 doctor

参考仓库

当前主要参考了这些仓库:

  • coleam00/claude-memory-compiler
  • openai/codex
  • openai/codex-plugin-cc
  • zilliztech/memsearch

社区

欢迎提交 issue 和 pull request!感谢 linux.do 社区的讨论和反馈,帮助我们不断完善这个项目。