# steinwall

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

- hook · `type=hook` · Claude Code, Codex · ★ 1596 repo stars
- Author: Maximilian Steinmetz
- License: FSL-1.1-MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hashgraph-online/awesome-codex-plugins/tree/HEAD/plugins/maxxstm/steinwall/hooks/codex-hooks.json
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text and 3 script files) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/hooks/steinwall

## What it 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.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/settings.json` — The hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hashgraph-online/awesome-codex-plugins/tree/HEAD/plugins/maxxstm/steinwall/hooks/codex-hooks.json

## When to use it
- 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
- 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

## Similar
- [k-skill-setup](https://affpapa.org/en/nevibecode/skills/k-skill-setup.md) — skill · 13800 installs
- [rivet-secure-exec](https://affpapa.org/en/nevibecode/skills/rivet-secure-exec.md) — skill · 1400 installs
- [jwt-validate](https://affpapa.org/en/nevibecode/skills/jwt-validate.md) — skill · 672 installs
- [dependency-auditor](https://affpapa.org/en/nevibecode/skills/onewave-ai-dependency-auditor.md) — skill · 323 installs
- [clawsec-clawhub-checker](https://affpapa.org/en/nevibecode/skills/clawsec-clawhub-checker.md) — skill · 259 installs
- [octoguard-openclaw-security-supervision](https://affpapa.org/en/nevibecode/skills/octoguard-openclaw-security-supervision.md) — skill · 168 installs

From the same set: [hashgraph-online/awesome-codex-plugins](https://affpapa.org/en/nevibecode/by/hashgraph-online/awesome-codex-plugins.md) — 391 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
