github / github/copilot-cli

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

Đang mở
#3,840 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:configuration area:context-memory
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the /instructions command and the session-start instruction discovery flow. Determine how per-repository state could be stored and reapplied across sessions, including files in ancestor directories. Done means users can persist, inspect, and reset opt-outs without affecting other repositories, with skipped and loaded files shown clearly.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.