Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/xiaobei930/cc-bestnpx agentmods add commands/xiaobei930/cc-best/setup-pmWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/xiaobei930/cc-best/setup-pm)<a href="https://agentmods.dev/commands/xiaobei930/cc-best/setup-pm"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/setup-pm/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/xiaobei930/cc-best/setup-pm"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/setup-pm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00016 | $0.00768 |
| Opus 5.5 | $0.00006 | $0.00307 |
| Sonnet 5.5 | $0.00003 | $0.00154 |
| Haiku 4.5 | $0.00002 | $0.00077 |
Grade A, and why
setup-pm scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/setup-pm - 包管理器配置
配置项目或全局的首选包管理器。
快速使用
# 检测当前配置
node scripts/node/setup-package-manager.js --detect
# 设置项目首选为 pnpm
node scripts/node/setup-package-manager.js --project pnpm
# 设置全局首选为 bun
node scripts/node/setup-package-manager.js --global bun
# 列出所有可用选项
node scripts/node/setup-package-manager.js --list
检测优先级
系统按以下顺序检测包管理器:
| 优先级 | 来源 | 说明 |
|---|---|---|
| 1 | 环境变量 CLAUDE_PACKAGE_MANAGER |
最高优先级 |
| 2 | 项目配置 .claude/package-manager.json |
项目级覆盖 |
| 3 | package.json 的 packageManager |
标准字段 |
| 4 | Lock 文件检测 | 自动检测 |
| 5 | 全局配置 ~/.claude/package-manager.json |
用户默认 |
| 6 | 回退 | pnpm > bun > yarn > npm |
配置文件格式
项目配置 (.claude/package-manager.json)
{
"packageManager": "pnpm",
"updatedAt": "2024-01-23T10:00:00.000Z"
}
全局配置 (~/.claude/package-manager.json)
{
"packageManager": "bun",
"updatedAt": "2024-01-23T10:00:00.000Z"
}
package.json 标准字段
{
"name": "my-project",
"packageManager": "[email protected]"
}
环境变量
设置 CLAUDE_PACKAGE_MANAGER 环境变量可覆盖所有配置:
# Windows PowerShell
$env:CLAUDE_PACKAGE_MANAGER = "pnpm"
# macOS/Linux
export CLAUDE_PACKAGE_MANAGER=pnpm
支持的包管理器
| 包管理器 | Lock 文件 | 特点 |
|---|---|---|
| npm | package-lock.json | Node.js 自带 |
| pnpm | pnpm-lock.yaml | 快速、节省磁盘空间 |
| yarn | yarn.lock | 稳定、广泛使用 |
| bun | bun.lockb | 极快、新一代运行时 |
在 Hooks 中使用
Node.js hooks 会自动使用检测到的包管理器:
const { detect, getRunCommand } = require("./lib/package-manager");
const pm = detect();
console.log(`使用 ${pm.name} (来源: ${pm.source})`);
// 获取运行命令
const devCmd = getRunCommand("dev"); // -> "pnpm dev" 或 "npm run dev"
const testCmd = getRunCommand("test"); // -> "pnpm test" 或 "npm test"
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 106 lines · 16 tokens per session scan A 1ea8c8db1930
setup-pm is a command published in the GitHub repository xiaobei930/cc-best (48 stars, last pushed 4mo ago), licensed MIT. It adds 16 tokens to every session and 768 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
audit-agents-skills
Audit quality of agents, skills, and commands in a Claude Code project.
audit-whitepapers
Audit version freshness, FR/EN parity, and metadata quality of all whitepapers and recap cards.
audit-repo-docs
Audit repository documentation against 85+ best practices from claude-code-ultimate-guide.
security-audit
Comprehensive security audit of your project AND Claude Code configuration. Analyzes secrets exposure, injection surfaces, dependencies, hook security, and produces a scored security posture assessment.
update-infos-release
Update Claude Code releases tracking (guide + landing + version bump).
boldguy-linkedin-answer
Draft a LinkedIn comment on a post, referencing the guide's relevant section, in Flow style with AI markers removed.