ai newsFr., 4. Dez.
EilmeldungAlibaba Releases Qwen4-35B-A3B: Open-Weight MoE Model With 1M Context

KI-Regeln editoruebergreifend teilen: AGENTS.md als zentrale Datei

Wer Regeln fuer KI-Tools nur einmal pflegen will, kann sie in einer AGENTS.md hinterlegen. Copilot und Cursor lesen die Datei von selbst, Gemini CLI benoetigt eine Einstellung, und Claude Code laedt AGENTS.md nur, wenn keine CLAUDE.md existiert.

dev.toDonnerstag 11:13 · 03.12.DE7 Min. Lesezeit
Bild: dev.to

Schreibe die gemeinsamen Regeln einmal in AGENTS.md und sorge dafür, dass jedes Werkzeug genau diese eine Datei lädt. Copilot und Cursor lesen AGENTS.md ohne Zutun. Gemini CLI benötigt eine Einstellung. Claude Code liest AGENTS.md standardmäßig nur dann von selbst, wenn es kein CLAUDE.md findet; sobald ein CLAUDE.md existiert, muss es AGENTS.md selbst einbinden: mit einer Zeile @AGENTS.md oder dadurch, dass CLAUDE.md ein Symlink darauf ist. Ein Satz wie "siehe AGENTS.md" lädt nichts. Eine zweite Kopie der Regeln lädt Inhalte, und von da an muss jemand die beiden Dateien von Hand synchron halten.

Claude Code ist das Werkzeug, das ich zuerst prüfen würde. Am 17. November 2026 habe ich die Regeldateien in den 1.000 am häufigsten mit Sternen bewerteten GitHub-Repositorys durchgesehen, die nach dem 17. August einen Push erhalten hatten. 197 von ihnen besitzen sowohl AGENTS.md als auch CLAUDE.md. In 51 davon enthält CLAUDE.md eigenen Text und keinen Import, sodass Claude Code standardmäßig jede Sitzung dort beginnt, ohne AGENTS.md zu laden.

Ich empfehle eine Datei für die gemeinsamen Regeln, die jedes Werkzeug über einen vom jeweiligen Werkzeug dokumentierten Mechanismus liest, und keine Kopien, auch keine identischen. Wenn ein Werkzeug sowohl einen Import als auch einen Symlink anbietet, wähle ich den Import.

So habe ich gezählt. Die GitHub-Such-API fand 7.823 öffentliche Repositorys mit mehr als 5.000 Sternen und einem Push nach dem 17. August 2026, und ich nahm die ersten 1.000 nach Sternzahl. In jedem las ich den Root-Ordner,.github/ und.cursor/rules/ und sammelte die Regeldateien für KI-Coding-Werkzeuge. Alle 1.000 wurden ohne Fehler gelesen. Dateien in tieferen Ordnern wie docs/AGENTS.md wurden nicht gelesen, daher sind die Dateizählungen eine Untergrenze. Für die Zeilenzählungen gilt: Eine Anweisungszeile ist eine Zeile mit vier oder mehr Wörtern außerhalb von Codeblöcken, Überschriften und Tabellen. Zeilen werden nach Kleinbuchstaben-Umwandlung und Entfernen von Listenmarkierungen und Markdown-Symbolen verglichen.

478 der 1.000 Repositorys pflegen Regeln für mindestens ein KI-Coding-Werkzeug.

AGENTS.md liegt weit vor allen anderen, und es ist die Datei, die ich zur Quelle machen würde. Die zugehörige Website nennt es "A simple, open format for guiding coding agents".

244 Repositorys pflegen Regeln für zwei oder mehr Werkzeuge, 3 davon für fünf. Wenn die Dateien zweier Werkzeuge denselben Text tragen, sagt die Contents-API von GitHub nicht, ob es sich um zwei Dateien oder eine handelt: Sie führt einen Symlink auf eine reguläre Datei als gewöhnliche Datei auf und liefert den Text des Ziels. Deshalb habe ich am 20. November zusätzlich die Git-Dateimodi jedes solchen Paares gelesen.

