Skip to main content
hook CX Codex

steinwall — Claude Code hook: what it does, how to install

The steinwall hook for Claude Code and Codex provides cost controls, action guards, and loop recovery for unattended agent sessions with shell execution.

FSL-1.1-MIT ★ 1,596 updated 2026-10-29

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/settings.json
Open on GitHub

What steinwall does

The steinwall hook suite operates locally inside Claude Code and Codex environments. It intercepts agent workflow stages: before and after tool usage, on user prompt submissions, at session initialization, and when subagents shut down. Its built-in mechanisms halt runaway loops, monitor spending limits, check installed extensions, and handle token bounds.

Execution relies on dist/bin/codex-hook.js. The runner executes each hook through Node.js under a 10-second timeout. Reading PLUGIN_ROOT or CLAUDE_PLUGIN_ROOT happens directly inside the JavaScript runtime rather than relying on shell expansion. This ensures uniform behavior across Bash, Windows Command Prompt, and PowerShell.

Node.js must be available locally. While events like PreToolUse evaluate broadly, the PostToolUse trigger filters specifically for Bash executions and apply_patch updates.

What it helps with

  • halt runaway agent loops during lengthy sessions
  • prevent excessive token spending with a local cost brake
  • intercept destructive tool invocations before execution
  • verify installed extensions at session start

Example prompts for the agent

  • Refactor the database layer and run test scripts via Bash
  • Analyze project logs autonomously until all errors are resolved
  • Start a new session and inspect recently modified extensions

How to install steinwall

Manually: put the files in place

.claude/settings.json

The hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json

Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command

Questions about steinwall

How to install steinwall in Claude Code?

Add the hook definitions to .claude/settings.json. The configuration maps events to node -e commands pointing to codex-hook.js.

What does steinwall do?

It provides local safety mechanisms including action interceptors, loop recovery, cost safeguards, and extension scanning. It evaluates triggers during tool execution, prompt submission, and session lifecycle changes.

Which triggers are monitored by steinwall?

The suite attaches to PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, Stop, and SubagentStop. For PostToolUse, it specifically targets Bash and apply_patch calls.

Similar hooks

All hooks for Agent setup: memory, context, orchestration →

From the same set391

The whole set →
tree-ring-memory tree-ring-memory is a Claude Code hook that loads saved context when a session starts and checks memory when it ends. It also runs at subagent start and stop. CX Codex ★ 1,596repo stars tailtest tailtest detects files modified during an agent turn and triggers automated test writing and execution. Works across 8 languages with zero config. CX Codex ★ 1,596repo stars stop-that-shit The stop-that-shit hook for Claude Code and Codex checks agent actions against explicit task modes and bounds decisions about dependencies, hashes, and subagents. CX Codex ★ 1,596repo stars board A SessionStart hook that tells the agent what is on the project board. The board lives in plain Markdown files, so you can read it straight from the terminal. CX Codex ★ 1,596repo stars session-orchestrator session-orchestrator — a hook for Claude Code and Codex that wraps each agent session in structured planning, staged execution, and quality gates. Fires on SessionStart, PreToolUse, PostToolUse, Stop, and SubagentStop. CX Codex ★ 1,596repo stars repopilot repopilot takes a repo snapshot at session start and checks it again before the agent stops. If tests, suppressions or CI gates got weaker, the session will not end quietly. CX Codex ★ 1,596repo stars codex-project-autopilot codex-project-autopilot — a hook for Claude Code and Codex that runs a check after every file write or edit. Fires automatically on PostToolUse events. CX Codex ★ 1,596repo stars praxis This hook loads Praxis triage when a session starts or resumes, so the agent can work toward a defined outcome instead of a step list. CX Codex ★ 1,596repo stars

Project sponsors

Companies that keep this analytics open