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

@mcptoolshop/claude-memories

v1.0.2

Published

MEMORY.md optimizer and dispatch table generator for Claude Code

Readme

用于 Claude Code 的 MEMORY.md 优化器和分发表生成器。

让您的 MEMORY.md 文件变得精简。claude-memories 分析您的记忆文件,生成一个机器可读的分发表,并显示您的上下文预算是如何分配的。

问题

Claude Code 的自动记忆功能会生成一个巨大的 MEMORY.md 文件,占用大量的上下文窗口。每次会话都会加载 40K+ 个令牌(token)的记忆数据,而其中大部分与当前任务无关。

解决方案

claude-memories 将您的记忆文件索引到分发表中。代理可以根据需要访问正确的记忆主题,而不是加载所有内容。

MEMORY.md (669 tokens)  →  dispatch table  →  topic files (42K tokens)
     always loaded            routing            loaded on match

节省高达 98% 的空间,适用于拥有 31 个主题的真实记忆工作区。

安装

npm install -g @mcptoolshop/claude-memories

命令

analyze

分析 MEMORY.md 文件的结构、引用和令牌(token)成本。

claude-memories analyze MEMORY.md

index

从您的记忆文件中生成一个分发表(index.json)。

claude-memories index MEMORY.md
claude-memories index MEMORY.md --lazy
claude-memories index MEMORY.md --out .claude/memory-index.json

validate

检查记忆文件的结构问题。

claude-memories validate MEMORY.md

检查内容:缺少主题文件、孤立文件、重复引用、空名称。

stats

令牌(token)预算仪表盘。

claude-memories stats MEMORY.md
╔══════════════════════════════════════════╗
║        Memory Token Budget               ║
╚══════════════════════════════════════════╝

  Total tokens:       43,127
  MEMORY.md inline:   669
  Topic files:        42,458

  Entries:            31
  Always loaded:      669 tokens
  On-demand total:    42,458 tokens
  Avg task load:      1,370 tokens
  Savings (lazy):     98%

工作原理

  1. 解析 MEMORY.md 文件,查找主题引用(箭头格式:Name → path)。
  2. 读取每个主题文件,从标题和内容中提取关键词。
  3. 生成一个与 ai-loadout 兼容的 LoadoutIndex(分发表)。
  4. 验证结构完整性(缺少文件、孤立文件、重复项)。

引用格式

MEMORY.md 文件的条目遵循以下格式:

Topic Name — description → `memory/topic-file.md`

支持项目符号和非项目符号格式:

- AI Loadout — routing core for agents → `memory/ai-loadout.md`
Claude Rules — CLAUDE.md optimizer → `memory/claude-rules.md`

前言(可选)

主题文件可以包含前言,以实现更精细的控制:

---
id: ai-loadout
keywords: [loadout, routing, dispatch, kernel]
patterns: [knowledge_routing]
priority: domain
triggers:
  task: true
  plan: true
  edit: false
---

# AI Loadout
...

如果没有前言,关键词将自动从主题名称和标题中提取。

架构

claude-memories 是知识操作系统堆栈中的 第二层适配器

| 层级 | 包 | 角色 | |-------|---------|------| | 内核 | @mcptoolshop/ai-loadout | 路由类型、匹配、验证 | | 适配器 | @mcptoolshop/claude-rules | CLAUDE.md 优化 | | 适配器 | @mcptoolshop/claude-memories | MEMORY.md 优化 |

相同的内核,不同的文档类型。两者都生成兼容的分发表。

安全性

  • 仅本地运行:不进行任何网络调用,不收集任何遥测数据。
  • 主要为读取:仅写入 index.json 文件;从不修改 MEMORY.md 文件。
  • 确定性:相同的输入始终产生相同的输出。

请参阅 SECURITY.md 以了解威胁模型。

许可证

MIT


MCP Tool Shop 构建。