github / github/copilot-cli

Make /instructions opt-out persistent (per-repo), instead of resetting every session

Open
#3,840 0 comments 0 reactions 0 assignees View on GitHub
area:configuration area:context-memory
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

### Describe the feature or problem you'd like to solve

Copilot CLI already lets me disable instructions files for a session via `/instructions`. The problem is it's not persistent — the moment I start a new session in the same repo, all the auto-discovered instructions files (`AGENTS.md`, nested `AGENTS.md`, `.github/copilot-instructions.md`, parent-directory `AGENTS.md`, etc.) are loaded again, and I have to re-run `/instructions` to turn them off every single time.

For repos where I always want certain instructions files disabled, repeating this every session is tedious and easy to forget. I want my `/instructions` opt-out choices to be remembered per-repository so they persist across sessions.

### Proposed solution

Persist the `/instructions` disable state on a per-repository basis so it's automatically reapplied on every new session in that repo.

Possible approaches:

- A "remember this" / "always" option in the `/instructions` UI that writes the choice to user-level config (e.g. `~/.copilot/config`) keyed by repo path/remote.
- A persistent flag, e.g. `/instructions disable AGENTS.md --persist`, or a config command like `copilot config set instructions.disabled "AGENTS.md" --repo .`.
- On session start, automatically apply the saved per-repo disable list and show which files were loaded vs. skipped.
- Ability to clear/re-enable later (e.g. `/instructions reset` or removing the config entry).

Benefits to Copilot CLI and its users:

- Removes repetitive manual opt-out every session.
- Stable, predictable context per repo → better responses and fewer wasted tokens.
- Works in shared repos where I can't delete instructions files I didn't author.

### Example prompts or workflows

1. In `/instructions`, toggle off `AGENTS.md` and choose "remember for this repo" → next session it's already disabled, no action needed.
2. `copilot config set instructions.disabled "AGENTS.md" --repo .` → Permanently disables that file for the current repo across all future sessions.
3. `copilot config set instructions.enabled false --repo ./vendored-project` → Persistently disables ALL auto-discovered instructions files for that repo.
4. Start a session in a repo with saved opt-outs → banner shows "Skipped (persisted): AGENTS.md, src/AGENTS.md".
5. `/instructions reset` → clears the persisted opt-out and resumes loading instructions normally.

### Additional context

- Current behavior: `/instructions` works, but only for the active session — the opt-out is forgotten on the next run, so I re-disable the same files every time.
- Instructions are auto-discovered from the repo AND ancestor directories, so even a parent-folder `AGENTS.md` (e.g. in a OneDrive/home directory above the repo) gets loaded — making a persistent per-repo opt-out especially useful.
- Preference: scope the persistence per-repository (keyed by repo path or git remote), with an option for global defaults.
- Nice-to-have: a command to list discovered instructions files and their persisted enabled/disabled state.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.