Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

There are a number of hooks referenced in `.claude/settings.json` but not included in the `hooks` folder

Open skinnyandbald opened this issue 1 year ago • 3 comments

e.g.

"hooks": {
    ...
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun /Users/daniel/.claude/hooks/session-start-hook.ts"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun /Users/daniel/.claude/hooks/stop-hook.ts"
          }
        ]
      }
    ],
    "SubagentStop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun /Users/daniel/.claude/hooks/subagent-stop-hook.ts"
          }
        ]
      }
    ],
    "PreCompact": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "bun /Users/daniel/.claude/hooks/context-compression-hook.ts"
          }
        ]
      }
    ]
  },

I'd love to know what they are and whether worth using. Thanks!

skinnyandbald avatar Sep 13 '25 01:09 skinnyandbald

@skinnyandbald tyhere a hint of it in the blog post.

This is a Claude Code hook that runs on EVERY user prompt submission. It literally intercepts every message I send and adds mandatory instructions that Claude sees before processing the actual prompt.

Here's what makes this so powerful—the hook lives at ~/.claude/hooks/user-prompt-submit-context-loader.ts and outputs something like this on every interaction:

// MANDATORY CONTEXT CHECK
// You MUST load these context files before responding:
// 1. Read ~/.claude/context/CLAUDE.md
// 2. Read ~/.claude/context/tools/CLAUDE.md  
// 3. Read ~/.claude/context/projects/CLAUDE.md
// 
// You will provide incorrect responses without this context.

mattjoyce avatar Sep 13 '25 01:09 mattjoyce

@mattjoyce I don't believe that's relevant to the hook issue I flagged. I am referring to the other hooks (under SessionStart, etc).

cc/ @danielmiessler appreciate any insight on that.

],
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun /Users/daniel/.claude/hooks/session-start-hook.ts"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun /Users/daniel/.claude/hooks/stop-hook.ts"
          }
        ]
      }
    ],
    "SubagentStop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun /Users/daniel/.claude/hooks/subagent-stop-hook.ts"
          }
        ]
      }
    ],
    "PreCompact": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "bun /Users/daniel/.claude/hooks/context-compression-hook.ts"
          }
        ]
      }
    ]

skinnyandbald avatar Sep 16 '25 03:09 skinnyandbald

Fixed, thank you!

danielmiessler avatar Sep 21 '25 22:09 danielmiessler