Skip to content
BENIBIX Learn

InstructionsLoaded Hook

AI⌨️ Claude CodeConfiguration

Also known as InstructionsLoaded, load_reason

The event when a rule file is loaded for Claude.

Think of it like

It is like a library card. It logs each book you take out.

Example

Lucy wonders why Claude follows a rule she forgot about. Her hook logs each file, and she finds an old CLAUDE.md in a subfolder.

Why it matters

It shows which notes Claude is truly reading.

Definition

InstructionsLoaded is the hook event that fires when a CLAUDE.md or rule file loads for Claude to read. Rule files are the ones in .claude/rules. It fires at the start. It fires again when a file loads later, such as a CLAUDE.md in a subfolder Claude opens. The matcher picks the reason. It cannot block, so it is for logs.

Example code

json
{
  "hooks": {
    "InstructionsLoaded": [
      { "matcher": "path_glob_match|nested_traversal", "hooks": [{ "type": "command", "command": "./log-instructions.sh" }] }
    ]
  }
}
Log only the files that load later.

Common mistake

Using it to stop a file from loading. It cannot block or change anything.

Key takeaways

  1. 1
    When a file loads. CLAUDE.md, rules.
  2. 2
    Now or later. Five reasons.
  3. 3
    Log only. No block.