You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/copilot/reference/copilot-cli-reference/cli-command-reference.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -382,7 +382,7 @@ copilot --allow-tool='MyMCP'
382
382
|`GH_HOST`| {% data variables.product.github %} hostname for both {% data variables.product.prodname_cli %} and {% data variables.copilot.copilot_cli_short %} (default: `github.com`). Set to your {% data variables.product.prodname_ghe_cloud %} with data residency hostname. Override with `COPILOT_GH_HOST` for {% data variables.copilot.copilot_cli_short %} only. |
383
383
|`GH_TOKEN`| Authentication token. Takes precedence over `GITHUB_TOKEN`. |
384
384
|`GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS`| Set to `true` to load project extensions and allow extension management tools in prompt mode (`-p`). Disabled by default to prevent running repository-controlled extension code without interactive trust. |
385
-
|`GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS`| Set to `true` to load repository hooks in prompt mode (`-p`). Disabled by default to prevent running repository-provided hook commands without interactive trust confirmation. |
385
+
|`GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS`| Set to `true` to load repository hooks in prompt mode (`-p`). Repository hooks also load automatically when the folder is already trusted or `COPILOT_ALLOW_ALL` is set. |
386
386
|`GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP`| Set to `true` to load workspace MCP sources in prompt mode (`-p`). Disabled by default to prevent starting repository-controlled MCP servers without interactive trust. |
387
387
|`GITHUB_TOKEN`| Authentication token. |
388
388
|`PLAIN_DIFF`| Set to `true` to disable rich diff rendering. |
Copy file name to clipboardExpand all lines: content/copilot/reference/copilot-cli-reference/cli-config-dir-reference.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -238,13 +238,15 @@ These settings apply across all your sessions and repositories. You can edit thi
238
238
|`mouse`|`boolean`|`true`| Enable mouse support in alt screen mode. Can also be set with `--mouse` or `--no-mouse`. |
239
239
|`powershellFlags`|`string[]`|`["-NoProfile", "-NoLogo"]`| Flags passed to PowerShell on startup. On Windows, the CLI prefers PowerShell 7+ (`pwsh`) and falls back to Windows PowerShell (`powershell.exe`) when `pwsh` is unavailable. Windows only. |
240
240
|`renderMarkdown`|`boolean`|`true`| Render Markdown in terminal output. |
241
+
|`remoteExport`|`boolean`|`true`| Export sessions remotely when session sync is available. Set to `false` to opt out of remote export by default. The `remoteSessions` setting when set to `true`, or the `--remote` flag, still enables export and steering regardless of this setting. |
241
242
|`respectGitignore`|`boolean`|`true`| Exclude gitignored files from the `@` file mention picker. When `false`, the picker includes files normally excluded by `.gitignore`. |
|`skillDirectories`|`string[]`|`[]`| Additional directories to search for custom skill definitions (in addition to `~/.copilot/skills/`). |
244
245
|`statusLine`|`object`| — | Custom status line display. `type`: must be `"command"`. `command`: path to an executable script that receives session JSON on stdin and prints status content to stdout. `padding`: optional number of left-padding spaces. |
245
246
|`storeTokenPlaintext`|`boolean`|`false`| Allow authentication tokens to be stored in plain text in `config.json` when no system keychain is available. |
|`streamerMode`|`boolean`|`false`| Hide preview model names and quota details. Useful when demonstrating {% data variables.copilot.copilot_cli_short %} or screen sharing. |
249
+
|`terminalProgress`|`boolean`|`true`| Emit OSC 9;4 terminal progress indicators while the agent is working. Supported terminals include Windows Terminal, iTerm2, Ghostty, and ConEmu. |
248
250
|`theme`|`"auto"`\|`"dark"`\|`"light"`|`"auto"`| Terminal color theme. `"auto"` detects the terminal background and chooses accordingly. |
249
251
|`updateTerminalTitle`|`boolean`|`true`| Show the current intent in the terminal tab or window title. |
Copy file name to clipboardExpand all lines: content/copilot/reference/hooks-reference.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ The table below lists every supported event. The **Cloud agent** column shows wh
166
166
|`errorOccurred`| An error occurs during execution. | No | Fires. |
167
167
|`notification`| Fires asynchronously when the CLI emits a system notification (shell completion, agent completion or idle, permission prompts, elicitation dialogs). Fire-and-forget: never blocks the session. Supports `matcher` regex on `notification_type`. | Optional — can inject `additionalContext` into the session. |**Does not fire.** Cloud agent does not surface notifications to a user (see the **Interactivity** row in the Cloud agent execution environment table above). |
168
168
|`permissionRequest`| Fires before the permission service runs (rules engine, session approvals, auto-allow/auto-deny, and user prompting). If the merged hook output returns `behavior: "allow"` or `"deny"`, that decision short-circuits the normal permission flow. Supports `matcher` regex on `toolName`. | Yes — can allow or deny programmatically. | Tool calls are pre-approved, so this hook either does not fire or has no effect. Use `preToolUse` to make permission decisions instead. |
169
-
|`postToolUse`| After each tool completes successfully. |No| Fires. |
169
+
|`postToolUse`| After each tool completes successfully. |Yes — can modify the tool result or inject additional context for the model.| Fires. |
170
170
|`postToolUseFailure`| After a tool completes with a failure. | Yes — can provide recovery guidance via `additionalContext` (exit code `2` for command hooks). | Fires. |
171
171
|`preCompact`| Context compaction is about to begin (manual or automatic). Supports `matcher` to filter by trigger (`"manual"` or `"auto"`). | No — notification only. | Fires only with `trigger: "auto"`. There is no user to request manual compaction. |
172
172
|`preToolUse`| Before each tool executes. | Yes — can allow, deny, or modify. | Fires. A decision of `"ask"` is treated as `"deny"` because no user is available to answer. |
@@ -510,6 +510,30 @@ The `preToolUse` hook can control tool execution by writing a JSON object to std
510
510
|`decision`|`"block"`, `"allow"`|`"block"` forces another agent turn using `reason` as the prompt. |
511
511
|`reason`| string | Prompt for the next turn when `decision` is `"block"`. |
512
512
513
+
## `postToolUse` output
514
+
515
+
The `postToolUse` hook can modify the tool result or inject additional context for the model by writing a JSON object to stdout.
516
+
517
+
```typescript
518
+
{
519
+
modifiedResult?: {
520
+
resultType: "success";
521
+
textResultForLlm: string;
522
+
};
523
+
additionalContext?:string;
524
+
}
525
+
```
526
+
527
+
| Field | Type | Description |
528
+
|-------|------|-------------|
529
+
|`modifiedResult`| object | Replacement tool result. Must have `resultType: "success"`. If returned with `resultType: "failure"`, the failure routes downstream and `postToolUseFailure` fires next. |
530
+
|`additionalContext`| string | Additional guidance appended to `textResultForLlm` so the model sees it after the tool output on the same turn. When multiple hooks return `additionalContext`, the results are joined with a double newline and capped at 10 KB. |
531
+
532
+
Return `{}` or empty output to keep the original successful result.
533
+
534
+
> [!NOTE]
535
+
> `modifiedResult` is honored by both SDK programmatic hooks and command/HTTP config-file `postToolUse` hooks.
0 commit comments