Skip to content

Load custom instructions from multiple repositories in one session (multi-repo / fullstack workflows #5011

Description

@pade43

Describe the feature or problem you'd like to solve

Describe the feature or problem you'd like to solve I work fullstack across two sibling repositories in the same Copilot CLI session: a SvelteKit frontend and a .NET backend. Each repo has its own  .github/copilot-instructions.md , with a different Definition of Done, test commands and conventions. Copilot CLI only loads repository instructions from the git root or current working directory at session start. As a result: • If I start in the frontend repo, the backend's rules are never loaded, even though the agent edits backend files all the time. • If I start outside a repo, no repository instructions are loaded at all, and the agent does not tell me this. •  --add-dir  grants file access to the second repo but does not load its instructions. •  @ -references in  copilot-instructions.md  can't point outside the repository. •  COPILOT_CUSTOM_INSTRUCTIONS_DIRS  only picks up  AGENTS.md  /  *.instructions.md , not  .github/copilot-instructions.md . In practice I have to keep reminding the agent to read the other repo's instructions. It also misses important rules, such as required tests and build checks.

Proposed solution

Proposed solution

Any of the following would solve it:

  1. When a directory is added with  --add-dir  or  /add-dir , also load its  .github/copilot-instructions.md . Or offer this as an option, e.g.  --add-dir --with-instructions .
  2. When the agent starts editing files in another git repository, automatically discover and load that repository's instructions. The docs already describe discovery "in the path of a file it is working on"; this should work across repository boundaries too.
  3. Let  COPILOT_CUSTOM_INSTRUCTIONS_DIRS  also pick up  .github/copilot-instructions.md .
  4. Show a clear notice when the session is started outside a repository and no repository instructions are loaded.

How it benefits Copilot CLI and its users: multi-repo setups are very common, for example frontend and backend, microservices and shared libraries. Team members start Copilot in different ways, so personal workarounds like shell aliases don't work for a whole team. Loading the right instructions automatically makes the agent follow each project's rules reliably, without users having to repeat them.

Example prompts or workflows

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions