Skip to content
Hooks
Hook

Hooks

What stop-that-shit runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
stop-that-shit
4k2 skills8 hooks

Claude Code

> /plugin marketplace add lennney/stop-that-shit
> /plugin install stop-that-shit@stop-that-shit

What fires, and when

SessionStart

Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.

  • Matches*node "${CLAUDE_PLUGIN_ROOT}/hooks/stop-that-shit-claude.cjs"

UserPromptSubmit

Fires before Claude sees each prompt you send. A plugin can use it to inject context, so the same instruction reaches the model every turn instead of only at session start.

  • node "${CLAUDE_PLUGIN_ROOT}/hooks/stop-that-shit-claude.cjs"

PostToolUse

  • Matches*node "${CLAUDE_PLUGIN_ROOT}/hooks/stop-that-shit-claude.cjs"

PreToolUse

  • Matches*node "${CLAUDE_PLUGIN_ROOT}/hooks/stop-that-shit-claude.cjs"

SessionEnd

  • Matches*node "${CLAUDE_PLUGIN_ROOT}/hooks/stop-that-shit-claude.cjs"

SubagentStart

  • Matches*node "${CLAUDE_PLUGIN_ROOT}/hooks/stop-that-shit-claude.cjs"

PostToolUseFailure

  • Matches*node "${CLAUDE_PLUGIN_ROOT}/hooks/stop-that-shit-claude.cjs"

PermissionDenied

  • Matches*node "${CLAUDE_PLUGIN_ROOT}/hooks/stop-that-shit-claude.cjs"
Read hooks/hooks.json

In the plugin's words

How stop-that-shit describes its own hook set.

Stop That Shit for Claude Code: local-first execution control for mode, scope, dependencies, hashing, and delegation.

Where it lives

  • hooks/stop-that-shit-claude.cjsRunsGitHub
    Read the script
    #!/usr/bin/env node
    
    'use strict';
    
    const { handleClaudeHook } = require('../src/adapters/claude-hooks.cjs');
    
    function readStdin(maxWaitMs = 1500) {
      return new Promise((resolve) => {
        let settled = false;
        let body = '';
    
        const finish = () => {
          if (settled) return;
          settled = true;
          clearTimeout(timer);
          resolve(body);
        };
    
        const timer = setTimeout(finish, maxWaitMs);
        process.stdin.setEncoding('utf8');
        process.stdin.on('data', (chunk) => {
          body += chunk;
        });
        process.stdin.on('end', finish);
        process.stdin.on('error', finish);
        process.stdin.resume();
      });
    }
    
    (async () => {
      try {
        const raw = await readStdin();
        if (!raw.trim()) return;
    
        const input = JSON.parse(raw);
        const output = handleClaudeHook(input);
        if (output) {
          process.stdout.write(`${JSON.stringify(output)}\n`);
        }
      } catch (error) {
        const errorName = error && error.name ? error.name : 'HookError';
        process.stderr.write(`Stop That Shit Claude hook failed open: ${errorName}\n`);
      }
    })();
    
  • hooks/stop-that-shit.cjsGitHub
    Read the script
    #!/usr/bin/env node
    
    const { handleHook } = require('../src/hook-policy.cjs');
    
    function readStdin(maxWaitMs = 1500) {
      return new Promise((resolve) => {
        let settled = false;
        let body = '';
    
        const finish = () => {
          if (settled) return;
          settled = true;
          clearTimeout(timer);
          resolve(body);
        };
    
        const timer = setTimeout(finish, maxWaitMs);
        process.stdin.setEncoding('utf8');
        process.stdin.on('data', (chunk) => {
          body += chunk;
        });
        process.stdin.on('end', finish);
        process.stdin.on('error', finish);
        process.stdin.resume();
      });
    }
    
    (async () => {
      try {
        const raw = await readStdin();
        if (!raw.trim()) return;
    
        const input = JSON.parse(raw);
        const output = handleHook(input);
        if (output) {
          process.stdout.write(`${JSON.stringify(output)}\n`);
        }
      } catch (error) {
        const errorName = error && error.name ? error.name : 'HookError';
        process.stderr.write(`Stop That Shit hook failed open: ${errorName}\n`);
      }
    })();
    

Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.

@lennney
Ships withstop-that-shit

Stop That Shit(别再造史了)|面向 Codex/GPT 场景的多平台 Hook + Skill Guard:拦截 AI coding agent 无需求的哈希、校验和与任务范围膨胀。 A multi-platform Hook + Skill Guard for AI coding agents in Codex/GPT workflows: stop unrequested hashes, checksums, and task-scope creep.

Stars on GitHub

Momentum

stars in total
4.0k
Star history of lennney/stop-that-shit on GitHub, a chart by star-history.com

More plugins that ship hooks.

prompt-improver

prompt-improver

Enriches vague prompts for Claude Code with targeted research and clarifying questions before execution. It injects relevant context at prompt submit, tool use, and subagent start so Claude has what it needs before acting.

1 skill3 hooks2k
@severity1@severity1
Install Plugin
probity

probity

Probity forces AI coding agents to follow your rules. It hooks into your agent and checks every file write and shell command before it happens. When an action breaks a rule, Probity blocks it and tells the agent why.

1 hook251
@nizos@nizos
Install Plugin
token-saver

token-saver

Keep the signal. Stop rereading the same failures. Token-Saver compresses the terminal output your AI coding assistant reads, git diff, pytest, npm install, terraform plan, kubectl, docker, to leave more room for the code, instructions, and next decision.

1 skill+2166
@ppgranger@ppgranger
Install Plugin

Questions about the hooks in stop-that-shit.

Which coding agents can use the hooks in stop-that-shit?
The hooks in stop-that-shit install in Claude Code and Cursor: each runs Claude Code hooks from .claude/settings.json, so copy the hooks there.