Claude Code liest AGENTS.md inzwischen von selbst. Seine Memory-Dokumentation sagt: "Claude Code can read AGENTS.md as your project instructions, so a repository already set up für other coding agents works without adding a CLAUDE.md, an import, or a setting." Die Seite ergänzt, dass dies "requires Claude Code v2.1.277 or later".

Dieselbe Seite enthält eine Tabelle, die zeigt, was Claude in jedem Fall standardmäßig liest. Für "An AGENTS.md and a CLAUDE.md or CLAUDE.local.md in your working directory or above it" lautet die Antwort "Your CLAUDE.md files only". Die Regel nimmt an, dass ein Projekt mit einem CLAUDE.md Claude bereits mitgeteilt hat, was es lesen soll. Der Nebeneffekt ist, dass das Hinzufügen eines CLAUDE.md zu einem Repository, das bereits AGENTS.md enthält, Claude AGENTS.md wegnimmt, es sei denn, CLAUDE.md importiert es oder ist ein Symlink darauf. Die Seite gibt die Import-Syntax an: "CLAUDE.md files can import additional files using @path/to/import syntax."

Eine Einstellung, Project instructions, kann Claude dazu bringen, beide Dateien zu lesen, aber Claude Code "ignores it in project and local settings files". Ein Repository kann sie für die Personen, die es klonen, nicht aktivieren.

In 82 der 197 Repositorys importiert CLAUDE.md die AGENTS.md. In 61 führen die beiden Namen über einen Symlink zu einer Datei. Nur 2 pflegen CLAUDE.md als separate identische Kopie. In 1 weiteren waren die beiden Dateien am 17. November identisch, und CLAUDE.md wurde inzwischen gelöscht. All diese Varianten funktionieren, mit einer Windows-Ausnahme bei Symlinks. Die übrigen 51 haben ein CLAUDE.md mit eigenem Text und ohne Import. 28 davon erwähnen AGENTS.md, und 23 erwähnen es überhaupt nicht. AGENTS.md enthält in diesen 51 Repositorys 3.424 Anweisungszeilen, und 3.234 davon, also 94,5 Prozent, kommen in CLAUDE.md nicht vor. In 40 der 51 fehlen mindestens neun Zehntel der AGENTS.md-Zeilen in dem, was Claude lädt.

15 der 28 CLAUDE.md-Dateien bestehen aus einem kurzen Satz, der auf AGENTS.md verweist. Die Memory-Seite behandelt diesen Fall: "Claude sees AGENTS.md only if it decides to open the file." Ich möchte nicht, dass Projektregeln von dieser Entscheidung abhängen.

GitHub Copilot behandelt AGENTS.md als Agent-Anweisungen, neben seinen eigenen Anweisungsdateien. Ein Repository kann mehrere AGENTS.md-Dateien enthalten, und die GitHub-Anweisungsseite sagt, welche gewinnt: "When Copilot is working, the nearest AGENTS.md file in the directory tree will take precedence."

Cursor behandelt AGENTS.md als gewöhnliches Markdown und behält ein eigenes Format für bereichsbezogene Regeln. Seine Rules-Seite ist hier streng: "Project rules must use the.mdc extension." Drei Repositorys in der Stichprobe speichern gewöhnliche.md-Dateien in.cursor/rules/, insgesamt mindestens 23. Sie liegen im Rules-Ordner, und das Regelsystem wendet sie nicht an.

Gemini CLI sucht standardmäßig nach GEMINI.md. Die GEMINI.md-Seite nennt die Einstellung, die das ändert: "To specify a different name or a list of names, use the context.fileName property." Mit AGENTS.md in dieser Liste liest Gemini auch die gemeinsame Datei.

