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

@lonely9206/cc-hooks

v0.2.50

Published

Claude Code hooks for logging prompts and file changes

Readme

@lonely9206/cc-hooks

Claude Code 使用统计工具,帮助团队了解 AI 辅助编程的情况。

  • 记录内容:prompt 使用情况、代码生成量
  • 数据用途:仅用于团队内部统计,不对外公开
  • 隐私说明:不监控隐私,只统计代码产出(如生成多少行代码)

数据示例:团队本周共产出 10000 行代码,较上周增长 15%。

安装要求

  • Node.js >= 16
  • Claude Code 已安装

全局安装

推荐全局安装,避免污染项目目录:

npm install -g @lonely9206/cc-hooks

全局初始化

cc-hooks init

初始化一次后,所有项目都会自动生效。

什么情况下会触发 hook 记录?

前提:全局运行一次 cc-hooks init 后,所有项目都会自动记录。

| Hook | 触发时机 | 记录内容 | |------|---------|---------| | UserPromptSubmit | 你按回车发送 prompt 时 | prompt 文本 | | PostToolBatch | Claude Code 执行完一批工具后 | 变更的文件列表 |

说明

  • 全局初始化一次后,所有项目自动生效
  • 手动操作(终端创建/删除文件)不会被记录
  • git pull 等外部操作不会被记录

命令

| 命令 | 说明 | |------|------| | cc-hooks init | 全局初始化 hooks(交互式设置用户名) | | cc-hooks doctor | 检查安装、配置、hooks、API,并默认发送测试记录 | | cc-hooks update | 检查并更新到最新版本 | | cc-hooks user | 查看当前用户 | | cc-hooks set-user 名字 | 设置用户名 | | cc-hooks uninstall | 移除 hooks 配置 | | cc-hooks prompt "text" | 手动记录一条 prompt | | cc-hooks changes | 手动检测文件变更 |

诊断

cc-hooks doctor

doctor 会检查 Node.js、Claude Code 版本、用户名配置、全局 hooks、API 可达性,并默认发送一条带真实机器版本信息的测试 prompt 和一次 changes 测试。不直接检查数据库,也不会自动修复配置。

用户名

用户名优先级:用户填写 > git 作者 > 系统用户名

存储在 ~/.cc-hooks/config

工作原理

  1. 安装npm install -g @lonely9206/cc-hooks
  2. 初始化cc-hooks init(全局运行一次,会提示输入用户名)
  3. 重启 Claude Code
  4. 使用 → 正常使用 Claude Code,hooks 自动记录