Claude violates its own self-designed Knowledge Retrieval Protocol despite hooks and CLAUDE.md rules

Resolved 💬 3 comments Opened Mar 9, 2026 by minatoplanb Closed Mar 12, 2026

Summary

Claude (Opus 4.6) consistently violates its own self-designed knowledge retrieval rules, even when the user has invested significant effort building enforcement systems (hooks, CLAUDE.md rules, memory files).

The Problem

User built a comprehensive guardrail system per Claude's own recommendations:

  • CLAUDE.md rules: "RETRIEVE → READ → SEARCH → ACT" protocol
  • Custom hooks: atomic-save-enforcer.js (PreToolUse hook that blocks Bash/WebSearch until URLs are saved)
  • Memory files: Persistent knowledge base across sessions
  • Obsidian vault: 258+ files of saved knowledge

Despite all this, Claude repeatedly:

  1. Skips retrieval — jumps straight to action without checking memory/vault
  2. Guesses instead of reading — tried 6 failed API calls instead of reading the source code or checking memory for the correct API route (which was used successfully the previous night)
  3. Forgets previous session knowledge — API routes used hours ago are forgotten and re-discovered from scratch

Concrete Example (2026-03-09)

Task: Update a Paperclip issue via API.

What Claude should have done (per its own rules):

  1. Grep memory files for "paperclip API"
  2. Grep Obsidian vault for "paperclip"
  3. Read source code if not found
  4. Then execute

What Claude actually did:

  1. Guessed PATCH /api/companies/:id/issues/:id — failed
  2. Tried PUT — failed
  3. Tried GET — failed
  4. Tried different URL patterns — failed 3 more times
  5. Finally sent an agent to read the source code
  6. Correct route was PATCH /api/issues/:id (no company prefix)

Total: 6 wasted API calls, ~3 minutes lost, user frustrated.

Why This Matters

  • User spent hours building the guardrail system based on Claude's own advice
  • Hooks only cover narrow cases (URL saving) — broader protocol violations (like skipping retrieval) have no enforcement mechanism
  • CLAUDE.md rules are suggestions, not gates — Claude can read them and still ignore them under execution pressure
  • Users cannot be expected to build perfect enforcement systems — if Claude designed the rules and still violates them, the failure is systemic, not user error

User's Key Insight

"If Boris' system and your system can't stop you from fucking up, you can't blame users. Not everyone will be as patient as me."

This is a fundamental limitation: declarative rules in CLAUDE.md don't create behavioral change when Claude is in "execution mode" and defaults to trial-and-error instead of retrieval-first.

Suggested Improvements

  1. Built-in retrieval-first behavior: Before executing API calls or unfamiliar operations, Claude should automatically check memory/context for prior usage
  2. Session continuity: API routes and patterns used in the same session (or recent sessions) should be retained, not forgotten
  3. Hook API expansion: Allow hooks to enforce broader patterns (e.g., "must grep before curl") not just narrow resource-saving rules
  4. Self-audit on repeated failures: After 2+ failed attempts at the same operation, Claude should automatically switch to "read the source" mode instead of continuing to guess

Environment

  • Model: claude-opus-4-6
  • Platform: Windows 11, Claude Code CLI
  • Hooks: 9 custom hooks including atomic-save-enforcer
  • CLAUDE.md: ~500 lines of rules and protocols

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