🌐 日本語
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
| Document | Content |
|---|---|
| The Role of settings.json | Runtime configuration. Permission control, environment variables |
| Hooks Lifecycle | Event list, Hook types, Exit Codes |
| Why Not Show LLMs | Design rationale for placing outside context |