tool.execute.after hook on Write, Edit, and MultiEdit operations.
Overview
AI models often generate generic, low-value comments like:Architecture
Source:
src/hooks/comment-checker/hook.ts:31
Hook Implementation
Supported Tools
Write
Checks full file content
Edit
Checks oldString/newString diff
MultiEdit
Checks all edits array
apply_patch tool metadata extraction
Detection Patterns
The comment-checker CLI uses AST-based detection for:Generic Initializers
Helper Function Comments
Redundant Descriptions
CLI Runner
Source:src/hooks/comment-checker/cli-runner.ts
The hook uses an external CLI binary for AST-based detection:
packages/comment-checker/
Configuration
Enable/Disable
Custom Prompt
src/config/schema/comment-checker.ts
Error Injection
When slop is detected, the hook modifies the tool result:Pending Call Management
Source:src/hooks/comment-checker/pending-calls.ts
Tracks Write/Edit calls from before → after hooks:
Debug Mode
Enable verbose logging:/tmp/comment-checker-debug.log
Package Structure
Source:packages/comment-checker/
Separate package with platform binaries:
Tool Failure Handling
Skips check if tool execution failed:Integration with Anti-Patterns
Source:AGENTS.md and .sisyphus/rules/
Comment checker enforces repository-wide anti-patterns:
Source Files
Hook Implementation (5 files)
Hook Implementation (5 files)
src/hooks/comment-checker/hook.ts- Main hook logicsrc/hooks/comment-checker/cli-runner.ts- CLI executionsrc/hooks/comment-checker/pending-calls.ts- Call trackingsrc/hooks/comment-checker/types.ts- Type definitionssrc/hooks/comment-checker/index.ts- Barrel exports
Configuration (1 file)
Configuration (1 file)
src/config/schema/comment-checker.ts- Zod schema
CLI Package (separate)
CLI Package (separate)
packages/comment-checker/- Standalone CLI package
Related
Hooks
Tool Guard hooks including comment-checker
Tools
Write, Edit, MultiEdit tools that trigger checks