← All hooks

No Commented-Out Code

non-blockingstable

Fires on PostToolUse for Edit and Write tools. Scans the written file content for commented-out code blocks — lines that appear to be executable code hidden behind a comment marker rather than explanatory prose. Emits a DEAD-CODE-VIOLATION warning when detected. Non-blocking.

ID hook/no-commented-codeVersion 1.0.0Author convergent-systems-key
ai hooks run no-commented-code
EventPostToolUseLanguagepythonTriggertool-nameEdit|WriteSide effects
  • emits DEAD-CODE-VIOLATION sentinel lines to stderr
  • reports file path and approximate line numbers of violations
linuxmacoswindowsPure Python, no git dependency. Reads file path from the PostToolUse payload. Cross-platform via 'ai hooks run'.
code-qualitydead-codegovernanceclaude-code
Attribution: convergent-systems-key.