From 463971e0abea090b3207905bcbcc6406257d8c32 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 19 Mar 2026 09:14:31 +0000 Subject: [PATCH] docs: update Learning Hub with Copilot CLI v1.0.7-v1.0.9 changes - Add subagentStart hook event to hooks page (added in v1.0.7) - Update hook file location docs to cover settings.json/settings.local.json/config.json support (v1.0.8) - Note cross-platform camelCase/PascalCase hook event name compatibility (v1.0.6) - Add MCP_ALLOWLIST registry validation tip to MCP servers page (v1.0.8) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../content/docs/learning-hub/automating-with-hooks.md | 10 ++++++++-- .../docs/learning-hub/understanding-mcp-servers.md | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/website/src/content/docs/learning-hub/automating-with-hooks.md b/website/src/content/docs/learning-hub/automating-with-hooks.md index 1a688226b..b5f12ffd8 100644 --- a/website/src/content/docs/learning-hub/automating-with-hooks.md +++ b/website/src/content/docs/learning-hub/automating-with-hooks.md @@ -3,7 +3,7 @@ title: 'Automating with Hooks' description: 'Learn how to use hooks to automate lifecycle events like formatting, linting, and governance checks during Copilot agent sessions.' authors: - GitHub Copilot Learning Hub Team -lastUpdated: 2026-02-26 +lastUpdated: 2026-03-19 estimatedReadingTime: '8 minutes' tags: - hooks @@ -93,6 +93,7 @@ Hooks can trigger on several lifecycle events: | `preToolUse` | Before the agent uses any tool (e.g., `bash`, `edit`) | **Approve or deny** tool executions, block dangerous commands, enforce security policies | | `postToolUse` | After a tool completes execution | Log results, track usage, format code after edits, send failure alerts | | `agentStop` | Main agent finishes responding to a prompt | Run final linters/formatters, validate complete changes | +| `subagentStart` | A subagent is spawned | Inject additional context into the subagent's prompt, log subagent creation | | `subagentStop` | A subagent completes before returning results | Audit subagent outputs, log subagent activity | | `errorOccurred` | An error occurs during agent execution | Log errors for debugging, send notifications, track error patterns | @@ -327,7 +328,12 @@ echo "Pre-commit checks passed ✅" **Q: Where do I put hooks configuration files?** -A: Place them in the `.github/hooks/` directory in your repository (e.g., `.github/hooks/my-hook.json`). You can have multiple hook files — all are loaded automatically. This makes hooks available to all team members. +A: You have two options: + +- **Repository hooks** (shared with all team members): Place them in the `.github/hooks/` directory (e.g., `.github/hooks/my-hook.json`). All JSON files in that directory are loaded automatically. +- **Personal/user-level hooks**: Define them directly in your `settings.json`, `settings.local.json`, or `config.json` user settings files. This is useful for hooks you want to apply globally across all projects without committing them to a repository. + +Hook configuration files use the same `hooks` key regardless of where they're stored, and work across VS Code, Claude Code, and the CLI — both camelCase and PascalCase event names are accepted. **Q: Can hooks access the user's prompt text?** diff --git a/website/src/content/docs/learning-hub/understanding-mcp-servers.md b/website/src/content/docs/learning-hub/understanding-mcp-servers.md index 482b9181d..992e6b9a0 100644 --- a/website/src/content/docs/learning-hub/understanding-mcp-servers.md +++ b/website/src/content/docs/learning-hub/understanding-mcp-servers.md @@ -3,7 +3,7 @@ title: 'Understanding MCP Servers' description: 'Learn how Model Context Protocol servers extend GitHub Copilot with access to external tools, databases, and APIs.' authors: - GitHub Copilot Learning Hub Team -lastUpdated: 2026-02-26 +lastUpdated: 2026-03-19 estimatedReadingTime: '8 minutes' tags: - mcp @@ -195,6 +195,7 @@ MCP server SDKs are available in [Python](https://github.com/modelcontextprotoco - **Document your servers**: Add comments or a README explaining which MCP servers your project uses and why. - **Version control carefully**: Commit `.vscode/mcp.json` for shared server configurations, but use `.gitignore` for any files containing credentials. - **Test server connectivity**: Verify MCP servers start correctly before relying on them in agent workflows. +- **Validate against a registry (experimental)**: If your organization maintains an approved list of MCP servers, you can enable the `MCP_ALLOWLIST` feature flag to validate configured servers against registered registries. This provides an extra layer of governance for teams that want to restrict which MCP servers can be used. ## Common Questions