Skip to main content
hook CX Codex

stop-that-shit — Claude Code hook: what it does, how to install

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.

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 stop-that-shit does

stop-that-shit adds a local policy layer for Codex and Claude Code. It works with explicit task modes, checks actions before they run, and places bounds on decisions involving dependencies, hashes, and subagents.

The hook runs on UserPromptSubmit, PreToolUse, PostToolUse, and SessionEnd. Its post-tool matcher covers spawn_agent, Agent, wait_agent, and related names. The handler is loaded from hooks/stop-that-shit.cjs through node; pre-tool checks have a 5-second timeout, while the session-end check has a 3-second timeout. The plugin layout must keep that handler path intact.

What it helps with

  • keep agent work inside a defined scope
  • check an action before a tool call
  • bound dependency and hash decisions
  • track subagent spawning and waiting
  • run a check when a session ends

Example prompts for the agent

  • Work only within the current task scope and check each action before calling a tool.
  • Before spawning a subagent, verify that the decision stays within the task boundaries.
  • When the session ends, run the final state check for the task.

How to install stop-that-shit

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 stop-that-shit

How do I install stop-that-shit in Claude Code?

Add the hook configuration through .claude/settings.json.

What does stop-that-shit do?

It adds local task-scope checks, reviews actions around tool calls, and bounds decisions about dependencies, hashes, and subagents.

Which events trigger stop-that-shit?

It runs on UserPromptSubmit, PreToolUse, PostToolUse, and SessionEnd. Its post-tool matcher also covers subagent-related calls.

Source text

codex-hooks.json · MIT
Hooks bundle shipped with the stop-that-shit plugin for Claude Code.

Local-first scope guard for Codex with explicit task modes, before-action checks, and bounded dependency, hash, and subagent decisions.

Triggers on: PreToolUse, PostToolUse, UserPromptSubmit, SessionEnd.

```json
{
  "description": "Stop That Shit: a small on-demand policy with a few high-confidence Codex gates.",
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "node -e \"const p=require('node:path');require(p.join(process.env.PLUGIN_ROOT??process.env.CLAUDE_PLUGIN_ROOT,'hooks','stop-that-shit.cjs'))\"",
            "timeout": 5
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "^(?:spawn_agent|Agent|wait_agent|multi_agent_v1wait_agent|collaborationspawn_agent|collaborationwait_agent)$",
        "hooks": [
          {
            "type": "command",
            "command": "node -e \"const p=require('node:path');require(p.join(process.env.PLUGIN_ROOT??process.env.CLAUDE_PLUGIN_ROOT,'hooks','stop-that-shit.cjs'))\"",
            "timeout": 5
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "node -e \"const p=require('node:path');require(p.join(process.env.PLUGIN_ROOT??process.env.CLAUDE_PLUGIN_ROOT,'hooks','stop-that-shit.cjs'))\"",
            "timeout": 5,
            "statusMessage": "Checking the Stop Ladder..."
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "node -e \"const p=require('node:path');require(p.join(process.env.PLUGIN_ROOT??process.env.CLAUDE_PLUGIN_ROOT,'hooks','stop-that-shit.cjs'))\"",
            "timeout": 3
          }
        ]
      }
    ]
  }
}

```

© Stop That Shit contributors · MIT · hashgraph-online/awesome-codex-plugins

Similar hooks

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

From the same set391

The whole set →
wtfm wtfm generates illustrated end-user help articles from codebase files and renders screenshots locally from the actual interface code. CX Codex ★ 1,596repo stars vibestretch vibestretch is a Claude Code hook that prints a stretch or eye-rest prompt and plays a soft chime after the agent has kept you waiting. It runs on prompt submission, tool use, and agent stop. CX Codex ★ 1,596repo stars 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 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 steinwall The steinwall hook for Claude Code and Codex provides cost controls, action guards, and loop recovery for unattended agent sessions with shell execution. 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

Project sponsors

Companies that keep this analytics open