Skip to content

Commit c63db63

Browse files
docs(learning-hub): update pages with CLI v1.0.10-1.0.12 features (#1200)
- automating-with-hooks: add plugin hook env vars (CLAUDE_PROJECT_DIR, CLAUDE_PLUGIN_DATA, {{project_dir}}, {{plugin_data_dir}}); add .claude/settings.json as hooks config location - copilot-configuration-basics: add /allow-all on/off/show subcommands; document .claude/settings.json and .claude/settings.local.json as per-repo config sources; add model picker full-screen and inline reasoning effort note - understanding-mcp-servers: add MCP sampling (LLM inference) section; note that blocked servers are hidden from /mcp show 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 7e375ea commit c63db63

3 files changed

Lines changed: 68 additions & 4 deletions

File tree

website/src/content/docs/learning-hub/automating-with-hooks.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Automating with Hooks'
33
description: 'Learn how to use hooks to automate lifecycle events like formatting, linting, and governance checks during Copilot agent sessions.'
44
authors:
55
- GitHub Copilot Learning Hub Team
6-
lastUpdated: 2026-03-24
6+
lastUpdated: 2026-03-27
77
estimatedReadingTime: '8 minutes'
88
tags:
99
- hooks
@@ -328,6 +328,34 @@ The `subagentStart` hook fires when the main agent spawns a subagent (e.g., via
328328

329329
This is especially useful in multi-agent workflows where subagents may not automatically inherit context from the parent session.
330330

331+
### Plugin Hook Environment Variables
332+
333+
When hooks are defined inside a **plugin**, Copilot CLI automatically injects two extra environment variables so scripts can locate project-specific and plugin-specific directories:
334+
335+
| Variable | Description |
336+
|----------|-------------|
337+
| `CLAUDE_PROJECT_DIR` | Absolute path to the working project directory |
338+
| `CLAUDE_PLUGIN_DATA` | Absolute path to the plugin's persistent data directory |
339+
340+
You can also reference these paths as template variables in your hook configuration:
341+
342+
```json
343+
{
344+
"version": 1,
345+
"hooks": {
346+
"postToolUse": [
347+
{
348+
"type": "command",
349+
"bash": "{{plugin_data_dir}}/scripts/format.sh {{project_dir}}",
350+
"timeoutSec": 30
351+
}
352+
]
353+
}
354+
}
355+
```
356+
357+
This is useful for plugins that bundle scripts or data files alongside their hooks, since `{{plugin_data_dir}}` always points to the correct installed location regardless of where the plugin is installed.
358+
331359
## Writing Hook Scripts
332360

333361
For complex logic, use bundled scripts instead of inline bash commands:
@@ -377,6 +405,7 @@ echo "Pre-commit checks passed ✅"
377405
A: There are several supported locations, loaded in order of precedence:
378406

379407
- **Repository-level** (shared with team): `.github/hooks/*.json` in your repository — all JSON files in this folder are loaded automatically
408+
- **Claude/Copilot project settings**: `.claude/settings.json` and `.claude/settings.local.json` — hooks defined here are applied to the current repository without committing them to `.github/`
380409
- **Global settings**: `settings.json` or `settings.local.json` (user-level CLI config)
381410
- **Legacy config**: `config.json` (also supported)
382411

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

Lines changed: 22 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-03-25
6+
lastUpdated: 2026-03-27
77
estimatedReadingTime: '10 minutes'
88
tags:
99
- configuration
@@ -394,6 +394,17 @@ CLI settings use **camelCase** naming. Key settings added in recent releases:
394394

395395
> **Note**: Older snake_case names (e.g., `include_gitignored`, `auto_updates_channel`) are still accepted for backward compatibility, but camelCase is now the preferred format.
396396
397+
In addition to the main config file, GitHub Copilot CLI reads two optional per-project files for repository-specific overrides:
398+
399+
- `.claude/settings.json` — committed project settings
400+
- `.claude/settings.local.json` — local overrides (add to `.gitignore` for personal adjustments)
401+
402+
These files follow the same format as `config.json` and are loaded after the global config, so they can tailor CLI behaviour—including hook definitions—per repository without touching `.github/`.
403+
404+
### Model Picker
405+
406+
The model picker opens in a **full-screen view** with inline reasoning effort adjustment. Use the **← / →** arrow keys to change the reasoning effort level (`low`, `medium`, `high`) directly from the picker without leaving the session. The current reasoning effort level is also displayed in the model header (e.g., `claude-sonnet-4.6 (high)`) so you always know which level is active.
407+
397408
### CLI Session Commands
398409

399410
GitHub Copilot CLI has two commands for managing session state, with distinct behaviours:
@@ -421,6 +432,16 @@ The `/cd` command changes the working directory for the current session. Each se
421432

422433
This is useful when you have multiple backgrounded sessions each focused on a different project directory.
423434

435+
The `/allow-all` command (also accessible as `/yolo`) enables a mode where the agent can execute tools without per-action confirmation. It now supports explicit subcommands:
436+
437+
```
438+
/allow-all on # Enable allow-all mode
439+
/allow-all off # Disable allow-all mode
440+
/allow-all show # Check whether allow-all mode is currently active
441+
```
442+
443+
Path permissions granted via `/allow-all` persist across `/clear`, so if you've granted access to a directory in one session, that access carries into the new session.
444+
424445
The `--effort` flag (shorthand for `--reasoning-effort`) controls how much computational reasoning the model applies to a request:
425446

426447
```bash

website/src/content/docs/learning-hub/understanding-mcp-servers.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Understanding MCP Servers'
33
description: 'Learn how Model Context Protocol servers extend GitHub Copilot with access to external tools, databases, and APIs.'
44
authors:
55
- GitHub Copilot Learning Hub Team
6-
lastUpdated: 2026-03-24
6+
lastUpdated: 2026-03-27
77
estimatedReadingTime: '8 minutes'
88
tags:
99
- mcp
@@ -178,6 +178,20 @@ current data distribution.
178178

179179
Without the MCP server, the agent would have to guess at database structure and performance characteristics. With it, the agent works with real data.
180180

181+
## MCP Sampling (LLM Inference Requests)
182+
183+
Some advanced MCP servers can request **LLM inference** from the Copilot model — a capability defined in the MCP specification as *sampling*. Instead of only receiving tool calls from the AI, these servers can ask Copilot to generate text or make decisions as part of their own logic.
184+
185+
**How it works**:
186+
1. An MCP server sends a `sampling/createMessage` request to Copilot.
187+
2. Copilot shows a **review prompt** to the user, explaining what the server is requesting.
188+
3. The user approves or rejects the request.
189+
4. If approved, Copilot generates the response and returns it to the server.
190+
191+
This enables sophisticated patterns like MCP servers that orchestrate multi-step reasoning, generate structured output, or build more complex AI pipelines — while keeping the user in control with an explicit approval step.
192+
193+
> **Note**: Sampling requires explicit user approval every time a server requests inference. This is a security boundary — MCP servers cannot silently consume your AI quota or exfiltrate context without your knowledge.
194+
181195
## Finding MCP Servers
182196

183197
The MCP ecosystem is growing rapidly. Here are key resources:
@@ -205,7 +219,7 @@ MCP server SDKs are available in [Python](https://github.com/modelcontextprotoco
205219
- **Document your servers**: Add comments or a README explaining which MCP servers your project uses and why.
206220
- **Version control carefully**: Commit `.mcp.json` or `.vscode/mcp.json` for shared server configurations, but use `.gitignore` for any files containing credentials.
207221
- **Test server connectivity**: Verify MCP servers start correctly before relying on them in agent workflows.
208-
- **Use the MCP allowlist (experimental)**: In high-security environments, the `MCP_ALLOWLIST` feature flag lets you validate MCP servers against a configured registry, blocking unrecognized servers from loading. This is an experimental feature for enterprise environments requiring strict control over which MCP servers are permitted.
222+
- **Use the MCP allowlist (experimental)**: In high-security environments, the `MCP_ALLOWLIST` feature flag lets you validate MCP servers against a configured registry, blocking unrecognized servers from loading. MCP servers that are blocked by the allowlist policy are **hidden from `/mcp show`** to avoid confusion — only permitted servers appear in that view. This is an experimental feature for enterprise environments requiring strict control over which MCP servers are permitted.
209223

210224
### Organization Policy for Third-Party MCP Servers
211225

0 commit comments

Comments
 (0)