一套为 Claude Code 设计的技能和钩子,通过限制文件读取、命令和上下文使用来减少令牌浪费。

Stars

31

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

MIT

最近更新

2026-07-28

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它通过守卫、状态交接和活动日志提供了实际可衡量的令牌节省,支持插件市场或脚本安装,并附带基准测试来验证节省效果。

适合谁使用

  • 希望降低 API 成本的 Claude Code 用户
  • 在大型代码库中工作、需要避免扫描无关文件的开发者
  • 希望在 AI 辅助编码会话中强制实施最佳实践的团队
  • 想要精细控制 Claude Code 行为的高级用户

典型使用场景

  • 阻止 Claude Code 读取 node_modules、构建产物或锁文件
  • 阻止无限制的 grep 和递归 ls 命令以节省令牌
  • 跨会话跟踪活动和上下文使用以优化工作流程
  • 在会话之间维护紧凑的状态交接,避免转录膨胀

项目优势

  • 不在请求路径中调用模型,因此开销极小
  • 通过环境变量和白名单高度可配置
  • 支持多种安装方式:插件市场和手动脚本
  • 内置基准测试和节省估算来验证效果

使用前须知

  • 仅适用于 Claude Code,且需要 Bash 环境(Windows 上需 Git Bash)
  • 插件安装无法设置主状态栏;需使用 install.sh 脚本才能获得该功能
  • 金额节省为估算值,并非保证的实际节省

README 快速开始

phobos

Skills and hooks for Claude Code that cut down on wasted tokens. Skills steer the model, hooks enforce it. Nothing runs in the request path.

Install

git clone https://github.com/broisnischal/phobos.git ~/src/phobos
bash ~/src/phobos/install.sh

On Windows, run this from Git Bash. Restart Claude Code after.

Check the install any time:

bash ~/.claude/skills/phobos/hooks/doctor.sh

Flags: --skills-only, --settings-only, --no-guard, --no-cmd-guard, --no-statusline, --quiet.

Install as a plugin

phobos is also a Claude Code plugin marketplace. Inside Claude Code:

/plugin marketplace add broisnischal/phobos
/plugin install phobos@phobos

This installs all three skills (phobos, phobos-code, phobos-plan) and wires every hook automatically — no settings.json edits, updated with /plugin marketplace update.

One difference from install.sh: a plugin can't set the main status line — Claude Code only lets plugins define agent/subagentStatusLine, and the plugin's cache path is versioned and ephemeral. To get the effort/context gauge shown above, run install.sh (which wires it for you), or point your own settings.json statusLine at a stable clone: bash "$HOME/.claude/skills/phobos/hooks/statusline.sh".

What you get

  • Read guard
  • Command guard
  • Turn triage
  • Context aware
  • Context gauge
  • Session usage
  • Activity
  • State handoff
  • Tab spinner
  • Skills for plan and code
  • /phobos-update command

The read guard

Denies reads of:

  • node_modules/, vendor/, .venv/, __pycache__/, .cache/
  • dist/, build/, .next/, .nuxt/, .output/, coverage/
  • lockfiles — package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, poetry.lock, uv.lock, go.sum
  • *.min.js, *.map, *.pyc, *.so, fonts, other binaries
  • .git/ internals
  • unbounded reads over 2 MB

Images and PDFs always pass.

Unbounded reads are also capped by line count (default 2000), not just size — a file can be small in bytes but thousands of lines long.

echo 'node_modules/my-patched-pkg' >> .claude/phobos-guard-allow   # per-repo allowlist
PHOBOS_GUARD=off claude                                            # off for one se

项目描述

the best token is the token never spent

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

jamesob
精选
jamesob GitHub avatar

local-llm

A comprehensive guide for building and configuring a high-end local machine to run state-of-the-art LLMs, with detailed hardware choices, BIOS tuning, and Docker-based model serving.

AI 与机器学习大语言模型
1,660
bjan
精选
bjan GitHub avatar

claudemux

Claudemux is a lightweight, dependency-minimal message bus that lets multiple Claude Code sessions communicate in real-time over tmux, enabling one session to ask another a question and receive the answer without manual intervention.

AI 与机器学习AI 智能体
9
AARomanov1985
AARomanov1985 GitHub avatar

Audio-Cassette-Simulation

A set of bash scripts using ffmpeg to simulate vintage cassette tape audio profiles with noise, wow/flutter, bandwidth limits, and EQ.

Shell
373