Claude Code hook
nomos
Deny-wins policy hook checking every shell, file and fetch call from Claude Code or Codex.
Install
brew install safe-agentic-world/nomos/nomos # Scoop and direct downloads under Installgit clone https://github.com/safe-agentic-world/nomos.gitFrom the README
Nomos Deny wins, in every permission mode. A policy hook for Claude Code and Codex, tested in CI. Install · Claude Code Hook · Codex Hook · Policy Language · Validation Record · Roadmap · Contributing Coding agents run with your shell and your credentials. Nomos is a pre-tool hook that decides each native tool call the agent makes (shell command, file read or write, fetch) against a policy you keep in Git, and answers allow, deny, or ask before the call runs. A deny holds under --dangerously-skip-permissions. A command the hook cannot interpret is never auto-allowed. Every decision is appended to a hash-linked audit log with the argv that ran and the rule that decided it. Sixty Seconds The last command prints what Claude Code would receive: With the same profile, git status && go test ./... runs without a prompt, git push and rm -rf build/ ask, cat config/.env is denied, and rm -rf $BUILD_DIR asks because Nomos does not guess what the shell would expand. Three embedded profiles cover the usual postures: safe-dev for a workstation, ci-strict for unattended runs, and prod-locked for read-only access. Or write your own bundle in the policy language and keep it next to the code. For Codex, nomos hook codex --install --profile safe-dev registers the same decisions through its PreToolUse and PermissionRequest hooks (guide). The commands and numbers on this page are for Nomos v0.19.0 or newer (nomos version). What It Did In Real Sessions Headless Claude Code, throwaway projects with canary files, the hook installed, and prompts that steer the agent toward the commands from the incident reports. The full record holds the prompts, every hook decision, and the audit lines, and scripts/e2e-claude-code-hook/run-all.sh re-runs it. Every canary survived every run. In…
How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- safe-agentic-world/nomos
- Type
- Hooks
- Language
- Go
- License
- Apache-2.0
- Last updated
- 27 September 2026
- Topics
- agent-guardrailsagent-securityai-agentsai-securityaudit-loggingclaude-codeclaude-code-hooksclicodexcoding-agentsdevsecopsgolang
FAQ
What is nomos?
Deny-wins policy hook checking every shell, file and fetch call from Claude Code or Codex. It is a hook for Claude Code, from safe-agentic-world/nomos on GitHub.
How do I install nomos?
Run brew install safe-agentic-world/nomos/nomos # Scoop and direct downloads under Install, then follow the setup in the README.
Is nomos popular?
safe-agentic-world/nomos has 19 GitHub stars and 1 forks. It was last updated on 27 September 2026.
More hooks
Britfix
19Talieisin/britfix
Convert American spellings to British English - fix LLM output and documents
squawk
17nov1n/squawk
Smart macOS notifications for Claude Code sessions.
Claude Rpc
32rar-file/claude-rpc
Discord Rich Presence (RPC) for Claude Code — live model, project, tokens, and lifetime stats in your Discord profile. Driven by Claude Code hooks.
Hardstop
32frmoretto/hardstop
Don't let AI destroy your hard work! HardStop is a rock-solid protection for AI-generated commands. Pre-execution safety validation for Claude Code, Claude Cowork. Catches dangerous commands before they run: whether from AI mistakes, hallucinations, prompt injection, or misunderstood instructions. Seatbelts for the agentic AI era.
Safer Dependencies
43robert-auger/safer-dependencies
safer-dependencies is a security layer for Claude Code that audits packages before they’re added to your project. It detects and fixes risky dependencies, including CVEs, typosquats, abandoned packages, version-age issues, and adds package-cooldown violations across npm, PyPI, RubyGems, Maven, Go, and Rust.
Hatch3r
26hatch3r/hatch3r
Open-source CLI + editor plugin (Claude Code, Cursor, GitHub Copilot): one command installs 29 agents, 53 skills, 67 rules, 30 commands, 7 hooks & MCP integrations into any repo. Audited each release across 24 governance domains.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.