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
2.5k2 skills8 hooks
Install
> /plugin marketplace add lennney/stop-that-shit
> /plugin install stop-that-shit@stop-that-shit

Ships with stop-that-shit. Installing the plugin gets these hooks.

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.

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.

Get the whole plugin
Stats
2,504
Stars
54
Forks
Active
Maintenance
JavaScript
Language
MIT
License
12h ago
Last commit
1mo ago
Created
8h ago
Added

Repo: lennney/stop-that-shit