Skip to content

Commit 4314170

Browse files
docs: add /compact, /context, /usage commands and ACP session notes to Learning Hub (#1575)
Document the /compact, /context, and /usage slash commands in the Copilot Configuration Basics page. These commands were not covered in the main Learning Hub (outside the separate cli-for-beginners track), but are broadly useful for interactive and ACP sessions: - /context: visualize context window token usage - /usage: display per-session token and API call metrics - /compact: summarize conversation history to reclaim context space - Note that all four (/env included) now work in ACP sessions (v1.0.39+) - Note that ACP clients can toggle allow-all mode via session configuration without a slash command (v1.0.39+) Sources: - https://github.com/github/copilot-cli/blob/main/changelog.md (v1.0.39 – 2026-04-28) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b6c4bb6 commit 4314170

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

website/src/content/docs/learning-hub/copilot-configuration-basics.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Copilot Configuration Basics'
33
description: 'Learn how to configure GitHub Copilot at user, workspace, and repository levels to optimize your AI-assisted development experience.'
44
authors:
55
- GitHub Copilot Learning Hub Team
6-
lastUpdated: 2026-04-29
6+
lastUpdated: 2026-04-30
77
estimatedReadingTime: '10 minutes'
88
tags:
99
- configuration
@@ -495,6 +495,28 @@ The `/env` command shows all loaded environment details — instructions, MCP se
495495
/env
496496
```
497497

498+
The `/context` command shows a visualization of the current conversation's context window usage — how many tokens are consumed and how much headroom remains:
499+
500+
```
501+
/context
502+
```
503+
504+
The `/usage` command displays session metrics such as the number of tokens consumed, API calls made, and any quota information for the current session:
505+
506+
```
507+
/usage
508+
```
509+
510+
The `/compact` command summarizes the conversation history to free up context window space while preserving the thread of the conversation. Use it when your context is getting full but you do not want to start a fresh session:
511+
512+
```
513+
/compact
514+
```
515+
516+
> **Note**: Skills remain loaded and effective after `/compact`. You do not need to re-invoke them after compacting.
517+
518+
> **ACP sessions (v1.0.39+)**: The `/compact`, `/context`, `/usage`, and `/env` commands are now available in ACP (Agent Coordination Protocol) sessions, allowing remote ACP clients to surface session details and manage context from within their own automated workflows.
519+
498520
The `/statusline` command (with `/footer` as an alias) lets you control which items appear in the terminal status bar. You can show or hide individual indicators like the working directory, current branch, effort level, context window usage, and quota. The **changes** toggle shows a running count of added/removed lines for the session — useful when tracking the scope of an ongoing edit:
499521

500522
```
@@ -519,6 +541,8 @@ The `/allow-all` command (also accessible as `/yolo`) enables autopilot mode, wh
519541

520542
> **Note**: `/allow-all on` permissions persist after `/clear` starts a new session, so you don't need to re-enable it each time.
521543
544+
> **ACP clients (v1.0.39+)**: ACP clients can also toggle allow-all mode programmatically via session configuration, without issuing a slash command. This is useful for automated pipelines that drive Copilot CLI through the ACP protocol.
545+
522546
The `--effort` flag (shorthand for `--reasoning-effort`) controls how much computational reasoning the model applies to a request:
523547

524548
```bash

0 commit comments

Comments
 (0)