extend: hooklint — lint Claude Code settings.json hooks (the unlinted config surface)#5
Open
deemwario wants to merge 1 commit into
Open
extend: hooklint — lint Claude Code settings.json hooks (the unlinted config surface)#5deemwario wants to merge 1 commit into
deemwario wants to merge 1 commit into
Conversation
New tool in the family. The fleet lints permissions (perm-audit), .mcp.json (mcp-audit), CLAUDE.md (context-lint) and skills (skill-lint) — but nothing checked hooks, which run shell on your agent's tool events and fail SILENTLY when misconfigured (a typo'd event name never fires; an empty command never runs). hooklint reads settings.json and flags: unknown/typo'd event names, hook entries missing type:command or an empty command, a matcher on an event that ignores it, invalid matcher regex, and (heuristic, labelled) relative command paths + risky command patterns. Exit 0 clean / 1 findings / 2 bad input; --json for CI. Honest by construction — checks structure + known pitfalls, not whether a hook's logic is correct. - single-file python3, no deps; test_hooklint.sh 18/18 green (self-locating, one case per check + clean/missing/invalid/stdin/wrong-type robustness). - house-style README with the deemwar.com/contact CTA. MIT.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend:
hooklint— lint Claude Codesettings.jsonhooks#ossengine cycle 11 —
extend the family, additive (new tool dir), no owner gate. Independent of the open PRs.Why
The fleet lints permissions (
perm-audit),.mcp.json(mcp-audit),CLAUDE.md(context-lint), and skills (skill-lint) — but nothing checked hooks, the one config that runs shell on your agent's tool events. A misconfigured hook fails silently: a typo'd event name (PreTooluse) never fires; an emptycommandnever runs.hooklintcatches those before they bite.What it does
Reads
settings.jsonand flags, with honest severity + heuristic labels:UNKNOWN_EVENT— event name not in the valid 9-event set (silent no-op)HOOK_BAD_COMMAND— missingtype:command/ empty commandMATCHER_IGNORED— amatcheron an event that ignores it (only PreToolUse/PostToolUse use it)BAD_MATCHER_REGEX— matcher that won't compileCMD_RELATIVE(heuristic) — relative command path that may not resolveCMD_RISKY(heuristic) —rm -rf/curl … | sh/evalExit
0clean /1findings /2bad input;--jsonfor CI. Honest by construction — it checks structure + known pitfalls, not whether a hook's logic is correct.Verification (independently re-run)
test_hooklint.sh— 18/18 green (≥1 case per check + clean/missing-file/invalid-JSON/stdin/wrong-type).--jsonemits{findings, summary}.deemwar.com/contactCTA. MIT.Self-discovering CI (PR #2) will pick up
test_hooklint.shautomatically on merge.🤖 Generated with Claude Code