Add hook install instructions to README

This commit is contained in:
Knowit
2026-04-18 10:06:09 +08:00
parent e29e3ec91c
commit 73a948fb32

View File

@@ -12,6 +12,42 @@ cp claudeplus/commands/* ~/.claude/commands/
重启 Claude Code 后即可使用。 重启 Claude Code 后即可使用。
### 安装 Stop Hooktoken 用量自动备份)
需要先安装 Go
```bash
sudo apt install golang-go -y
```
编译并配置:
```bash
cd claudeplus/hooks/token-stats-hook
go build -o ~/.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`
## 模块列表 ## 模块列表
| 模块 | 路径 | 说明 | | 模块 | 路径 | 说明 |