Files
claudeplus/README.md
Knowit 6406ef36a5 Add global CLAUDE.md with behavioral guidelines
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 21:15:21 +08:00

72 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# claudeplus
Claude Code 自定义命令集合。
## 安装
```bash
git clone https://git.deepknow.site/Knowit/claudeplus.git
mkdir -p ~/.claude/commands
cp claudeplus/commands/* ~/.claude/commands/
```
重启 Claude Code 后即可使用。
### 安装 Stop Hooktoken 用量自动备份)
```bash
cp claudeplus/hooks/token-stats-hook/token-stats-hook-bin ~/.claude/token-stats-hook-bin
chmod +x ~/.claude/token-stats-hook-bin
```
`~/.claude/settings.json` 中加入以下配置(如已有其他 hooks 注意合并):
```json
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/token-stats-hook-bin 2>/dev/null || true"
}
]
}
]
}
}
```
重启 Claude Code 后,每次会话结束时会自动将 token 用量追加到 `~/.claude/token-stats-backup.jsonl`
## 模块列表
| 模块 | 路径 | 说明 |
|------|------|------|
| 命令集 | `commands/` | Claude Code 自定义斜杠命令 |
| Stop Hook | `hooks/token-stats-hook/` | 会话结束时自动备份 token 用量Go 二进制) |
| 全局 CLAUDE.md | `CLAUDE.md` | 通用行为准则,减少常见 LLM 编码失误 |
### 安装全局 CLAUDE.md
```bash
cp claudeplus/CLAUDE.md ~/.claude/CLAUDE.md
```
放置在 `~/.claude/CLAUDE.md` 后会对所有项目生效,可与项目内的 `CLAUDE.md` 合并使用。
---
## 命令列表
### /token-stats [username|all]
-
统计本机 Claude token 用量,按日期分组展示。建议在 root 用户下使用,否则只能统计当前用户的数据。
```
/token-stats # 当前用户
/token-stats charles # 指定用户
/token-stats all # 所有用户(含 root
```