Clément Bertillon outlines a practical strategy for reducing prompt overhead in Symfony projects by combining a dual-layer AGENTS.md structure with a local, Git-tracked LLM Wiki. This approach allows coding assistants to retain persistent context without heavy RAG pipelines, enabling developers to write minimalist prompts while maintaining strict control over their technical documentation and architectural decisions.

Developers using coding assistants like Claude Code or Codex often face a recurring frustration: the agent lacks persistent memory of project-specific conventions, such as Symfony architecture preferences, PHP standards, or Doctrine naming rules. This forces engineers to spend significant time writing detailed preambles in every prompt, reducing productivity. To address this, Bertillon proposes a lightweight solution that avoids heavy RAG pipelines or proprietary cloud dependencies by leveraging a dual-layer AGENTS.md structure paired with the LLM Wiki pattern, a concept popularized by Andrej Karpathy.

The first step involves structuring instructions across two distinct layers. The project-level AGENTS.md file defines specific conventions for the current Symfony application, including stack details, coding standards, and quality gates like PHPStan and php-cs-fixer. The user-level file, located in directories like ~/.claude/CLAUDE.md, stores personal preferences and global defaults, such as language requirements or safety checks for destructive database commands. These files can be symlinked to a single source file to simplify maintenance. However, this approach hits a technical ceiling due to context window limits, with Anthropic and OpenAI recommending that these files remain under 200 to 300 lines to prevent model saturation.

To scale beyond these limits, the LLM Wiki pattern introduces a local, Markdown-based knowledge base. This structure, organized into folders like projects/, tech/, and people/, allows the agent to load only relevant files on demand. The index.md acts as a routing table, guiding the agent to specific documents based on the task. This method not only reduces context clutter but also enables the agent to update the wiki after significant refactoring sessions, with changes tracked via Git. Ultimately, this setup transforms prompt writing, allowing for concise inputs that the agent resolves through automatic navigation within the local knowledge base. This aligns with Symfony’s philosophy of clean, maintainable code, offering a transparent, version-controlled alternative to black-box AI memory solutions. Good read!

[Read More]

Tags ai-and-machine-learning software-engineering how-to backend-development