[
    {
        "role": "user",
        "content": "when%20using%20copilot%20cli%2C%20is%20there%20a%20file%20in%20.copilot%20that%20is%20read%20every%20time%20for%20instructions%20for%20all%3F"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s what I found on whether GitHub Copilot CLI (\u201ccopilot cli\u201d) reads a file in `.copilot` every time as instructions for *all* sessions or repos:\n\n---\n\n## \ud83d\udee0 Global vs Local Instruction Files in Copilot CLI\n\nCopilot CLI supports *custom instructions*, but these are **repository-level**, not globally scoped. These are files you include in the repo itself, and Copilot automatically includes them in your prompt context when working in that repository. Key custom instruction file types:\n\n- **`.github/copilot-instructions.md`** \u2014 general instructions for the whole repository. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli?utm_source=openai))  \n- **Path-specific instructions** in `.github/instructions/**/*.instructions.md` \u2014 for more specific instruction sets tied to directory paths. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli?utm_source=openai))  \n- **Agent profile files** (`*.md`) to define how custom agents in the repo should behave. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli?utm_source=openai))  \n\nThese help Copilot CLI better understand coding conventions, context, style, etc., for *that specific project*. They\u2019re not globally applied across all projects or repos by default. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli?utm_source=openai))\n\n---\n\n## \ud83d\udcc2 Global Configuration Files\n\nThere *is* a global configuration file that is always read (unless overridden), but it serves a different purpose. Key details:\n\n- **User-level config file**: `~/.copilot/config.json` \u2014 stores global settings like trusted directories, fallback behaviors, default tools, URL permissions, etc. This affects *all* projects unless a repo overrides with its own settings. ([docs.github.com](https://docs.github.com/en/enterprise-cloud%40latest/copilot/reference/cli-command-reference?utm_source=openai))  \n- **MCP server config** (Model Context Protocol): also global by default in `~/.copilot/mcp-config.json`. This, again, influences broad behavior, not instruction prompts. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli?utm_source=openai))\n\n---\n\n## \ud83e\udd14 So is there a `.copilot` file read every time for instructions?\n\n- If by \u201ca file in `.copilot`\u201d you mean **instruction text** (rules, style guidelines, etc.), the answer is **no**\u2014there\u2019s no single global instruction file that Copilot CLI automatically reads for **all** sessions or repos. Instruction files are repo-specific.  \n- The **global config files** like `~/.copilot/config.json` *are* read almost every time and exert broad influence, but they are for CLI settings\u2014permissions, approved tools, trusted paths\u2014not for natural language \u201cinstructions\u201d to always obey.\n\n---\n\n## \u2705 Short Answer\n\n- **Yes** \u2014 Copilot CLI *does* read a global `~/.copilot/config.json` at user level each time, which sets defaults for CLI behavior.  \n- **No** \u2014 it doesn\u2019t read a global \u201cinstruction\u201d file (like a master prompt) that gives Bet-as-rules or style guidance for *every* repo automatically. For that, you need **repo-based instruction files** like `.github/copilot-instructions.md` etc.\n\n---\n\nIf you want a mechanism to have instructions you always use (no matter the repo), I can show you a way to configure them (locally or globally) that approximates that behavior\u2014would you like me to walk you through that?"
    },
    {
        "role": "user",
        "content": "ok%2C%20so%20instructions.md%20in%20%7E%2F.copilot%3F"
    },
    {
        "role": "assistant",
        "content": "Yep \u2014 there *is* support for `$HOME/.copilot/copilot-instructions.md` as a **user-level** (global) instruction file. Copilot CLI will look at it, along with any repository-level instruction files, when you submit prompts. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))\n\nHere are some details and things you should know:\n\n---\n\n## \u2699\ufe0f How global instruction files work\n\n- You can create a file named `copilot-instructions.md` under the `~/.copilot` directory. This file\u2019s instructions will apply across all projects you use with Copilot CLI. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))  \n- Repository-level instruction files (e.g. `.github/copilot-instructions.md`) have higher priority than the global one; if both are present, the repo-level instructions will override or augment the user-level ones. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))  \n- Path-specific instruction files (`NAME.instructions.md` files under `.github/instructions/`) can also apply depending on the file or directory you're working in. These are more granular and can combine with repo-wide instructions. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))\n\n---\n\n## \ud83d\udd0e Key considerations & limitations\n\n- **Not guaranteed perfect enforcement** \u2014 Even if you have a global `~/.copilot/copilot-instructions.md`, Copilot may not *always* strictly follow the instructions. Model behavior, prompt history, token limits, and conflicting instructions from more specific files can affect whether instructions are honored. Some users report inconsistency. ([reddit.com](https://www.reddit.com/r/GithubCopilot/comments/1oy66vy/copilot_is_ignoring_instructions_in/?utm_source=openai))  \n- **Files must be in correct location** \u2014 The global file must be under `~/.copilot/`. If it's misplaced or named wrongly, Copilot won\u2019t see it. Repo-level custom instructions must be in `.github/copilot-instructions.md` or `.github/instructions/*.instructions.md`. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))  \n- **Settings/environment vars** \u2014 There are settings and environment variables (`COPILOT_CUSTOM_INSTRUCTIONS_DIRS`) that affect where Copilot looks for instruction files besides just `~/.copilot`. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))\n\n---\n\nIf you like, I can give you a concrete example of a global instruction file and how to test that it\u2019s working."
    },
    {
        "role": "user",
        "content": "what%20is%20equivalent%20file%20for%20claude%20cli%20stored%20in%20%7E%2F.claude"
    },
    {
        "role": "assistant",
        "content": "For Claude Code (Anthropic\u2019s CLI), the equivalent of a global instruction file (similar to Copilot CLI\u2019s global custom instructions) is called **`CLAUDE.md`**, located in `~/.claude/CLAUDE.md`. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/settings?utm_source=openai))\n\nHere\u2019s how it works:\n\n---\n\n## \u2705 What `~/.claude/CLAUDE.md` does\n\n- **Global project instructions / preferences**: This file lets you specify your universal guidelines\u2014coding style prefs, project-wide norms, general behavior you want Claude to follow every session. ([inventivehq.com](https://inventivehq.com/knowledge-base/claude/how-to-configure-claude-md?utm_source=openai))  \n- **Used across all projects**: It acts as a fallback or base layer of instructions that apply to every project unless overridden. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/settings?utm_source=openai))  \n\n---\n\n## \u2699\ufe0f Configuration hierarchy & precedence\n\nClaude Code loads settings and instructions in this order (from least specific \u2192 most specific):\n\n1. **Global `CLAUDE.md`** (`~/.claude/CLAUDE.md`) \u2014 user-wide instructions. ([tessl.io](https://tessl.io/registry/tessl/npm-anthropic-ai--claude-code/files/docs/configuration.md?utm_source=openai))  \n2. **Project-level `CLAUDE.md`** (in your project root) \u2014 overrides or adds to the global rules for that specific repo. ([inventivehq.com](https://inventivehq.com/knowledge-base/claude/how-to-configure-claude-md?utm_source=openai))  \n3. **Path or directory-specific `CLAUDE.md` files** \u2014 for example, if you have different subfolders with different languages or styles, you can put instruction files there. ([inventivehq.com](https://inventivehq.com/knowledge-base/claude/how-to-configure-claude-md?utm_source=openai))  \n\n---\n\n## \u26a0\ufe0f Things to keep in mind\n\n- **\u201cRelevance\u201d matters**: Claude sometimes ignores parts of the `CLAUDE.md` if they\u2019re not relevant to the task at hand. If instructions are too general or not directly related, they may be dropped or sidelined. ([reddit.com](https://www.reddit.com/r/ClaudeAI/comments/1q34sel/claude_code_will_ignore_your_claudemd_if_it/?utm_source=openai))  \n- **Conflicting instructions**: More specific files (project, folder) take priority over global ones. If you have both `~/.claude/CLAUDE.md` and a `CLAUDE.md` in your repo, repo-level will win for conflicting directives. ([inventivehq.com](https://inventivehq.com/knowledge-base/claude/how-to-configure-claude-md?utm_source=openai))  \n\n---\n\nIf you want, I can show you sample content for a global `CLAUDE.md` file to get started (coding style prefs, environment settings, etc.)."
    },
    {
        "role": "user",
        "content": "will%20claude%20or%20copilot%20use%20agent.md%20or%20agents.md%3F%20I%27m%20looking%20for%20a%20standard%20filename"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s a breakdown of what I found on standard filenames and formats for custom agent files in GitHub Copilot CLI and Claude Code\u2014as of now\u2014and whether there\u2019s a \u201cuniversal\u201d filename that works across both.\n\n---\n\n## \ud83c\udff7 GitHub Copilot CLI \u2014 Custom Agent Files\n\n- Copilot CLI defines custom agents using **Markdown files** with an **`.agent.md` extension**. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli?utm_source=openai))  \n- These `.agent.md` files can be placed in either *repository-level* directories (`.github/agents/`) or *user-level/global* directories (`~/.copilot/agents/`). ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli?utm_source=openai))  \n- If two agents share the same name, the one in the user directory (global) takes priority over the repo-level one. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli?utm_source=openai))  \n\n**Key takeaway**: For Copilot, the standard is `NAME.agent.md`.\n\n---\n\n## \ud83c\udfaf Claude Code \u2014 Subagents\n\n- Claude Code also supports **subagents**, configured via Markdown files stored with **`.md` extension**, not necessarily `.agent.md`. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/sub-agents?utm_source=openai))  \n- Their expected locations are `.claude/agents/` at the project level, or `~/.claude/agents/` globally. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/sub-agents?utm_source=openai))  \n- Filenames should match the agent\u2019s identifier (e.g. `backend-architect.md`). ([gist.github.com](https://gist.github.com/Danm72/7cdd172f818505b221988916ebdc9371?utm_source=openai))  \n\n---\n\n## \ud83e\udd14 Is there a \u201ccross-tool standard\u201d like `agent.md` or `AGENTS.md`?\n\n- There\u2019s been talk in the community about **`AGENTS.md`** (plural) or `AGENT.md` (singular) as a unified \u201ccontext or agent manifest\u201d filename, but *support is not yet consistent or native* across tools. ([reddit.com](https://www.reddit.com/r/GithubCopilot/comments/1ngu0xj/the_difference_between_agentmd_and/?utm_source=openai))  \n- For Copilot: `.agent.md` specifically is supported and official; `AGENTS.md` is sometimes mentioned, but documentation focuses on `.agent.md`. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli?utm_source=openai))  \n- For Claude: the main robust format is the `.md` subagent files in the `agents` folder; `AGENTS.md` or `CLAUDE.md` is more about \u201ccontext files\u201d or manifest\u2010style guidance\u2014not exactly the same as defining agent profiles. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/settings?utm_source=openai))  \n\n---\n\n## \u2705 What\u2019s the best filename to use?\n\nIf you want something that works clearly for each tool:\n\n- **For Copilot** \u2192 `my-agent.agent.md`\n- **For Claude Code** \u2192 `my-agent.md` (inside `.claude/agents/`)\n\nIf you're trying to pick one filename with the hope of cross-tool consistency:\n\n- `AGENTS.md` or `AGENT.md` is the *closest* candidate, but it\u2019s not reliably supported as a native agent definition file for either tool yet\u2014it tends to act more like a guideline/context/instructions manifest. ([reddit.com](https://www.reddit.com/r/GithubCopilot/comments/1ngu0xj/the_difference_between_agentmd_and/?utm_source=openai))  \n\n---\n\nIf you want, I can put together a table of the major tools (Copilot, Claude, Gemini, OpenAI, etc.) with what filenames each supports now, so you can choose a best-fit \u201cstandard\u201d for your workflows."
    },
    {
        "role": "user",
        "content": "ok%2C%20so%20for%20general%20instructions%20to%20the%20ai%2C%20we%20use%20%7E%2F.copilot%2Finstructions.md%20and%20for%20claude%2C%20we%20use%20%7E%2F.claude%2FCLAUDE.md%3F"
    },
    {
        "role": "assistant",
        "content": "Yes \u2014 you're mostly correct. Here\u2019s a refined summary with some nuances as of March 2026:\n\n---\n\n## \u2714\ufe0f How it works in practice\n\n| Tool | Global user-level instruction file | Project/repository-level instruction file |\n|---|---|---|\n| **GitHub Copilot CLI / Copilot Chat** | `~/.copilot/copilot-instructions.md` \u2014 holds your personal preferences that apply across all your repos. ([playbooks.com](https://playbooks.com/skills/github/awesome-copilot/copilot-cli-quickstart?utm_source=openai)) | `.github/copilot-instructions.md` in the repo root \u2014 project-wide custom instructions; also `.github/instructions/*.instructions.md` for path-specific rules. Also `AGENTS.md` can be used in some cases. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai)) |\n| **Claude Code** | `~/.claude/CLAUDE.md` \u2014 global rules and preferences you want in *every* project. ([gist.github.com](https://gist.github.com/graimon/0bf150c89d6c6844ab95866935bd4b0a?utm_source=openai)) | `CLAUDE.md` in project root (or versioned in Git), plus possibly `.claude/rules/*.md` files or subdirectory\u2010level instruction files. ([institute.sfeir.com](https://institute.sfeir.com/en/claude-code/claude-code-memory-system-claude-md/tutorial/?utm_source=openai)) |\n\n---\n\n## \u26a0\ufe0f Some caveats\n\n- **Precedence matters**: For both tools, project-level files override or supplement global files when there\u2019s overlap. Claude has a hierarchy: directory-specific \u2192 project root \u2192 global. ([claudeinsider.com](https://www.claudeinsider.com/docs/configuration/claude-md?utm_source=openai))  \n- **File sizes / length**: Best practice is keeping these instruction files relatively short (avoid dumping *everything* global). Too much can lead to being ignored or exceeding context windows. ([institute.sfeir.com](https://institute.sfeir.com/en/claude-code/claude-code-memory-system-claude-md/tutorial/?utm_source=openai))  \n- **Sometimes not honored perfectly**: Users report that instructions don\u2019t always seem to be read (especially referenced or nested files); for Claude, sometimes subdirectory `CLAUDE.md` files aren\u2019t picked up as expected. ([reddit.com](https://www.reddit.com/r/ClaudeCode/comments/1qn3e74/do_multiple_claudemd_files_work/?utm_source=openai))  \n\n---\n\nSo yes \u2014 your understanding is solid: use `~/.copilot/copilot-instructions.md` for Copilot global preferences, and `~/.claude/CLAUDE.md` for Claude global preferences. Project-level files go in the project root (or designated folders).\n\nIf you like, I can pull together a best-practice template for each, which you can drop in and adapt."
    },
    {
        "role": "user",
        "content": "is%20it%20copilot-instructions.md%20or%20simply%20instructions.md%3F"
    },
    {
        "role": "assistant",
        "content": "The correct filename is **`copilot-instructions.md`**, not just `instructions.md`, for Copilot\u2019s global or repository-level general instructions.\n\n---\n\n### \ud83e\udded Official docs support\n\n- \u201cRepository-wide custom instructions\u201d are specified in `.github/copilot-instructions.md`. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))  \n- Global user-level instructions can go in `~/.copilot/copilot-instructions.md`. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-best-practices?utm_source=openai))  \n\n---\n\n### \u26a1 Other related filenames/types\n\n- **`NAME.instructions.md`**: Used for path-specific instructions, usually stored in `.github/instructions/`. These files must end with `.instructions.md`. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))  \n- **`AGENTS.md`**: Also supported as an additional or alternate instruction file in the repository root. ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/add-repository-instructions?utm_source=openai))  \n\n---\n\n### \u2705 In summary\n\n- Use **`copilot-instructions.md`** for global or repo-wide guidelines.\n- Use **`*.instructions.md`** (under `.github/instructions/`) for path- or file-specific instructions.\n- `AGENTS.md` is supported as another instruction file type, but not a replacement for `copilot-instructions.md`.\n\nIf you like, I can double-check for Claude Code to compare if their standard matches or differs."
    }
]