Skip to content

🌐 日本語

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

NOTE

Control outside the context. Consumes zero context budget. Place verification mechanisms here that don't rely on LLM judgment.

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.