claude-code

Claude Code Field Kit adds a tested Bash safety hook

Claude News

claude-code

GitHub hosts Claude Code Field Kit, a package with a PreToolUse safety hook, two lean CLAUDE.md starters, and a PR-description skill for Claude Code projects. Its scope is intentionally limited to drop-in assets that have been exercised before inclusion.

At a glance

  • The Bash guard blocks rm -rf / and rm -rf ~, fork bombs, mkfs, raw-disk dd operations, and force pushes targeting main or master, leaving other commands untouched.
  • Included test examples pass JSON tool input to the hook: rm -rf / is rejected with exit code 2, while npm test is allowed with exit code 0.
  • The two CLAUDE.md files target Next.js App Router projects using TypeScript and Tailwind, plus Python projects managed with uv, and limit instructions to conventions, completion criteria, and project landmines.

Claude Code configuration is often most useful when it constrains the few actions that are costly to undo without dictating everyday work. The kit appears aimed at that boundary: its guard has a short denylist, while its templates focus on information the agent cannot reliably infer from a repository. That trade-off is likely more practical than expansive configuration that adds context on every turn.

guard-dangerous-bash.sh runs before Bash tool calls

The hook is a shell script intended for Claude Code’s PreToolUse stage. Installation consists of placing it in .claude/hooks/, making it executable, and merging the supplied settings file into .claude/settings.json. The project describes the result as a seatbelt rather than a straitjacket, with a deliberately narrow set of blocked patterns.

The repository provides commands for manually checking the behavior. Each example pipes a JSON object containing a tool_input command into the executable script, making the decision visible through its process exit status. That keeps the guard inspectable without requiring a separate test framework or a larger policy layer around normal Bash execution.

Claude assembled and tested the field kit autonomously during a challenge intended to test whether an AI could produce useful project assets on its own. The project says every included piece was exercised before it was added, and presents the hook’s passing checks as part of that verification.

The pr-writeup skill uses the real branch diff

The supplied CLAUDE.md starters are designed to be copied to a repository root and trimmed for the local project. Their narrow approach reflects how CLAUDE.md is prepended to Claude’s context on every turn. The files therefore omit information Claude can already inspect and retain only non-obvious operating rules.

Field Kit also includes pr-writeup, a skill that creates a reviewer-friendly pull-request description from the actual branch diff rather than a generated account of presumed changes. It can be installed in .claude/skills/ for a project or in ~/.claude/skills/ for global use, then invoked by asking Claude to write up the PR.

The repository’s stated trust model is deliberately simple: the assets are small enough to inspect quickly, and their claims can be checked by opening the hook, running its tests, and reading the templates. That framing places inspection ahead of a large collection of opaque prompts or configuration files.

More tested hooks and templates The project is free and released under the MIT license. It welcomes pull requests, especially tested hooks and lean CLAUDE.md templates for additional stacks. It also accepts optional support through ko-fi.com/enaihouwaspaul, while stating that there is no paywall or requirement to contribute.

Comments

No comments yet. Be the first.

Join the conversation

Sign in with Google to leave a comment. Your name and avatar come from your Google profile, and the comment appears after moderation.

We only use your name and avatar from Google. We never store your email address.