feat: ship a Claude Code plugin that finds and bwraps the checker - #69
Merged
Conversation
The hook locates comment-checker on PATH or via direnv, names flake.nix when that is why it is missing, and runs a native binary under bwrap when bubblewrap is present. It passes --strip. Deno is required.
The launcher is a thin PATH/direnv/bwrap exec. Those tests did not defend an observable contract.
Stop hand-written tagged unions. Resolve config from hooks/deno.jsonc. Invoke the script by path so hooks.json does not repeat the shebang.
dprint already owns formatting.
Launch was a self-asserted tagged union. Env is the untrusted boundary: trim and non-empty CLAUDE_PROJECT_DIR, PATH split to entries. One walk collects comment-checker, bwrap, and direnv; bind-root exists run together.
string.trim |> string > 0 is valid arktype. It also looks like a numeric compare. Pipe the trim morph into atLeastLength(1) instead.
The hook does not walk PATH, read ELF magic, or build a bwrap profile. Sandboxing stays in the nix wrapper.
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.
The checker was a binary you had to wire by hand. This repo is now also a Claude Code plugin.
The hook locates
comment-checkeron PATH, then viadirenv exec. If both miss and the project hasflake.nix, the error namesdirenv allow/nix develop. A native ELF/Mach-O binary is run underbwrapwhen bubblewrap is installed; a wrapper that already calls bwrap is left alone. The hook passes--strip. Deno must be on PATH.claude --plugin-dir .