My coding agents kept forgetting what I told them until I gave every project one shared instructions file

My coding agents kept forgetting what I told them until I gave every project one shared instructions file

Published Nov 27, 2026, 5:30 PM EST Korbin is a Linux system administrator who spends most of his time in a terminal figuring out how things actually work. Over the last decade he's written hundreds of articles about Linux configuration, troubleshooting weird problems, and using open-source tools in the real world. He also works a lot with Windows systems and networking, especially in mixed environments where things don't always behave the way the documentation says they should. Writing things down is how he makes sense of it all and hopefully saves someone else a few hours. Repeating the same instructions to every coding agent I've ever used got old very quickly. I'd tell a model to run `npm run lint` before marking a task complete, then have to remind it the next day to keep doing that. This became an even bigger burden when my set of established coding rules and conventions grew into an unwieldy list that I was pasting across every session. The answer was an AGENTS.md file at the root of every project. It's a simple Markdown file that all agents read when they start up, so they always begin a task with the same level of initial context. I dumped everything in there that I could possibly need an agent to know before getting started, and now I'm able to switch between Claude Code and Codex without needing to repeat anything between the two agents. Every agent gets the same memo One file contains all instructions Every time I fire up a new session with a coding agent, it starts with a fresh context window. Since every project is unique and each developer has their own approach to how things get done, it takes some time for an agent to get familiar with the project and its conventions. From working with Claude Code, I know that it takes its own notes, but those are saved to a temporary filesystem by default and stay on one machine. I've invested a lot of time into making a custom set of rules for each project, making the instructions almost as important as the code itself. That's why I like to commit the AGENTS.md file right alongside the source code. If your project already has a CLAUDE.md file, you will need to add an import inside of it, which is just `@AGENTS.md` on one line. Otherwise, Claude will find the former file and stop looking for more. The AGENTS.md file is supported by Codex, Cursor, Claude Code, and most of the other big names, so it's the perfect place to store instructions that you don't want to tie to a specific company. That's the opposite of a file like CLAUDE.md, which is the recommended place to put Claude-specific instructions. You could also use a README, but I'd argue that's more for human eyes and should house things like installation instructions, while also warranting differently written language. Record everything that's not obvious And the stuff you're sick of repeating At first, I was documenting everything I could inside of AGENTS.md. I think that instinct stemmed from years of writing README files for people who wouldn't bother looking at the code. But AI agents will be perusing the codebase anyway, so there's no reason to be redundant by specifying a bunch of facts that can easily be derived from looking through the source files. Jamming more information than necessary into AGENTS.md just puts it more at risk of something falling out of date, and makes the file more difficult to maintain. It's worth it to take some extra time to think about how your wording will be interpreted by AI. For example, "test your changes" is pretty ambiguous. Instead, I'll tell models to run `npm test` after it's finished with changes, and to fix any errors that arise before committing. For big changes to the UI, I tell the model to spin up a test environment and use Playwright (a browser for testing) to make sure everything looks right. Being vague will get unpredictable results, so I list specifics instead. The file is never really "complete" though. Projects change over time, so I find myself updating the instructions every once in a while. I added another line to the file that says, "If changes you make render a set of instructions in AGENTS.md irrelevant or obsolete, notify the user about it and recommend how it should be updated." That has helped me shift some of the upkeep of the file to the AI models themselves. This won't magically fix problems It just makes prompting AI a bit smoother Throwing all your instructions into this file won't actually make the agent any more powerful. The only thing it really does is save me some keystrokes and keep me from sounding like a broken record. The same amount of work still gets done as before, but now the whole process feels a little smoother than it was. I didn't create the file with the goal to extract more power or efficiency out of whichever model was helping me code that day. It was mainly for my own sanity, because there were a pile of project-specific conventions and quirks that I'd end up repeating every time I opened a new prompt. The biggest sections of my AGENTS.md are "need-to-knows," "project layout," "database info," and "auth and users," all of which contain only the essential rules every agent will need in order to get started. Type it once and never say it again Here's an easy rule of thumb: if you've typed the same instruction across two different agent windows, then it's worth giving that rule its own bullet point in AGENTS.md. Starting with the most common annoyances first is easy, and you'll get a few lines just from that. It'll grow quickly from there, but it feels so good to dive straight into a project without bringing the agent up to speed first.

Original Source

Read the full article at Xda-developers →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.