Loading...
Loading...
Compare original and translation side by side
| Hook | Event | Description | Auto-install |
|---|---|---|---|
| PreToolUse | Blocks edits to .env files (security) | Recommended |
| Stop | Shows uncommitted changes when agent stops | Optional |
| PostToolUse | Auto-stages files after edits | Optional |
| UserPromptSubmit | Adds timestamp/dir/branch to prompts | Optional |
| PostToolUse | Runs lint:fix after file edits | Optional |
| SessionStart | Runs linting on session start | Optional |
| PostToolUse | Runs tests after file edits | Optional |
| PreToolUse | Protects shadcn UI components | Optional |
| 钩子名称 | 触发事件 | 描述 | 安装建议 |
|---|---|---|---|
| PreToolUse | 阻止对.env文件的编辑(安全防护) | 推荐 |
| Stop | 当Agent停止运行时,显示未提交的变更 | 可选 |
| PostToolUse | 文件编辑后自动暂存修改 | 可选 |
| UserPromptSubmit | 在提示中添加时间戳/目录/分支信息 | 可选 |
| PostToolUse | 文件编辑后自动运行lint:fix | 可选 |
| SessionStart | 会话启动时自动运行代码检查 | 可选 |
| PostToolUse | 文件编辑后自动运行测试 | 可选 |
| PreToolUse | 保护shadcn UI组件文件不被修改 | 可选 |
undefinedundefinedundefinedundefinedundefinedundefined
Then restart your agent to load the hook.
然后重启Agent以加载钩子。.env.env.local.env.production.env.staging.env.env.local.env.production.env.staginggit add -Agit add -AContext: 2025-01-24 14:32:15 | /Users/you/project | Branch: mainContext: 2025-01-24 14:32:15 | /Users/you/project | Branch: mainbun lint:fixlint:fixbunjqbun lint:fixlint:fixbunjqbunx skills add b-open-io/bopen-tools --skill hook-managerbunx skills add b-open-io/bopen-tools --skill hook-managerrm ~/.claude/hooks/<hook-name>.jsonrm ~/.opencode/hooks/<hook-name>.jsonrm ~/.claude/hooks/<hook-name>.jsonrm ~/.opencode/hooks/<hook-name>.jsonls ~/.claude/hooks/ls ~/.opencode/hooks/ls ~/.claude/hooks/ls ~/.opencode/hooks/undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedclaude --debugclaude --debug