Separate identische Kopien sind in der Stichprobe selten. Am 17. November hatten 81 Paare von Regeldateien für verschiedene Werkzeuge identischen Text. In 77 davon führen die beiden Namen über einen Symlink zu einer Datei. Nur 3 sind zwei separate Dateien mit demselben Text, und das letzte kann nicht mehr geprüft werden, weil eine seiner Dateien inzwischen gelöscht wurde. Diese 3 funktionieren, solange beide Dateien gleich bleiben. Jede spätere Änderung muss in beiden vorgenommen werden, von jemandem, der sich daran erinnert, dass es zwei gibt.

27 Paare separater Dateien teilen einige ihrer Zeilen, ohne gleich zu sein. Sie haben im Median 15 gemeinsame Zeilen, und in 10 von ihnen fehlen auf einer Seite fünf oder mehr Zeilen, die die andere hat. Meine Untersuchung sieht nur einen einzigen Tag und keine Historie, daher kann sie nicht sagen, wie diese Paare entstanden sind oder welche Unterschiede beabsichtigt waren. Wer eine dieser Dateien als Nächstes bearbeitet, muss herausarbeiten, welche Zeilen in welche Datei gehören.

Die meisten identischen Paare erwiesen sich als Symlinks, und die Claude-Code-Memory-Seite bietet einen an, ln -s AGENTS.md CLAUDE.md, für ein Projekt ohne Claude-spezifische Inhalte. Er erhält eine Datei, was bereits besser ist als eine Kopie. Eine der Einschränkungen, die die Seite dafür nennt, betrifft Windows: "Git checks a committed symlink out as a plain text file unless core.symlinks is enabled, which leaves that clone with a one-line CLAUDE.md in place of your instructions." Auf einem solchen Klon startet Claude ohne die Regeln, wie in den 51 Repositorys oben. Für ein Repository, das irgendjemand unter Windows klont, empfiehlt die Seite den Import.

Ein Symlink liefert zwei Werkzeugen zudem exakt denselben Text, sodass eine Regel, die nur für eines von ihnen gedacht ist, keinen Platz hat. Ein Import erhält eine Datei und lässt dennoch Raum für eine solche Regel, und dasselbe gilt für die Gemini-Einstellung.

Alles Gemeinsame gehört in AGENTS.md. CLAUDE.md erhält den Import und darunter nur das, was für Claude Code spezifisch ist:

<!-- CLAUDE.md --> @AGENTS.md ## Claude Code only - Use the project's test script, not the global one. Enter fullscreen mode Exit fullscreen mode Gemini CLI erhält eine Einstellung, in.gemini/settings.json im Projekt-Root:

{ "context": { "fileName": [ "AGENTS.md", "GEMINI.md" ] } } Enter fullscreen mode Exit fullscreen mode GEMINI.md bleibt in der Liste für Zeilen, die nur Gemini lesen soll, dieselbe Aufgabe, die die Zeilen unter dem Import in CLAUDE.md übernehmen.

