Skip to content

Commit 2f83ded

Browse files
DanWahlinCopilot
andauthored
docs: add /security-review, /memory, and /compact focus instructions from CLI v1.0.49–1.0.52
New features added to course content: - /security-review slash command (v1.0.51): added to ch03 Code Review workflow and ch01 command table - /memory on|off|show (v1.0.49): added to ch02 session management section and ch01 command table, plus GLOSSARY - /compact focus instructions (v1.0.52): updated ch02 /compact section with optional focus instructions syntax - /usage quota progress bars note (v1.0.52): updated ch01 command table description - Secret scanning for commits/PRs (v1.0.51): mentioned in ch03 /security-review section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f5c15bf commit 2f83ded

4 files changed

Lines changed: 64 additions & 5 deletions

File tree

01-setup-and-first-steps/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ That's it for getting started! As you become comfortable, you can explore additi
417417
| `/pr` | Operate on pull requests for the current branch |
418418
| `/research` | Run deep research investigation using GitHub and web sources |
419419
| `/review` | Run the code-review agent to analyze changes |
420+
| `/security-review` | Scan staged/unstaged changes for security vulnerabilities |
420421
| `/terminal-setup` | Enable multiline input support (shift+enter and ctrl+enter) |
421422

422423
### Permissions
@@ -436,14 +437,15 @@ That's it for getting started! As you become comfortable, you can explore additi
436437
| Command | What It Does |
437438
|---------|--------------|
438439
| `/clear` | Abandons the current session (no history saved) and starts a fresh conversation |
439-
| `/compact` | Summarize conversation to reduce context usage |
440+
| `/compact` | Summarize conversation to reduce context usage (optionally add focus instructions, e.g. `/compact focus on the bug list`) |
440441
| `/context` | Show context window token usage and visualization |
441442
| `/keep-alive` | Prevent your system from sleeping while Copilot CLI is active — handy for long-running tasks on a laptop |
443+
| `/memory [on\|off\|show]` | Enable, disable, or view persistent memory — facts and preferences remembered across all sessions |
442444
| `/new` | Ends the current session (saving it to history for search/resume) and starts a fresh conversation. |
443445
| `/resume` | Switch to a different session (optionally specify session ID or name) |
444446
| `/rename` | Rename the current session (omit the name to auto-generate one) |
445447
| `/rewind` | Open a timeline picker to roll back to any earlier point in the conversation |
446-
| `/usage` | Display session usage metrics and statistics |
448+
| `/usage` | Display session usage metrics and statistics, including quota progress bars |
447449
| `/session` | Show session info and workspace summary; use `/session delete`, `/session delete <id>`, or `/session delete-all` to remove sessions |
448450
| `/share` | Export session as a markdown file, GitHub gist, or self-contained HTML file |
449451

02-context-conversations/README.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,29 @@ copilot
351351
> /session delete-all # Deletes all sessions (use with care!)
352352
```
353353
354+
### Persistent Memory Across Sessions
355+
356+
Sessions save your conversation history, but **memory** goes one step further — it 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 for Python testing", it can remember that preference and apply it automatically in future sessions — 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+
354377
### Check and Manage Context
355378
356379
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
588611
# Your key findings and decisions are preserved
589612
```
590613
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.
624+
591625
#### Context Efficiency Tips
592626
593627
| Situation | Action | Why |
@@ -881,9 +915,10 @@ copilot --add-dir /path/to/directory
881915
1. **`@` syntax** gives Copilot CLI context about files, directories, and images
882916
2. **Multi-turn conversations** build on each other as context accumulates
883917
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
887922
888923
> 📚 **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.
889924

03-development-workflows/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,22 @@ copilot
177177
178178
> 💡 **Tip**: The code-review agent works best when you have pending changes. Stage your files with `git add` for more focused reviews.
179179
180+
### Using the /security-review Command
181+
182+
The `/security-review` command is a dedicated slash command that analyzes your code changes specifically for **security vulnerabilities** — things like exposed secrets, injection risks, or insecure patterns. Think of it as a security-focused companion to `/review`.
183+
184+
```bash
185+
copilot
186+
187+
> /security-review
188+
# Scans staged/unstaged changes for security vulnerabilities
189+
# Flags issues like exposed credentials, injection risks, and insecure patterns
190+
```
191+
192+
> 💡 **When to use `/security-review`**: Run it before committing code that handles user input, authentication, file access, or network requests. It's especially useful when you're not sure if your changes introduced a security risk.
193+
194+
> 🔒 **Bonus**: GitHub Copilot CLI also automatically scans your commit messages and pull request descriptions for accidentally included secrets (like API keys or passwords) and redacts them before they're published.
195+
180196
</details>
181197
182198
---

GLOSSARY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ Model Context Protocol. A standard for connecting AI assistants to external data
7676

7777
---
7878

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).
82+
83+
---
84+
7985
## N
8086

8187
### npx

0 commit comments

Comments
 (0)