# 1. Clone the repository
git clone https://github.com/xiaobei930/cc-best.git my-project
# 2. Enter your project
cd my-project
# 3. Run initialization
bash scripts/shell/init.sh
# 4. Replace template placeholders (see next question)
# 5. Start using
/cc-best:pm # Begin with product manager roleThe following placeholders must be replaced before using:
| Placeholder | Description | Example |
|---|---|---|
{{PROJECT_NAME}} |
Your project name | MyAwesomeApp |
{{PROJECT_DESCRIPTION}} |
Brief project description | A task management tool |
{{DATE}} |
Creation/update date | 2025-01-24 |
{{CURRENT_PHASE}} |
Current development phase | Development |
Files containing placeholders:
CLAUDE.md- Main configuration (required)memory-bank/progress.md- Progress tracking.claude/ralph-prompts/*.md- Ralph Loop prompts (if using ralph-loop)
You can find all placeholders with:
grep -r "{{" --include="*.md" .Yes! This is a template. Common deletions:
.github/- If you don't need contribution templatesCONTRIBUTING.md,CHANGELOG.md,FAQ.md- Template-specific docs- Language rules you don't use (e.g.,
cpp-style.mdfor a Python project) - Commands you won't use
Keep at minimum:
CLAUDE.md- Core configuration.claude/settings.json- Permission settings- Rules for your language
No. For a fresh start:
rm -rf .git
git init
git add .
git commit -m "Initial commit from Claude Code template"-
Check settings.local.json exists:
ls .claude/settings.local.json
If missing, copy from example:
cp .claude/settings.local.json.example .claude/settings.local.json
-
Check script permissions (Linux/Mac):
chmod +x scripts/*.sh -
Check Python/Bash availability:
which python which bash
-
Check Claude Code version - Hooks require recent versions
Edit .claude/settings.local.json, remove or comment out the hook entry:
{
"hooks": {
"PreToolUse": [
// Remove this block to disable
// {
// "matcher": "Bash",
// "hooks": [...]
// }
]
}
}This usually happens on Windows. Solutions:
- Ensure Python 3.8+ is installed
- Check the file encoding is UTF-8
- Set environment variable:
PYTHONUTF8=1
Check these stop conditions:
- User interrupted (Ctrl+C or Escape)
- All tasks in
progress.mdcompleted - Fatal error occurred
- External dependency needs user decision
To resume: Run /cc-best:iterate again, it reads from progress.md.
| Mode | Control | Use Case |
|---|---|---|
/cc-best:iterate |
Fully autonomous | Clear task list, single session |
/cc-best:pair |
Step-by-step confirmation | Learning, sensitive operations |
Check these locations:
- Commands should be in
commands/ - File extension must be
.md - Restart Claude Code after adding new commands
- After completing each task
- When making important decisions
- Before context compression (
/cc-best:compact-context) - At session end
Run initialization:
bash scripts/shell/init.shOr manually create from templates in memory-bank/.
- Edit
.claude/settings.local.json - Add to
enabledMcpjsonServers:{ "enabledMcpjsonServers": ["memory", "sequential-thinking"] } - Restart Claude Code
Best practice: Enable max 10 MCP servers per project. Use disabledMcpServers to disable unused ones:
{
"disabledMcpServers": ["github", "vercel"]
}# Linux/Mac: Fix script permissions
chmod +x scripts/*.sh
chmod +x scripts/*.py
# Windows: Run as administrator or check execution policy# Use python instead of python3
# Or set alias
alias python3=python- Claude Code caches rules at session start
- Restart the session after modifying rules
- Or use
/clearto refresh context
# 1. 克隆仓库
git clone https://github.com/xiaobei930/cc-best.git my-project
# 2. 进入项目
cd my-project
# 3. 运行初始化
bash scripts/shell/init.sh
# 4. 替换模板占位符(见下一个问题)
# 5. 开始使用
/cc-best:pm # 从产品经理角色开始使用前必须替换以下占位符:
| 占位符 | 说明 | 示例 |
|---|---|---|
{{PROJECT_NAME}} |
项目名称 | MyAwesomeApp |
{{PROJECT_DESCRIPTION}} |
项目简介 | 一个任务管理工具 |
{{DATE}} |
创建/更新日期 | 2025-01-24 |
{{CURRENT_PHASE}} |
当前开发阶段 | 开发中 |
包含占位符的文件:
CLAUDE.md- 主配置文件(必须替换)memory-bank/progress.md- 进度跟踪.claude/ralph-prompts/*.md- Ralph Loop 提示词(如使用)
查找所有占位符:
grep -r "{{" --include="*.md" .可以!这是模板项目。常见可删除文件:
.github/- 如果不需要贡献模板CONTRIBUTING.md,CHANGELOG.md,FAQ.md- 模板项目专用文档- 不使用的语言规则(如 Python 项目删除
cpp-style.md) - 不使用的命令
最少保留:
CLAUDE.md- 核心配置.claude/settings.json- 权限设置- 你使用的语言规则
不需要。如果想要全新开始:
rm -rf .git
git init
git add .
git commit -m "Initial commit from Claude Code template"-
检查 settings.local.json 是否存在:
ls .claude/settings.local.json
如果不存在,从示例复制:
cp .claude/settings.local.json.example .claude/settings.local.json
-
检查脚本权限(Linux/Mac):
chmod +x scripts/*.sh -
检查 Python/Bash 是否可用:
which python which bash
-
检查 Claude Code 版本 - 钩子需要较新版本
编辑 .claude/settings.local.json,删除或注释掉相应的钩子配置:
{
"hooks": {
"PreToolUse": [
// 删除这个块来禁用
// {
// "matcher": "Bash",
// "hooks": [...]
// }
]
}
}这通常发生在 Windows 上。解决方案:
- 确保安装了 Python 3.8+
- 检查文件编码是 UTF-8
- 设置环境变量:
PYTHONUTF8=1
检查这些停止条件:
- 用户中断(Ctrl+C 或 Escape)
progress.md中所有任务已完成- 发生致命错误
- 需要用户决策的外部依赖
恢复方法:再次运行 /cc-best:iterate,它会读取 progress.md 继续。
| 模式 | 控制方式 | 适用场景 |
|---|---|---|
/cc-best:iterate |
完全自主 | 任务清单明确,单 session |
/cc-best:pair |
每步确认 | 学习新技术、敏感操作 |
检查以下位置:
- 命令应该在
commands/目录 - 文件扩展名必须是
.md - 添加新命令后重启 Claude Code
- 每个任务完成后
- 做出重要决策时
- 上下文压缩前(
/cc-best:compact-context) - 会话结束时
运行初始化:
bash scripts/shell/init.sh或者手动从 memory-bank/ 中的模板创建。
- 编辑
.claude/settings.local.json - 添加到
enabledMcpjsonServers:{ "enabledMcpjsonServers": ["memory", "sequential-thinking"] } - 重启 Claude Code
最佳实践:每个项目启用不超过 10 个 MCP 服务器。使用 disabledMcpServers 禁用不用的:
{
"disabledMcpServers": ["github", "vercel"]
}# Linux/Mac:修复脚本权限
chmod +x scripts/*.sh
chmod +x scripts/*.py
# Windows:以管理员身份运行或检查执行策略# 使用 python 而不是 python3
# 或设置别名
alias python3=python- Claude Code 在会话开始时缓存规则
- 修改规则后重启会话
- 或使用
/clear刷新上下文
原因: 路径分隔符或路径中包含空格
解决方案:
-
使用 Git Bash 而非 CMD/PowerShell
Git Bash 对 Unix 风格路径的处理更可靠。
-
确保 Node.js 已安装并在 PATH 中
node --version
应显示 v16 或更高版本。如未安装,从 https://nodejs.org 下载 LTS 版本。
原因: Windows 默认使用 GBK 编码,与 UTF-8 不兼容
解决方案:
方法 1: 设置环境变量(推荐)
PowerShell:
$env:PYTHONUTF8="1"CMD:
set PYTHONUTF8=1方法 2: 永久设置
在系统环境变量中添加:
- 变量名:
PYTHONUTF8 - 变量值:
1
方法 3: 使用 Node.js 脚本
本项目的 hooks 默认使用 Node.js 版本(scripts/node/hooks/),无编码问题。
原因: SessionStart hook 有特殊要求
解决方案:
-
检查 hook 输出是否为 JSON 格式
SessionStart hook 必须输出 JSON,纯文本会报错。参考: claude-code#12671
-
检查路径是否加引号
// ✅ 正确 "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/session-check.js\"" // ❌ 可能出错 "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/session-check.js"
-
检查是否有其他插件冲突
如果安装了多个插件,其他插件的 SessionStart hook 失败也会导致错误。使用
claude --debug查看详细日志。
原因: Git 未安装或未添加到 PATH
解决方案:
- 从 https://git-scm.com/download/win 下载安装 Git
- 安装时勾选:
- "Git Bash Here"
- "Add Git to PATH"
- 验证安装:
git --version
原因: ralph-loop 的 Stop hook 使用 .sh 脚本,Windows 路径处理存在问题
解决方案:
这是上游问题,已报告: claude-plugins-official#288
临时替代方案:
- 使用
/cc-best:iterate命令进行自主循环(cc-best 内置,无需 ralph-loop) - 使用 WSL (Windows Subsystem for Linux)
Plugin installation / 插件安装方式:
# Reinstall to get the latest version / 重新安装获取最新版本
/plugin install cc-best@xiaobei930Clone installation / 克隆安装方式:
cd .claude
git pull origin mainCC-Best works with any existing project. After installing the plugin:
CC-Best 适用于任何已有项目。安装插件后:
-
Initialize project configuration / 初始化项目配置:
/cc-best:setup
This creates
CLAUDE.md,memory-bank/and other project files. Existing files will NOT be overwritten.这会创建
CLAUDE.md、memory-bank/等项目文件。已有文件不会被覆盖。 -
Enable hooks (optional but recommended) / 启用 hooks(可选但推荐):
/cc-best:setup --hooks
-
Start working / 开始使用:
# Autonomous mode / 自主模式 /cc-best:iterate "add dark mode support" # Or pair programming / 或结对编程 /cc-best:pair
💡 Tip / 提示: Run
/cc-best:statusat any time to check your project configuration status. 随时运行/cc-best:status检查项目配置状态。