AGENTS.md vs. System Prompt: Scope, Priority, and Purpose

AGENTS.md is a file in your repository that AI coding tools read automatically. A system prompt is a message an application sends with every API request. They serve different purposes and neither replaces the other.

Updated 5 min read

AGENTS.md is a Markdown file committed to a repository that AI coding tools read at the start of each session to learn project-specific conventions. A system prompt is a message an application sends with every API request to configure how the model behaves in that application. Both give an AI assistant instructions, but they operate at different scopes and serve different purposes. Tools like fenbs hold the decisions, rules and progress that belong in neither: the live project record that changes as work progresses.

Choosing correctly between the two, and knowing what belongs in each versus what belongs in a shared project record, keeps instructions current and prevents them from conflicting.

What is AGENTS.md?

AGENTS.md is a convention for a Markdown file at the root of a repository that AI coding tools, including Claude Code, read automatically when they open a session in that directory. The file typically contains the project's language, framework, coding conventions, build commands, testing approach and any constraints that should apply to every AI session in that codebase.

The key property is that it is part of the repository. It is checked in with the code, versioned alongside it and available to any tool that supports the convention. Team members who join the project and connect an AI coding tool get the same instructions automatically. For examples of what to include, see AGENTS.md examples.

Not every coding tool reads AGENTS.md. Claude Code does. Tools that use different file names, like GEMINI.md for Gemini CLI, follow the same principle with a different convention. Does Claude Code read AGENTS.md? and does GitHub Copilot support AGENTS.md? cover the current support status for those tools.

What is a system prompt?

A system prompt is a message an application sends to the model with every API request, before the user's input. It tells the model what role it plays in that application, how it should format output, what it is and is not allowed to do, and any standing instructions that apply to every conversation in that app.

A system prompt is set by the application developer or the platform, not by the user or the repository. When you use a custom GPT, a configured Claude project, or any AI-powered product, there is usually a system prompt behind the interface that shapes the model's behavior. For examples and patterns, see system prompt examples.

The key property is that a system prompt is outside the codebase. It is not checked into the repository, and it is not visible to someone reading the source code unless the developer chooses to share it. It applies at the application level, not the repository level.

How they differ

AGENTS.md vs system prompt comparison
AGENTS.mdSystem prompt
LocationCommitted to the repositorySet by the application, outside the codebase
ScopeOne repository or project directoryEvery conversation in a given application
Who sets itThe development team, via version controlThe application developer or platform
VisibilityAnyone with repository accessUsually private to the app developer
ChangesVia a commit; versioned historyVia the app configuration; no shared history
Best forCode conventions, build commands, project constraintsApplication persona, global formatting rules, safety instructions

Which takes priority?

When both are present, the application's system prompt typically takes priority over an instruction file because the system prompt reaches the model first in the context hierarchy. In Claude Code, a system prompt set by the application combining Claude Code's capabilities with a custom configuration would outrank the AGENTS.md. In a direct Claude Code session with no application wrapper, the AGENTS.md instructions are prominent in the starting context.

In practice, conflicts between AGENTS.md and a system prompt are unusual because they operate at different levels. AGENTS.md says how code in this repository should be written; a system prompt says how the application should behave. A conflict usually means one of them is trying to control something the other should own.

How fenbs helps

Save shared prompts and approved instructions

Create a free account, add your project, and save approved prompt patterns and reusable skills in fenbs. When a prompt standard applies across tools, writing it once in fenbs means every connected assistant reads it from the same source. Use AGENTS.md and system prompts for what they are designed for; use fenbs for the shared decisions and prompts that the static files cannot keep current.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

What belongs in each

AGENTS.md is the right place for project-specific facts that every coding session needs and that belong with the code: naming conventions, forbidden patterns, test commands, architecture notes, pointers to important files.

A system prompt is the right place for application-level configuration: the model's role in the product, global formatting preferences, topics it should not address, and safety instructions specific to that application's use case.

Neither is the right place for decisions that change over time. A decision about the database schema, an agreement to use a particular library, or a rule about which endpoints require authentication is a project decision. It belongs in a record where it can be updated, superseded and linked to the discussion that produced it. Putting a mutable decision in a static instruction file means it will eventually be wrong. For agent memory systems that handle changing context, see choosing an agent memory system and context engineering for multi-agent systems.

When an AGENTS.md file starts accumulating project decisions alongside code conventions, those decisions belong in fenbs. Write the decision once with the reason, the person who made it, and the context behind it. Connected assistants read it at the start of each session. Update the decision when the project changes and the old one is superseded, keeping the history of what was decided and when.

How to do this with fenbs

  1. Create a free account and add your project.
  2. In your repository, create or update AGENTS.md with stable code conventions: language, framework, build commands, architectural constraints.
  3. In your application configuration, set a system prompt with application-level instructions: persona, global format preferences, safety rules.
  4. Connect Claude Code or another supported tool from Integrations. Add the project to fenbs.
  5. In Decisions and rules in fenbs, write the decisions that change over time. When AGENTS.md or a system prompt references a decision, move it to fenbs and replace the text with a pointer.

The division of responsibility is: AGENTS.md owns the stable code conventions, the system prompt owns the application persona, and fenbs owns the decisions and progress. Each stays current within its scope without conflicting with the others.

Questions people ask.

Can I use AGENTS.md instead of a system prompt?

For coding tools that read AGENTS.md natively, it replaces some of what a system prompt does at the repository level. But a system prompt is set by the application; a developer using the API to build a product sets a system prompt for that product regardless of what AGENTS.md says.

Will a system prompt override instructions in AGENTS.md?

Generally yes, because the system prompt reaches the model first in the context. In practice, the two rarely conflict because they address different scopes. If they do conflict, the system prompt wins.

Where should I put project decisions: AGENTS.md or fenbs?

Decisions that change over time belong in fenbs, not in AGENTS.md. AGENTS.md is a static file committed to the repository. A decision that gets superseded leaves stale text in the file. fenbs lets you update a decision and keeps the history of what was decided and when.

Does every AI coding tool support AGENTS.md?

No. Claude Code reads AGENTS.md natively. Other tools use different file names: Gemini CLI uses GEMINI.md, Cursor uses .cursorrules. Check each tool's documentation for its current instruction file convention.

Is it worth maintaining both AGENTS.md and fenbs?

Yes, for different reasons. AGENTS.md handles the stable code conventions that belong with the codebase and are useful to human readers too. fenbs handles the live project context that changes as work progresses. Using both means neither has to try to do the other's job.

More in Prompts and skills for AI work

All Prompts and skills for AI work articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.