Skip to main content

Documentation Index

Fetch the complete documentation index at: https://agentic.proxify.io/llms.txt

Use this file to discover all available pages before exploring further.

You’ll learn: How to treat CLAUDE.md and hooks as a system that improves with every session — and why feedback loops are the primary skill of agentic engineering.
Official reference — For hook event types and configuration, see the official hooks docs. For ready-made recipes, see our Hooks Playbook.

The Discipline

When Claude makes a mistake, you have two choices:
  1. Fix the instance — correct the output, move on
  2. Fix the system — trace why Claude made the mistake, then patch CLAUDE.md or hooks so it can’t happen again
The difference compounds fast:
MistakeFix the instanceFix the system
Claude uses relative importsFind-replace ../../@/ in this fileAdd to CLAUDE.md: “Always use @/ path aliases. Never relative paths for cross-directory imports.”
Claude skips tests before pushRemember to prompt “run tests” next timeAdd a mandatory test step to your task prompt or command template
Claude implements JWT-in-cookies instead of bearer tokensCorrect the auth code manuallyCreate .claude/skills/auth/SKILL.md with your token format and middleware patterns
Option 2 is slower in the moment. After a few weeks of consistent system-level fixes, entire classes of mistakes disappear.

Trace, Patch, Never Repeat

The workflow has four steps. Here’s the first example:
  1. Notice — Claude uses relative imports when your project uses @/ path aliases
  2. Trace — CLAUDE.md says nothing about import conventions
  3. Patch — Add to CLAUDE.md: "Always use @/ path aliases for imports. Never use relative paths (../) for cross-directory imports."
  4. Verify — Future sessions follow the convention
The same pattern applies to any recurring mistake: Tests never run locally:
  1. Notice — CI fails because tests weren’t run before push
  2. Trace — nothing in CLAUDE.md or the task prompt requires a test step
  3. Patch — add to CLAUDE.md: “Run the full test suite before marking any task complete”
  4. Verify — next session ends with a passing test run
Wrong auth pattern:
  1. Notice — Claude implements cookie-based JWT when you use bearer tokens
  2. Trace — no reference document for auth patterns exists
  3. Patch — create .claude/skills/auth/SKILL.md with token format, header conventions, and middleware patterns
  4. Verify — next auth task loads the skill and follows the correct pattern automatically
Every correction is a signal. The question isn’t “how do I fix this output?” but “what’s missing from my system that let this happen?” A useful shorthand after any correction: tell Claude “Update CLAUDE.md so you don’t make that mistake again.” Claude is good at writing rules for itself — keep iterating until the mistake rate drops.

What to Patch Where

SignalPatch targetExample
Claude keeps making the same formatting mistakeCLAUDE.md convention”Use single quotes for strings”
Claude does something dangerousHook (hard block)Block git push --force via PreToolUse hook
Claude’s approach to a task type is consistently wrongSkillCreate a skill for database migrations with your patterns
Claude forgets cross-cutting concerns.claude/rules/ file scoped to the relevant pathTesting requirements for src/api/
CLAUDE.md handles conventions. Hooks enforce safety. Skills encode complex workflows. Rules scope context to specific areas. Use the right tool for the signal. When in doubt, start with CLAUDE.md. If you find yourself adding the same rule to multiple projects, promote it to a skill. If a rule keeps getting violated, promote it to a hook. The progression: suggestion (CLAUDE.md) → scoped context (.claude/rules/) → encoded workflow (skill) → enforced constraint (hook).

Feedback Loops

The core skill of agentic engineering isn’t prompting — it’s designing tight validation loops. The tighter the loop, the faster Claude self-corrects.
LoopMechanismFeedback speed
MicroPostToolUse hook runs linter after every editSeconds
MacroStop hook checks structural requirements when agent finishesMinutes
TeamValidator agent reviews output with fresh contextEnd of task
ManualYou review at the end of a sessionCould be too late
A PostToolUse hook in practice — add this to your .claude/settings.json:
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "command": "npx eslint --fix \"$CLAUDE_FILE_PATH\" 2>&1 || true"
      }
    ]
  }
}
Every file Claude writes gets linted immediately. Claude sees the linter output and fixes issues in the same turn instead of accumulating them. For more recipes, see the Hooks Playbook. An agent with embedded PostToolUse hooks and a Stop script handles 90% of quality issues before a human ever reviews the output. The manual review layer then focuses on integration concerns and architectural correctness — not catching lint errors.

The Compounding Effect

A real system evolution over weeks:
WeekWhat went wrongSystem patchCumulative effect
1Wrong imports, skipped tests, inconsistent naming3 CLAUDE.md rulesClaude follows basic conventions
2Missing barrel exports, wrong error format2 more rules + PostToolUse lint hookFormatting auto-fixes; structural issues caught in review
3Wrong auth pattern, missing input validationAuth skill + API validation skillDomain patterns load automatically
4Agent delivers incomplete outputStop hook checks required files and exportsAgent cannot declare “done” prematurely
6Rare edge cases onlyValidator agent for critical paths90% of issues caught before human review
After finishing each feature, ask Claude: “Read CLAUDE.md and the commands we used. What rules would have prevented the issues we hit?” This turns system evolution from an afterthought into a routine step. Engineers who invest in this consistently report that Claude “gets better” over weeks. The model isn’t improving — their system is. This is the self-improving loop at the practice level.