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

@zhangziheng/claude-peek

v0.3.16

Published

Process manager for Claude Code with TUI and CLI interface

Downloads

1,247

Readme

终端下的 Claude Code 进程查看器

English | 简体中文

查看进程、读取会话、清理卡死实例

快速开始功能特性命令工作原理隐私与安全常见问题故障排查卸载路线图

为什么需要 ccpeek?

同时运行多个 Claude Code 会话很快就会变得混乱。

  • ps / top 只显示 PID,看不到 Claude 任务实际在做什么
  • ~/.claude/projects/ 里翻找文件既慢又与实时进程状态脱节
  • 清理卡死的实例比应该的更麻烦

ccpeek 把进程状态、会话内容和清理操作整合到一个终端工作流中。

为什么不直接用 ps 或手动检查 ~/.claude

| 方法 | 适合 | 缺少 | |---|---|---| | ps / top | 查看运行中的进程 | 无法知道 Claude 会话实际在做什么 | | 手动检查 ~/.claude | 读取存储的会话文件 | 慢、碎片化、与实时进程状态脱节 | | ccpeek | 进程 + 会话 + 清理一体化工作流 | 仅专注于 Claude Code 工作流 |

快速开始

npm install -g @zhangziheng/claude-peek
ccpeek setup
ccpeek

功能特性

  • 列出所有 Claude Code 进程及项目路径
  • 在终端查看实时会话消息
  • 直接终止卡死的实例
  • 进程结束后按项目浏览历史会话
  • 导出对话为 Markdown

命令

交互模式

ccpeek

快捷键:

  • ↑/k ↓/j - 上下移动
  • Enter - 查看会话对话
  • v - 查看进程详情
  • d - 删除进程
  • r - 刷新
  • q/Esc - 退出

查看进程详情:

查看会话对话:

命令行模式

ccpeek list              # 列出所有进程
ccpeek list --json       # JSON 输出
ccpeek show <pid>        # 查看进程详情
ccpeek messages <pid>    # 查看会话对话
ccpeek kill <pid>        # 杀掉进程

messages 支持多种输入方式:

# 方式 1: 使用 PID(运行中的进程)
ccpeek messages 12345

# 方式 2: 使用项目路径(运行中或历史会话)
ccpeek messages /path/to/project

# 方式 3: 指定历史会话 ID
ccpeek messages /path/to/project abc123-session-id

输出选项:

ccpeek messages 12345           # 终端彩色输出
ccpeek messages 12345 --md      # Markdown 输出到 stdout
ccpeek messages 12345 --save    # 保存为文件
ccpeek messages 12345 --copy    # 复制到剪贴板

工作原理

ccpeek 通过 Claude Code hooks 建立 PID ↔ SessionID 映射,然后从 ~/.claude/projects/ 读取会话数据。

流程:

  1. SessionStart hook 捕获 PID 和 SessionID
  2. 映射存储在 ~/.claude/ccpeek/session-mappings.jsonl
  3. ccpeek 读取进程列表 + 映射 + 会话文件

隐私与安全

[✓] 仅本地      - 只读取 ~/.claude 文件
[✓] 不上传      - 零数据外传
[✓] 最小化 hooks - 仅记录 PID/SessionID 映射
[✓] 易卸载      - ccpeek uninstall 清理所有内容

常见问题

Q: 会修改我的 Claude Code 配置吗? A: 只在 .claude/hooks/ 添加 hooks,不动原有配置。

Q: 进程结束后还能看会话吗? A: 可以,使用 ccpeek messages /path/to/project

Q: 如果 hooks 安装失败怎么办? A: ccpeek 仍可查看已有会话,只是无法追踪新的 PID。

Q: 能在远程服务器上用吗? A: 可以,只要那里运行了 Claude Code。

故障排查

Hook 安装失败:

# 检查 Claude Code 目录
ls ~/.claude/hooks/

# 重新安装
ccpeek uninstall
ccpeek setup

找不到会话:

# 验证会话文件存在
ls ~/.claude/projects/

# 检查映射文件
cat ~/.claude/ccpeek/session-mappings.jsonl

权限被拒绝:

# 修复权限
chmod +x ~/.claude/hooks/*.sh

卸载

ccpeek uninstall
npm uninstall -g @zhangziheng/claude-peek

路线图

  • [ ] 远程机器支持