The easiest way to teach Claude Code is to instruct it: "Don't make this mistake again; add this to `claude.md`." Since this file is always included in the prompt context, it acts as a permanent, evolving set of instructions and guardrails for the AI.

Related Insights

The all-caps `clod` file, created via the `init` command, stores project structure and user-defined rules. Unlike temporary in-chat instructions that get lost or degraded as the conversation continues, this file is referenced in every session, ensuring consistent behavior and enforcing project-wide guardrails.

To prevent an AI agent from repeating mistakes across coding sessions, create 'agents.md' files in your codebase. These act as a persistent memory, providing context and instructions specific to a folder or the entire repo. The agent reads these files before working, allowing it to learn from past iterations and improve over time.

To maximize an AI assistant's effectiveness, pair it with a persistent knowledge store like Obsidian. By feeding past research outputs back into Claude as markdown files, the user creates a virtuous cycle of compounding knowledge, allowing the AI to reference and build upon previous conclusions for new tasks.

Instead of manually providing context in each prompt, use Claude Code's 'append system prompt' command. This preloads crucial information, like architectural diagrams, at the start of a session, leading to faster and more accurate AI responses without repeated file reads.

Kieran Klaassen's "Compound Engineering" philosophy involves planning, working, assessing, and then codifying learnings. This feedback loop teaches the AI what it did wrong, ensuring it won't repeat the same mistakes and making it progressively better with each use.

Claude Code's terminal-based interaction within a specific folder allows it to automatically read and reference local files. This makes "context engineering" drastically faster and more powerful than manually pasting information into a traditional chat interface, as the context is implicitly understood.

The 'Claudie' AI project manager reads a core markdown file every time it runs, which acts as a permanent job description. This file defines its role, key principles, and context. This provides the agent with a stable identity, similar to a human employee, ensuring consistent and reliable work.

To get consistent, high-quality results from AI coding assistants, define reusable instructions in dedicated files (e.g., `prd.md`) within your repository. This "agent briefing" file can be referenced in prompts, ensuring all generated assets adhere to a predefined structure and style.

The 'agents.md' file is an open format that functions like a README, but specifically for AI agents. It provides a dedicated, predictable place to store context and instructions, ensuring the AI consistently follows rules for commits, tests, and project setup across all your repositories.

Teams maintain a shared `Claude.md` text file in their Git repo. Anytime the AI errs, they add corrections or context to this file. This acts as a constantly improving, team-wide knowledge base that teaches the AI how to work correctly within their specific project, creating a compounding effect.