Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions 01-setup-and-first-steps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ That's it for getting started! As you become comfortable, you can explore additi
| `/pr` | Operate on pull requests for the current branch |
| `/research` | Run deep research investigation using GitHub and web sources |
| `/review` | Run the code-review agent to analyze changes |
| `/security-review` | Scan staged/unstaged changes for security vulnerabilities |
| `/terminal-setup` | Enable multiline input support (shift+enter and ctrl+enter) |

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

Expand Down
41 changes: 38 additions & 3 deletions 02-context-conversations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,29 @@ copilot
> /session delete-all # Deletes all sessions (use with care!)
```

### Persistent Memory Across Sessions

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.

```bash
copilot

> /memory show
# Shows what Copilot CLI currently remembers about you and your project

> /memory on
# Enables memory (on by default if your account supports it)

> /memory off
# Disables memory (useful if you prefer a fresh slate each time)
```

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.

> 💡 **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.

> 🔒 **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.

### Check and Manage Context

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:
Expand Down Expand Up @@ -588,6 +611,17 @@ copilot
# Your key findings and decisions are preserved
```

You can also give `/compact` optional focus instructions to shape what gets prioritized in the summary:

```bash
copilot

> /compact focus on the list of bugs we found and decisions made
# Summarizes history, keeping bug list and decisions prominent
```

> 💡 **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.

#### Context Efficiency Tips

| Situation | Action | Why |
Expand Down Expand Up @@ -881,9 +915,10 @@ copilot --add-dir /path/to/directory
1. **`@` syntax** gives Copilot CLI context about files, directories, and images
2. **Multi-turn conversations** build on each other as context accumulates
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
4. **Context windows** have limits: manage them with `/clear`, `/compact`, `/context`, `/new`, and `/rewind`
5. **Permission flags** (`--add-dir`, `--allow-all`) control multi-directory access. Use them wisely!
6. **Image references** (`@screenshot.png`) help debug UI issues visually
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
5. **Persistent memory** (`/memory`) lets Copilot CLI remember preferences and facts across *all* sessions — not just the current one
6. **Permission flags** (`--add-dir`, `--allow-all`) control multi-directory access. Use them wisely!
7. **Image references** (`@screenshot.png`) help debug UI issues visually

> 📚 **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.

Expand Down
16 changes: 16 additions & 0 deletions 03-development-workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,22 @@ copilot

> 💡 **Tip**: The code-review agent works best when you have pending changes. Stage your files with `git add` for more focused reviews.

### Using the /security-review Command

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

```bash
copilot

> /security-review
# Scans staged/unstaged changes for security vulnerabilities
# Flags issues like exposed credentials, injection risks, and insecure patterns
```

> 💡 **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.

> 🔒 **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.

</details>

---
Expand Down
6 changes: 6 additions & 0 deletions GLOSSARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ Model Context Protocol. A standard for connecting AI assistants to external data

---

### Memory (Copilot CLI)

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

---

## N

### npx
Expand Down
Loading