Copilot und Cursor benötigen keine zusätzliche Datei für die gemeinsamen Regeln. Ihre eigenen Dateien,.github/copilot-instructions.md und.cursor/rules/*.mdc, bleiben für das, was zu einem Werkzeug oder einem Ordner gehört, ohne Wiederholungen aus AGENTS.md.

Drei Prüfungen decken ein bestehendes Repository ab. Wenn es ein CLAUDE.md hat, das weder ein Symlink auf AGENTS.md noch eine Kopie davon ist, suche nach der Zeile @AGENTS.md; ohne sie liest Claude nur CLAUDE.md. In einem Repository nur mit AGENTS.md starte eine interaktive Claude-Code-Sitzung. Die Dokumentation sagt, dass die Unterhaltung dann eine Zeile wie "no CLAUDE.md found; AGENTS.md loaded" zeigt. Erscheint diese Zeile nicht, wurde AGENTS.md nicht geladen. Für Cursor liste.cursor/rules/ auf. Eine Datei dort ohne die Endung.mdc ist keine Projektregel.

Ich habe die Repositorys am 17. November 2026 zwischen 20:39 und 21:21 UTC über die GitHub-API gelesen und die Git-Dateimodi am 20. November. Sämtliche hier zitierte Dokumentation wurde am 20. November mit den Live-Seiten abgeglichen. Der Artikel beschreibt die Repositorys und die Seiten zu diesen Zeitpunkten.

Ich arbeite an Mnemoverse; keines der genannten Werkzeuge gehört uns, und die Zählungen stammen aus meinen eigenen Skripten über öffentliche Repositorys.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

Write the shared rules once, in AGENTS.md, and make every tool load that one file. Copilot and Cursor read AGENTS.md without help. Gemini CLI needs one setting. By default, Claude Code reads AGENTS.md by itself only when it finds no CLAUDE.md, so once a CLAUDE.md exists, it has to bring AGENTS.md in: with a line @AGENTS.md, or by being a symlink to it. A sentence such as "see AGENTS.md" loads nothing. A second copy of the rules loads, and from then on somebody has to keep the two in step by hand.

Claude Code is the tool I would check first. On 17 November 2026 I went through the rules files in the 1,000 most-starred GitHub repositories with a push after 17 August. 197 of them have both AGENTS.md and CLAUDE.md. In 51 of those, CLAUDE.md has its own text and no import, so by default Claude Code starts every session there without AGENTS.md.

I recommend one file for the shared rules, read by every tool through a mechanism that tool documents, and no copies, identical ones included. Where a tool offers both an import and a symlink, I take the import.

Here is how I counted. The GitHub search API matched 7,823 public repositories with more than 5,000 stars and a push after 17 August 2026, and I took the first 1,000 by stars. In each I read the root folder,.github/ and.cursor/rules/, and collected the rules files for AI coding tools. All 1,000 were read without an error. Files in deeper folders, such as docs/AGENTS.md, were not read, so the counts of files are a lower bound. For the line counts, an instruction line is a line of four words or more outside code blocks, headings and tables. Lines are compared after lower-casing and removing list markers and markdown symbols.

478 of the 1,000 repositories keep rules for at least one AI coding tool.

AGENTS.md is far ahead of the rest, and it is the file I would make the source. Its site calls it "A simple, open format for guiding coding agents".

244 repositories keep rules for two tools or more, and 3 of them for five. Where two tools' files carry the same text, GitHub's contents API does not say whether they are two files or one: it lists a symlink to a regular file as an ordinary file and returns the target's text. So on 20 November I also read the git file modes of every such pair.

Claude Code now reads AGENTS.md on its own. Its memory documentation says: "Claude Code can read AGENTS.md as your project instructions, so a repository already set up for other coding agents works without adding a CLAUDE.md, an import, or a setting." The page adds that this "requires Claude Code v2.1.277 or later".

The same page has a table of what Claude reads by default in each case. For "An AGENTS.md and a CLAUDE.md or CLAUDE.local.md in your working directory or above it", the answer is "Your CLAUDE.md files only". The rule assumes that a project with a CLAUDE.md has already told Claude what to read. The side effect is that adding a CLAUDE.md to a repository that already has AGENTS.md takes AGENTS.md away from Claude, unless CLAUDE.md imports it or is a symlink to it. The page gives the import syntax: "CLAUDE.md files can import additional files using @path/to/import syntax."

A setting, Project instructions, can make Claude read both files, but Claude Code "ignores it in project and local settings files". A repository cannot switch it on for the people who clone it.

In 82 of the 197 repositories CLAUDE.md imports AGENTS.md. In 61 the two names lead to one file through a symlink. Only 2 keep CLAUDE.md as a separate identical copy. In 1 more the two files were identical on 17 November, and CLAUDE.md has been deleted since. All of these work, with a Windows exception for symlinks. The other 51 have a CLAUDE.md with its own text and no import. 28 of them mention AGENTS.md, and 23 do not mention it at all. AGENTS.md in those 51 repositories holds 3,424 instruction lines, and 3,234 of them, 94.5 percent, do not appear in CLAUDE.md. In 40 of the 51, at least nine tenths of the AGENTS.md lines are missing from what Claude loads.

15 of the 28 CLAUDE.md files are one short sentence pointing to AGENTS.md. The memory page covers that case: "Claude sees AGENTS.md only if it decides to open the file." I do not want project rules to depend on that decision.

GitHub Copilot takes AGENTS.md as agent instructions, next to its own instructions files. A repository can hold several AGENTS.md files, and GitHub's instructions page says which one wins: "When Copilot is working, the nearest AGENTS.md file in the directory tree will take precedence."

Cursor treats AGENTS.md as plain markdown and keeps a format of its own for scoped rules. Its rules page is strict here: "Project rules must use the.mdc extension." Three repositories in the sample keep plain.md files in.cursor/rules/, at least 23 between them. They sit in the rules folder, and the rules system does not apply them.

By default Gemini CLI looks for GEMINI.md. The GEMINI.md page names the setting that changes this: "To specify a different name or a list of names, use the context.fileName property." With AGENTS.md in that list, Gemini reads the shared file too.

Separate identical copies are rare in the sample. On 17 November, 81 pairs of rules files for different tools had identical text. In 77 of them the two names lead to one file through a symlink. Only 3 are two separate files with the same text, and the last one can no longer be checked, because one of its files has been deleted since. Those 3 work as long as both files stay equal. Every later change has to be made in both, by someone who remembers that there are two.

27 pairs of separate files share some of their lines without being equal. They have a median of 15 lines in common, and in 10 of them one side has five or more lines that the other lacks. My probe sees a single day and no history, so it cannot say how these pairs got there or which differences were meant. Whoever edits one of those files next has to work out which lines belong in which file.

Most of the identical pairs turned out to be symlinks, and the Claude Code memory page offers one, ln -s AGENTS.md CLAUDE.md, for a project with no Claude-specific content. It keeps one file, which is already better than a copy. One of the constraints the page lists for it concerns Windows: "Git checks a committed symlink out as a plain text file unless core.symlinks is enabled, which leaves that clone with a one-line CLAUDE.md in place of your instructions." On such a clone Claude starts without the rules, as in the 51 repositories above. For a repository that anyone clones on Windows, the page says to use the import.

A symlink also hands two tools exactly the same text, so a rule meant for one of them alone has nowhere to go. An import keeps one file and still leaves room for such a rule, and so does the Gemini setting.

Everything shared goes into AGENTS.md. CLAUDE.md gets the import and, under it, only what is specific to Claude Code:

<!-- CLAUDE.md --> @AGENTS.md ## Claude Code only - Use the project's test script, not the global one. Enter fullscreen mode Exit fullscreen mode Gemini CLI gets one setting, in.gemini/settings.json at the project root:

{ "context": { "fileName": [ "AGENTS.md", "GEMINI.md" ] } } Enter fullscreen mode Exit fullscreen mode GEMINI.md stays in the list for lines that only Gemini should read, the same job the lines under the import do in CLAUDE.md.

Copilot and Cursor need no extra file for the shared rules. Their own files,.github/copilot-instructions.md and.cursor/rules/*.mdc, stay for what belongs to one tool or one folder, with nothing repeated from AGENTS.md.

Three checks cover a repository you already have. If it has a CLAUDE.md that is neither a symlink to AGENTS.md nor a copy of it, look for the @AGENTS.md line; without it, Claude reads CLAUDE.md only. In a repository with AGENTS.md alone, start an interactive Claude Code session. The documentation says the conversation then shows a line such as "no CLAUDE.md found; AGENTS.md loaded". If that line does not appear, AGENTS.md was not loaded. For Cursor, list.cursor/rules/. A file there without the.mdc extension is not a project rule.

I read the repositories through the GitHub API on 17 November 2026, between 20:39 and 21:21 UTC, and the git file modes on 20 November. All documentation quoted here was checked against the live pages on 20 November. The article describes the repositories and the pages on those dates.

I work on Mnemoverse; none of the tools above is ours, and the counts come from my own scripts over public repositories.

Originaltitel: How do I share AI rules across editors?Quelle: dev.to (dev.to). Original öffnen