Skip to content

🌐 日本語

Part 7: The Layer LLMs Don't See — Settings & Hooks ​

NOTE

Control outside the context. Consumes zero context budget.
Place verification here that does not rely on LLM judgment.
settings.json and Hooks are representative examples in Claude Code. Putting mechanical checks outside the model is not product-specific.

Why It Exists ​

If you instruct an LLM to "run eslint every time," it consumes context window capacity and may forget (Instruction Decay). Hooks enforce execution at the runtime level, consuming no instruction frame in the LLM and ensuring reliable execution.

Principle: Place rules requiring judgment in CLAUDE.md / Rules; place mechanically enforceable rules in Hooks.

→ Why: Which Structural Problems Does It Address? ​

IMPORTANT

  • Hallucination: Test execution Hooks mechanically detect hallucinated outputs
  • Sycophancy: Compilers and test runners don't follow along. Objective verification
  • Instruction Decay: Not dependent on context, ensuring reliable execution even in long conversations
  • Context Budget: Zero budget consumption. The most budget-efficient solution

Documentation for This Part ​

DocumentContent
The Role of settings.jsonRuntime configuration. Permission control, environment variables
Hooks LifecycleEvent list, Hook types, Exit Codes
Why Not Show LLMsDesign rationale for placing outside context

前へ: Part 6: Context as Tool Definition

次へ: Part 8: Session Management and Memory Persistence

Released under the CC BY 4.0 License.