mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-24 21:59:04 +00:00
Watches a user-global `AGENTS.md` file alongside `settings.json` (at `~/.config/zed/AGENTS.md` on macOS/Linux, `%APPDATA%\Zed\AGENTS.md` on Windows) and includes its trimmed contents in the native agent's system prompt. This matches the pattern used by Codex (`CODEX_HOME/AGENTS.md`, defaulting to `~/.codex/AGENTS.md`) and OpenCode (`~/.config/opencode/AGENTS.md`): personal instructions live next to other app config and apply across every project the user opens. ## Behavior - Native Zed agent only. Not passed to ACP / external agents. - Reads the local config dir, so SSH-remoted projects still get the local user's personal `AGENTS.md` (project rules continue to come from the remote workspace). - Missing, empty, or whitespace-only files are silently treated as no `AGENTS.md`. - Read errors surface through the same notification UI as settings errors, with a stable notification ID that's dismissed once the file becomes readable again. - The file is read in full, matching how existing project rules / repo `AGENTS.md` files are loaded today. ## System prompt rendering In the system prompt, the user-global `AGENTS.md` appears as `### Personal AGENTS.md` immediately before `### Project Rules`, so the model sees personal defaults first and project guidance later (project rules take precedence on conflicts). ## Tests - `user_agents_md` watcher: initial load, empty/whitespace ignored, reacts to file edits. - `SystemPromptTemplate`: renders personal `AGENTS.md` before project rules; omits the section when no user `AGENTS.md` is present. Closes AI-231 Release Notes: - Added support for a global `AGENTS.md` file alongside `settings.json` that is automatically included in the agent's instructions for every project. |
||
|---|---|---|
| .. | ||
| zed | ||
| main.rs | ||
| reliability.rs | ||
| visual_test_runner.rs | ||
| zed.rs | ||