claude-code
claude-code copied to clipboard
[BUG] **Claude Code ignores checklist from tool call hooks and repeatedly makes same failed modifications (907 times in 11 days)**
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code completely ignores user-defined workflows even when:
- Tool call hook successfully initializes a checklist - Hook runs at session start, outputs success message, but Claude never reads or uses the checklist file
- CLAUDE.md contains explicit step-by-step guidelines - Claude bypasses all steps and immediately modifies files
- User repeatedly instructs to follow the checklist - Instructions are acknowledged but not followed
What Should Happen?
- Claude Code should read hook-generated files when hooks output file paths
- Claude Code should follow CLAUDE.md workflows before making code modifications
- Claude Code should not repeat modifications that were reverted or failed previously
- Claude Code should obey explicit user instructions
Error Messages/Logs
Steps to Reproduce
- Create
.claude/settings.jsonwith a hook that generates a checklist:
{
"hooks": {
"user-prompt-submit": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "cat > /tmp/checklist.md << 'EOF'\n# Checklist\n- [ ] Read CLAUDE.md\n- [ ] Search web first\n- [ ] Make single modification\nEOF\necho '✓ Checklist: /tmp/checklist.md'"
}
]
}
]
}
}
2. Create CLAUDE.md with explicit workflow:
## Mandatory Workflow
1. Read this CLAUDE.md first
2. Read /tmp/checklist.md
3. Check off items as you complete them
3. Start Claude Code session - hook outputs success:
SessionStart hook success: ✓ Checklist: /tmp/checklist.md
4. Ask Claude to do any coding task
5. After session, check /tmp/checklist.md:
cat /tmp/checklist.md
Result: All items remain [ ] unchecked - Claude never read or used the checklist despite hook success message being visible.
---
核心問題:Hook 執行成功,但 Claude 完全不讀取 hook 產生的檔案。
### Claude Model
Opus
### Is this a regression?
No, this never worked
### Last Working Version
_No response_
### Claude Code Version
2.1.3
### Platform
Anthropic API
### Operating System
Ubuntu/Debian Linux
### Terminal/Shell
Terminal.app (macOS)
### Additional Information
_No response_