You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 02-context-conversations/README.md
+38-3Lines changed: 38 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -351,6 +351,29 @@ copilot
351
351
> /session delete-all # Deletes all sessions (use with care!)
352
352
```
353
353
354
+
### Persistent Memory Across Sessions
355
+
356
+
Sessions save your conversation history, but **memory** goes one step further and lets Copilot CLI remember preferences and facts *across all sessions*, not just within a single one.
357
+
358
+
```bash
359
+
copilot
360
+
361
+
> /memory show
362
+
# Shows what Copilot CLI currently remembers about you and your project
363
+
364
+
> /memory on
365
+
# Enables memory (on by default if your account supports it)
366
+
367
+
> /memory off
368
+
# Disables memory (useful if you prefer a fresh slate each time)
369
+
```
370
+
371
+
For example, if you tell Copilot CLI "I always prefer pytest forPython testing", it can remember that preference and apply it automaticallyin future sessions. All without you having to repeat it.
372
+
373
+
> 💡 **Memory vs. Sessions**: Sessions save the *conversation history* so you can resume a specific task. Memory saves *preferences and context* that apply across all your work. Think of sessions as project notebooks and memory as your personal notepad.
374
+
375
+
> 🔒 **Privacy note**: Memory is scoped either to your user account (visible to you across all repos) or to a specific repository (shared with collaborators). The CLI tells you which scope applies whenever it stores something.
376
+
354
377
### Check and Manage Context
355
378
356
379
As you add files and conversation, Copilot CLI's [context window](../GLOSSARY.md#context-window) fills up. Several commands are available to help you stay in control:
@@ -588,6 +611,17 @@ copilot
588
611
# Your key findings and decisions are preserved
589
612
```
590
613
614
+
You can also give `/compact` optional focus instructions to shape what gets prioritized in the summary:
615
+
616
+
```bash
617
+
copilot
618
+
619
+
> /compact focus on the list of bugs we found and decisions made
620
+
# Summarizes history, keeping bug list and decisions prominent
621
+
```
622
+
623
+
> 💡 **When to use focus instructions**: If your conversation covered many topics, focus instructions help`/compact` retain the parts most relevant to your next steps so you don't lose the thread.
1. **`@` syntax** gives Copilot CLI context about files, directories, and images
882
916
2. **Multi-turn conversations** build on each other as context accumulates
883
917
3. **Sessions auto-save**: name them at startup with `--name`, resume by name with `--resume=<name>`, or use `--continue` to pick up the most recent session
884
-
4. **Context windows** have limits: manage them with `/clear`, `/compact`, `/context`, `/new`, and `/rewind`
885
-
5. **Permission flags** (`--add-dir`, `--allow-all`) control multi-directory access. Use them wisely!
886
-
6. **Image references** (`@screenshot.png`) help debug UI issues visually
918
+
4. **Context windows** have limits: manage them with `/clear`, `/compact`, `/context`, `/new`, and `/rewind`. Use `/compact focus on <topic>` to shape what gets kept in the summary
919
+
5. **Persistent memory** (`/memory`) lets Copilot CLI remember preferences and facts across *all* sessions — not just the current one
920
+
6. **Permission flags** (`--add-dir`, `--allow-all`) control multi-directory access. Use them wisely!
921
+
7. **Image references** (`@screenshot.png`) help debug UI issues visually
887
922
888
923
> 📚 **Official Documentation**: [Use Copilot CLI](https://docs.github.com/copilot/how-tos/copilot-cli/use-copilot-cli) for the complete reference on context, sessions, and working with files.
Copy file name to clipboardExpand all lines: GLOSSARY.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,12 @@ Model Context Protocol. A standard for connecting AI assistants to external data
76
76
77
77
---
78
78
79
+
### Memory (Copilot CLI)
80
+
81
+
A feature that lets Copilot CLI remember facts and preferences *across all sessions*, not just within a single one. Unlike session history (which saves a specific conversation), memory persists globally and is applied automatically in future sessions. Managed with the `/memory` slash command (`/memory on`, `/memory off`, `/memory show`). Memory can be scoped to your user account (visible across all repositories) or to a specific repository (shared with collaborators).
0 commit comments