Claude上下文诊断工具

一款用于诊断和优化Claude代码上下文使用情况的终端用户界面工具,可分析技能、插件和MCP服务器的上下文占用情况并提供优化建议。

  • by Demwunz
  • Rust
  • 本地部署
  • 3 星标
  • 更新于
在 GitHub 查看 Demwunz/claude-context-doctor

使用说明

Claude Context Doctor

A friendly TUI tool to diagnose and optimize your Claude Code context usage

关于项目

你有没有想过为什么克劳德似乎忘记了事情或跑得比预期的慢?这可能是上下文膨胀!

Claude Context Doctor帮助你准确地看到是什么在吞噬你的上下文窗口——技能、插件、MCP服务器——并为你提供可操作的建议来精简内容。

它的作用:

  • 显示您安装的所有技能及其大小
  • 列出启用/禁用状态的插件
  • 检查MCP服务器运行状况
  • 计算总上下文使用量(令牌)
  • 提供具体建议以减少臃肿
  • 允许您直接从TUI打开/关闭插件

构建于

安装

快速运行(无需安装)

只是想试试吗?运行这一行程序-它会自动下载、运行和清理:

curl -fsSL https://raw.githubusercontent.com/Demwunz/claude-context-doctor/main/install.sh | sh

自制(macOS/Linux)

brew install Demwunz/tap/claude-context-doctor

Shell安装脚本

curl -fsSL https://raw.githubusercontent.com/Demwunz/claude-context-doctor/main/install.sh | sh -s -- --install

下载二进制文件

从下载 发布页面 (macOS、Linux、Windows)。

来源

cargo install --git https://github.com/Demwunz/claude-context-doctor.git

用法

交互式TUI模式:

claude-context-doctor

导航方式:

  • Tab 或 1-5 切换面板
  • j/k 或箭头导航列表
  • Enter 打开/关闭插件
  • ? 求助
  • q, Esc,或 Ctrl+C 退出

报告模式(非交互式):

claude-context-doctor --report-only

JSON输出:

claude-context-doctor --report-only --format json

输出示例

## Context Usage
  Skills:      18.7K tokens
  Plugins:     19.2K tokens
  MCP:         0 tokens
  Base System: 5.0K tokens
  TOTAL:       42.9K / 200.0K tokens (21%)

## Recommendations
  [*] Disable 'pr-review-toolkit' to save ~11K tokens
      This plugin uses 44.8KB of context. Press Enter in Plugins panel to toggle.

路线图

  • [x] 技能检查与尺寸计算
  • [x] 支持切换的插件管理
  • [x] MCP服务器健康检查
  • [x] 上下文使用估计
  • [x] 可采取行动的建议
  • []技能内容预览
  • []备份/还原配置
  • []比较一段时间内的上下文使用情况

贡献

贡献使开源社区令人惊叹。你所做的任何贡献都是 非常感谢.

  1. 分叉项目
  2. 创建功能分支(git checkout -b feature/AmazingFeature)
  3. 提交您的更改(git commit -m 'Add some AmazingFeature')
  4. 推到分支机构(git push origin feature/AmazingFeature)
  5. 打开拉取请求

许可证

根据MIT许可证分发。看 LICENSE 了解更多信息。

致谢