@flowrail/hook
v0.0.24
Published
FlowRail PreToolUse hook dispatcher for Claude Code. Pre-write secret scan + LLM-backed code verifier; pre-bash supply-chain check via the FlowRail MCP server.
Readme
@flowrail/hook
FlowRail's hook dispatcher for Claude Code. It intercepts every Write/Edit/MultiEdit and Bash call your coding agent makes and routes it through FlowRail's security verification pipeline before the change lands.
Sub-commands:
flowrail-hook pre-write— reconstructs the post-edit file content (plain Write, Edit withreplace_all: false/true, and MultiEdit composition), runs a local secret scan and lockfile diff, and verifies code files against your active design review's guardrails via the FlowRail server'sflowrail_verify_codeMCP tool.flowrail-hook pre-bash— inspectstool_input.command, resolves the dependency tree withnpm install --dry-runon package-install patterns, and runs FlowRail's 4-signal supply-chain check via theflowrail_check_dep_installMCP tool.flowrail-hook stop/session-start— turn-batched whole-app composition review (the cross-file authN/authZ pass no per-file verify can see) and its session-start coverage catch-up.flowrail-hook capabilities— prints{name, version, subcommands}for version-skew checks.
Configuration
FLOWRAIL_MCP_URL— FlowRail server base URL (defaulthttp://localhost:8787; the hosted service ishttps://api.flowrail.ai).FLOWRAIL_API_KEY— your API key. Sign up and mint one at flowrail.ai/settings/keys.
The installer (@flowrail/init) bakes the server URL into the hook command line in .claude/settings.json (tracked, no credential), but it never writes your API key to a tracked file — the key lives only in your shell environment. The hook inherits FLOWRAIL_API_KEY from whatever shell launched Claude Code, so keep it exported (e.g. via ~/.zshrc) so every session picks it up.
Install
You normally don't install or invoke this package directly — the one-shot installer wires everything up:
npx @flowrail/init@latestLinks
- Website: https://flowrail.ai
- Docs: https://flowrail.ai/docs
