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.

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.

Use an AI assistant like Claude Code to create a persistent corporate memory. Instruct it to save valuable artifacts like customer quotes, analyses, and complex SQL queries into a dedicated Git repository. This makes critical, unstructured information easily searchable and reusable for future AI-driven tasks.

To improve an agent's performance on a specific task like prompting the VO3 video model, create a dedicated 'onboarding document'. Use a tool like Perplexity to gather best practices from experts, compile them into a doc, and instruct the agent to reference it. This shortcuts the learning curve and embeds expertise.

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.

Don't try to create a comprehensive "memory" for your AI in one sitting. Instead, adopt a simple rule: whenever you find yourself explaining context to the AI, stop and immediately have it capture that information in a permanent context file. This makes personalization far more manageable.

Instead of codebases becoming harder to manage over time, use an AI agent to create a "compounding engineering" system. Codify learnings from each feature build—successful plans, bug fixes, tests—back into the agent's prompts and tools, making future development faster and easier.

Instead of a complex database, store content for personal AI tools as simple Markdown files within the code repository. This makes information, like research notes, easily renderable in a web UI and directly accessible by AI agents for queries, simplifying development and data management for N-of-1 applications.

Long-running AI agent conversations degrade in quality as the context window fills. The best engineers combat this with "intentional compaction": they direct the agent to summarize its progress into a clean markdown file, then start a fresh session using that summary as the new, clean input. This is like rebooting the agent's short-term memory.

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.