- Moved all hookify configuration files from `.claude/` to `.claude/hooks/` subdirectory for better organization - Added four new blocking hooks to prevent common error handling anti-patterns: - `block-broad-exception-handler`: Prevents catching generic `Exception` with only logging - `block-datetime-now-fallback`: Blocks returning `datetime.now()` as fallback on parse failures to prevent data corruption - `block-default
1.6 KiB
1.6 KiB
name, enabled, event, action, conditions
| name | enabled | event | action | conditions | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| warn-new-file-search | true | file | warn |
|
⚠️ New File Creation: Search for Existing Code First!
You're creating a new source file. Before proceeding, you MUST search for existing similar code.
Required checks before creating this file:
-
Search for similar names:
Use Grep or find_symbol to search for: - Similar class names - Similar function names - Similar module names -
Check neighboring files:
Use Glob or list_dir to examine: - Files in the same directory - Files in sibling directories - Related modules that might already have this functionality -
Search for similar patterns:
Use search_for_pattern to find: - Similar functionality that could be reused - Base classes that could be extended - Utilities that already solve this problem
Why this matters:
- Code duplication creates maintenance burden
- Existing code may already solve your problem
- Reusing code ensures consistency
- This project forbids creating new modules without justification (see CLAUDE.md)
If similar code exists:
- Extend the existing module instead
- Add to an existing file if appropriate
- Import and reuse existing utilities
If you've already searched: Proceed with file creation. This is just a reminder.
Project reference: See CLAUDE.md section on "Module Creation" - creating new files/modules is forbidden without valid justification.