Command Purpose copilotLaunch the interactive user interface. copilot help [topic]Display help information. Help topics include: config, commands, environment, logging, and permissions. copilot initInitialize Copilot custom instructions for this repository. copilot updateDownload and install the latest version. copilot versionDisplay version information and check for updates. copilot loginAuthenticate with Copilot via the OAuth device flow. Accepts --host HOST to specify the GitHub host URL (default: https://github.com). copilot logoutSign out of GitHub and remove stored credentials. copilot pluginManage plugins and plugin marketplaces.
Shortcut Purpose @ FILENAMEInclude file contents in the context. Ctrl +X then /After you have started typing a prompt, this allows you to run a slash command—for example, if you want to change the model without having to retype your prompt. Esc Cancel the current operation. ! COMMANDExecute a command in your local shell, bypassing Copilot. Ctrl +C Cancel operation / clear input. Press twice to exit. Ctrl +D Shutdown. Ctrl +L Clear the screen. Shift +Tab Cycle between standard, plan, and autopilot mode.
Shortcut Purpose ctrl+o While there is nothing in the prompt input, this expands recent items in Copilot's response timeline to show more details. ctrl+e While there is nothing in the prompt input, this expands all items in Copilot's response timeline. ctrl+t Expand/collapse display of reasoning in responses.
Shortcut Purpose Ctrl +A Move to beginning of the line (when typing). Ctrl +B Move to the previous character. Ctrl +E Move to end of the line (when typing). Ctrl +F Move to the next character. Ctrl +G Edit the prompt in an external editor. Ctrl +H Delete the previous character. Ctrl +K Delete from cursor to end of the line. If the cursor is at the end of the line, delete the line break. Ctrl +U Delete from cursor to beginning of the line. Ctrl +W Delete the previous word. Home Move to the start of the current line. End Move to the end of the current line. Ctrl +Home Move to the start of the text. Ctrl +End Move to the end of the text. Meta +← /→ Move the cursor by a word. ↑ /↓ Navigate the command history.
Command Purpose /add-dir PATHAdd a directory to the allowed list for file access. /agentBrowse and select from available agents (if any). /allow-all, /yoloEnable all permissions (tools, paths, and URLs). /clear, /newClear the conversation history. /compactSummarize the conversation history to reduce context window usage. /contextShow the context window token usage and visualization. /cwd, /cd [PATH]Change the working directory or display the current directory. /delegate [PROMPT]Delegate changes to a remote repository with an AI-generated pull request. /diffReview the changes made in the current directory. /exit, /quitExit the CLI. /experimental [on|off]Toggle or turn on/off experimental features. /feedbackProvide feedback about the CLI. /fleet [PROMPT]Enable parallel subagent execution of parts of a task. See Running tasks in parallel with the /fleet command . /helpShow the help for interactive commands. /ideConnect to an IDE workspace. /initInitialize Copilot custom instructions and agentic features for this repository. /list-dirsDisplay all of the directories for which file access has been allowed. /loginLog in to Copilot. /logoutLog out of Copilot. /lsp [show|test|reload|help] [SERVER-NAME]Manage the language server configuration. /mcp [show|add|edit|delete|disable|enable] [SERVER-NAME]Manage the MCP server configuration. /model, /models [MODEL]Select the AI model you want to use. /plan [PROMPT]Create an implementation plan before coding. /plugin [marketplace|install|uninstall|update|list] [ARGS...]Manage plugins and plugin marketplaces. /rename NAMERename the current session (alias for /session rename). /reset-allowed-toolsReset the list of allowed tools. /resume [SESSION-ID]Switch to a different session by choosing from a list (optionally specify a session ID). /review [PROMPT]Run the code review agent to analyze changes. /session [checkpoints [n]|files|plan|rename NAME]Show session information and a workspace summary. Use the subcommands for details. /share [file|gist] [PATH]Share the session to a Markdown file or GitHub gist. /skills [list|info|add|remove|reload] [ARGS...]Manage skills for enhanced capabilities. /terminal-setupConfigure the terminal for multiline input support (Shift +Enter and Ctrl +Enter ). /theme [show|set|list] [auto|THEME-ID]View or configure the terminal theme. /usageDisplay session usage metrics and statistics. /user [show|list|switch]Manage the current GitHub user.
For a complete list of available slash commands enter /help in the CLI's interactive interface.
Option Purpose --acpStart the Agent Client Protocol server. --add-dir=PATHAdd a directory to the allowed list for file access (can be used multiple times). --add-github-mcp-tool=TOOLAdd a tool to enable for the GitHub MCP server, instead of the default CLI subset (can be used multiple times). Use * for all tools. --add-github-mcp-toolset=TOOLSETAdd a toolset to enable for the GitHub MCP server, instead of the default CLI subset (can be used multiple times). Use all for all toolsets. --additional-mcp-config=JSONAdd an MCP server for this session only. The server configuration can be supplied as a JSON string or a file path (prefix with @). Augments the configuration from ~/.copilot/mcp-config.json. Overrides any installed MCP server configuration with the same name. --agent=AGENTSpecify a custom agent to use. --allow-allEnable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls). --allow-all-pathsDisable file path verification and allow access to any path. --allow-all-toolsAllow all tools to run automatically without confirmation. Required when using the CLI programmatically (env: COPILOT_ALLOW_ALL). --allow-all-urlsAllow access to all URLs without confirmation. --allow-tool=TOOL ...Tools the CLI has permission to use. Will not prompt for permission. For multiple tools, use a quoted, comma-separated list. --allow-url=URL ...Allow access to specific URLs or domains. For multiple URLs, use a quoted, comma-separated list. --alt-screen=VALUEUse the terminal alternate screen buffer (on or off). --autopilotEnable autopilot continuation in prompt mode. See Allowing GitHub Copilot CLI to work autonomously . --available-tools=TOOL ...Only these tools will be available to the model. For multiple tools, use a quoted, comma-separated list. --bannerShow the startup banner. --bash-envEnable BASH_ENV support for bash shells. --config-dir=PATHSet the configuration directory (default: ~/.copilot). --continueResume the most recent session. --deny-tool=TOOL ...Tools the CLI does not have permission to use. Will not prompt for permission. For multiple tools, use a quoted, comma-separated list. --deny-url=URL ...Deny access to specific URLs or domains, takes precedence over --allow-url. For multiple URLs, use a quoted, comma-separated list. --disable-builtin-mcpsDisable all built-in MCP servers (currently: github-mcp-server). --disable-mcp-server=SERVER-NAMEDisable a specific MCP server (can be used multiple times). --disable-parallel-tools-executionDisable parallel execution of tools (LLM can still make parallel tool calls, but they will be executed sequentially). --disallow-temp-dirPrevent automatic access to the system temporary directory. --enable-all-github-mcp-toolsEnable all GitHub MCP server tools, instead of the default CLI subset. Overrides the --add-github-mcp-toolset and --add-github-mcp-tool options. --excluded-tools=TOOL ...These tools will not be available to the model. For multiple tools, use a quoted, comma-separated list. --experimentalEnable experimental features (use --no-experimental to disable). -h, --helpDisplay help. -i PROMPT, --interactive=PROMPTStart an interactive session and automatically execute this prompt. --log-dir=DIRECTORYSet the log file directory (default: ~/.copilot/logs/). --log-level=LEVELSet the log level (choices: none, error, warning, info, debug, all, default). --max-autopilot-continues=COUNTMaximum number of continuation messages in autopilot mode (default: unlimited). See Allowing GitHub Copilot CLI to work autonomously . --model=MODELSet the AI model you want to use. --no-alt-screenDisable the terminal alternate screen buffer. --no-ask-userDisable the ask_user tool (the agent works autonomously without asking questions). --no-auto-updateDisable downloading CLI updates automatically. --no-bash-envDisable BASH_ENV support for bash shells. --no-colorDisable all color output. --no-custom-instructionsDisable loading of custom instructions from AGENTS.md and related files. --no-experimentalDisable experimental features. --output-format=FORMATFORMAT can be text (default) or json (outputs JSONL: one JSON object per line). -p PROMPT, --prompt=PROMPTExecute a prompt programmatically (exits after completion). --plain-diffDisable rich diff rendering (syntax highlighting via the diff tool specified by your git config). --resume=SESSION-IDResume a previous interactive session by choosing from a list (optionally specify a session ID). -s, --silentOutput only the agent response (without usage statistics), useful for scripting with -p. --screen-readerEnable screen reader optimizations. --secret-env-vars=VAR ...An environment variable whose value you want redacted in output. For multiple variables, use a quoted, comma-separated list. The values in the GITHUB_TOKEN and COPILOT_GITHUB_TOKEN environment variables are redacted by default. --share=PATHShare a session to a Markdown file after completion of a programmatic session (default path: ./copilot-session-<ID>.md). --share-gistShare a session to a secret GitHub gist after completion of a programmatic session. --stream=MODEEnable or disable streaming mode (mode choices: on or off). -v, --versionShow version information. --yoloEnable all permissions (equivalent to --allow-all).
For a complete list of commands and options, run copilot help.
The --available-tools and --excluded-tools options support the following values for specifying tools:
Tool name Description bash / powershellExecute commands read_bash / read_powershellRead output from a shell session write_bash / write_powershellSend input to a shell session stop_bash / stop_powershellTerminate a shell session list_bash / list_powershellList active shell sessions
Tool name Description viewRead files or directories createCreate new files editEdit files via string replacement apply_patchApply patches (used by some models instead of edit/create)
Tool name Description taskRun sub-agents read_agentCheck background agent status list_agentsList available agents
Tool name Description grep (or rg)Search for text in files globFind files matching patterns web_fetchFetch and parse web content skillInvoke custom skills ask_userAsk the user a question report_intentReport what the agent plans to do show_fileDisplay a file prominently fetch_copilot_cli_documentationLook up CLI documentation update_todoUpdate task checklist store_memoryPersist facts across sessions task_completeSignal task is done (autopilot only) exit_plan_modeExit plan mode sqlQuery session data (experimental) lspLanguage server refactoring (experimental)
The --allow-tool and --deny-tool options accept permission patterns in the format Kind(argument). The argument is optional—omitting it matches all tools of that kind.
Kind Description Example patterns shellShell command execution shell(git push), shell(git:*), shellwriteFile creation or modification write, write(src/*.ts)readFile or directory reads read, read(.env)SERVER-NAME MCP server tool invocation MyMCP(create_issue), MyMCPurlURL access via web-fetch or shell url(github.com), url(https://*.api.com)memoryStoring facts to agent memory memory
For shell rules, the :* suffix matches the command stem followed by a space, preventing partial matches. For example, shell(git:*) matches git push and git pull but does not match gitea.
Deny rules always take precedence over allow rules, even when --allow-all is set.
# Allow all git commands except git push
copilot --allow-tool='shell(git:*)' --deny-tool='shell(git push)'
# Allow a specific MCP server tool
copilot --allow-tool='MyMCP(create_issue)'
# Allow all tools from a server
copilot --allow-tool='MyMCP'
Variable Description COPILOT_MODELSet the AI model. COPILOT_ALLOW_ALLSet to true to allow all permissions automatically (equivalent to --allow-all). COPILOT_AUTO_UPDATESet to false to disable automatic updates. COPILOT_CUSTOM_INSTRUCTIONS_DIRSComma-separated list of additional directories for custom instructions. COPILOT_SKILLS_DIRSComma-separated list of additional directories for skills. COPILOT_EDITOREditor command for interactive editing (checked after $VISUAL and $EDITOR). Defaults to vi if none are set. COPILOT_GITHUB_TOKENAuthentication token. Takes precedence over GH_TOKEN and GITHUB_TOKEN. COPILOT_HOMEOverride the configuration and state directory. Default: $HOME/.copilot. GH_TOKENAuthentication token. Takes precedence over GITHUB_TOKEN. GITHUB_TOKENAuthentication token. USE_BUILTIN_RIPGREPSet to false to use the system ripgrep instead of the bundled version. PLAIN_DIFFSet to true to disable rich diff rendering. COLORFGBGFallback for dark/light terminal background detection. COPILOT_CLI_ENABLED_FEATURE_FLAGSComma-separated list of feature flags to enable (for example, "SOME_FEATURE,SOME_OTHER_FEATURE").
Settings cascade from user to repository to local, with more specific scopes overriding more general ones. Command-line flags and environment variables always take the highest precedence.
Scope Location Purpose User ~/.copilot/config.jsonGlobal defaults for all repositories. Use the COPILOT_HOME environment variable to specify an alternative path. Repository .github/copilot/settings.jsonShared repository configuration (committed to the repository). Local .github/copilot/settings.local.jsonPersonal overrides (add this to .gitignore).
Key Type Default Description allowed_urlsstring[][]URLs or domains allowed without prompting. alt_screenbooleanfalseUse the terminal alternate screen buffer. auto_updatebooleantrueAutomatically download CLI updates. banner"always" | "once" | "never""once"Animated banner display frequency. bash_envbooleanfalseEnable BASH_ENV support for bash shells. beepbooleantruePlay an audible beep when attention is required. compact_pastebooleantrueCollapse large pastes into compact tokens. custom_agents.default_local_onlybooleanfalseOnly use local custom agents. denied_urlsstring[][]URLs or domains blocked (takes precedence over allowed_urls). experimentalbooleanfalseEnable experimental features. include_coauthorbooleantrueAdd a Co-authored-by trailer to git commits made by the agent. companyAnnouncementsstring[][]Custom messages shown randomly on startup. log_level"none" | "error" | "warning" | "info" | "debug" | "all" | "default""default"Logging verbosity. modelstringvaries AI model to use (see the /model command). powershell_flagsstring[]["-NoProfile", "-NoLogo"]Flags passed to PowerShell (pwsh) on startup. Windows only. reasoning_effort"low" | "medium" | "high" | "xhigh""medium"Reasoning effort level for extended thinking. Higher levels use more compute. render_markdownbooleantrueRender Markdown in terminal output. screen_readerbooleanfalseEnable screen reader optimizations. streambooleantrueEnable streaming responses. store_token_plaintextbooleanfalseStore authentication tokens in plaintext in the config file when no system keychain is available. streamer_modebooleanfalseHide preview model names and quota details (useful when recording). theme"auto" | "dark" | "light""auto"Terminal color theme. trusted_foldersstring[][]Folders with pre-granted file access. update_terminal_titlebooleantrueShow the current intent in the terminal title.
Repository settings apply to everyone who works in the repository. Only a subset of settings is supported at the repository level. Unsupported keys are ignored.
Key Type Merge behavior Description companyAnnouncementsstring[]Replaced—repository takes precedence Messages shown randomly on startup. enabledPluginsRecord<string, boolean>Merged—repository overrides user for same key Declarative plugin auto-install. extraKnownMarketplacesRecord<string, {...}>Merged—repository overrides user for same key Plugin marketplaces available in this repository. marketplacesRecord<string, {...}>Merged—repository overrides user for same key Plugin marketplaces (deprecated—use extraKnownMarketplaces).
Create .github/copilot/settings.local.json in the repository, for personal overrides that should not be committed. Add this file to .gitignore.
The local configuration file uses the same schema as the repository configuration file (.github/copilot/settings.json) and takes precedence over it.
Hooks are external commands that execute at specific lifecycle points during a session, enabling custom automation, security controls, and integrations. Hook configuration files are loaded automatically from .github/hooks/*.json in your repository.
Hook configuration files use JSON format with version 1.
Command hooks run shell scripts and are supported on all hook types.
{
"version" : 1 ,
"hooks" : {
"preToolUse" : [
{
"type" : "command" ,
"bash" : "your-bash-command" ,
"powershell" : "your-powershell-command" ,
"cwd" : "optional/working/directory" ,
"env" : { "VAR" : "value" } ,
"timeoutSec" : 30
}
]
}
}
Field Type Required Description type"command"Yes Must be "command". bashstring One of bash/powershell Shell command for Unix. powershellstring One of bash/powershell Shell command for Windows. cwdstring No Working directory for the command (relative to repository root or absolute). envobject No Environment variables to set (supports variable expansion). timeoutSecnumber No Timeout in seconds. Default: 30.
Prompt hooks auto-submit text as if the user typed it. They are only supported on sessionStart and run before any initial prompt passed via --prompt. The text can be a natural language prompt or a slash command.
{
"version" : 1 ,
"hooks" : {
"sessionStart" : [
{
"type" : "prompt" ,
"prompt" : "Your prompt text or /slash-command"
}
]
}
}
Field Type Required Description type"prompt"Yes Must be "prompt". promptstring Yes Text to submit—can be a natural language message or a slash command.
Event Fires when Output processed sessionStartA new or resumed session begins. No sessionEndThe session terminates. No userPromptSubmittedThe user submits a prompt. No preToolUseBefore each tool executes. Yes — can allow, deny, or modify. postToolUseAfter each tool completes. No agentStopThe main agent finishes a turn. Yes — can block and force continuation. subagentStopA subagent completes. Yes — can block and force continuation. errorOccurredAn error occurs during execution. No
The preToolUse hook can control tool execution by writing a JSON object to stdout.
Field Values Description permissionDecision"allow", "deny", "ask"Whether the tool executes. Empty output uses default behavior. permissionDecisionReasonstring Reason shown to the agent. Required when decision is "deny". modifiedArgsobject Substitute tool arguments to use instead of the originals.
Field Values Description decision"block", "allow""block" forces another agent turn using reason as the prompt.reasonstring Prompt for the next turn when decision is "block".
Tool name Description bashExecute shell commands (Unix). powershellExecute shell commands (Windows). viewRead file contents. editModify file contents. createCreate new files. globFind files by pattern. grepSearch file contents. web_fetchFetch web pages. taskRun subagent tasks.
If multiple hooks of the same type are configured, they execute in order. For preToolUse, if any hook returns "deny", the tool is blocked. Hook failures (non-zero exit codes or timeouts) are logged and skipped—they never block agent execution.
MCP servers provide additional tools to the CLI agent. Configure persistent servers in ~/.copilot/mcp-config.json. Use --additional-mcp-config to add servers for a single session.
Type Description Required fields local / stdioLocal process communicating via stdin/stdout. command, argshttpRemote server using streamable HTTP transport. urlsseRemote server using Server-Sent Events transport. url
Field Required Description commandYes Command to start the server. argsYes Command arguments (array). toolsYes Tools to enable: ["*"] for all, or a list of specific tool names. envNo Environment variables. Supports $VAR, ${VAR}, and ${VAR:-default} expansion. cwdNo Working directory for the server. timeoutNo Tool call timeout in milliseconds. typeNo "local" or "stdio". Default: "local".
Field Required Description typeYes "http" or "sse".urlYes Server URL. toolsYes Tools to enable. headersNo HTTP headers. Supports variable expansion. oauthClientIdNo Static OAuth client ID (skips dynamic registration). oauthPublicClientNo Whether the OAuth client is public. Default: true. timeoutNo Tool call timeout in milliseconds.
Control how MCP tool output is processed using the filterMapping field in a server's configuration.
Mode Description noneNo filtering. markdownFormat output as Markdown. hidden_charactersRemove hidden or control characters. Default.
The CLI includes built-in MCP servers that are available without additional setup.
Server Description github-mcp-serverGitHub API integration: issues, pull requests, commits, code search, and GitHub Actions. playwrightBrowser automation: navigate, click, type, screenshot, and form handling. fetchHTTP requests via the fetch tool. timeTime utilities: get_current_time and convert_time.
Use --disable-builtin-mcps to disable all built-in servers, or --disable-mcp-server SERVER-NAME to disable a specific one.
MCP servers are loaded from multiple sources, each with a different trust level.
Source Trust level Review required Built-in High No Repository (.github/mcp.json) Medium Recommended Workspace (.mcp.json, .vscode/mcp.json) Medium Recommended Dev Container (.devcontainer/devcontainer.json) Medium Recommended User config (~/.copilot/mcp-config.json) User-defined User responsibility Remote servers Low Always
All MCP tool invocations require explicit permission. This applies even to read-only operations on external services.
Skills are Markdown files that extend what the CLI can do. Each skill lives in its own directory containing a SKILL.md file. When invoked (via /SKILL-NAME or automatically by the agent), the skill's content is injected into the conversation.
Field Type Required Description namestring Yes Unique identifier for the skill. Letters, numbers, and hyphens only. Max 64 characters. descriptionstring Yes What the skill does and when to use it. Max 1024 characters. allowed-toolsstring or string[] No Comma-separated list or YAML array of tools that are automatically allowed when the skill is active. Use "*" for all tools. user-invocableboolean No Whether users can invoke the skill with /SKILL-NAME. Default: true. disable-model-invocationboolean No Prevent the agent from automatically invoking this skill. Default: false.
Skills are loaded from these locations in priority order (first found wins for duplicate names).
Location Scope Description .github/skills/Project Project-specific skills. .agents/skills/Project Alternative project location. .claude/skills/Project Claude-compatible location. Parent .github/skills/ Inherited Monorepo parent directory support. ~/.copilot/skills/Personal Personal skills for all projects. ~/.claude/skills/Personal Claude-compatible personal location. Plugin directories Plugin Skills from installed plugins. COPILOT_SKILLS_DIRSCustom Additional directories (comma-separated).
Commands are an alternative to skills stored as individual .md files in .claude/commands/. The command name is derived from the filename. Command files use a simplified format (no name field required) and support description, allowed-tools, and disable-model-invocation. Commands have lower priority than skills with the same name.
Custom agents are specialized AI agents defined in Markdown files. The filename (minus extension) becomes the agent ID. Use .agent.md or .md as the file extension.
Agent Default model Description code-reviewclaude-sonnet-4.5 High signal-to-noise code review. Analyzes diffs for bugs, security issues, and logic errors. exploreclaude-haiku-4.5 Fast codebase exploration. Searches files, reads code, and answers questions. Returns focused answers under 300 words. Safe to run in parallel. general-purposeclaude-sonnet-4.5 Full-capability agent for complex multi-step tasks. Runs in a separate context window. researchclaude-sonnet-4.6 Deep research agent. Generates a report based on information in your codebase, in relevant repositories, and on the web. taskclaude-haiku-4.5 Command execution (tests, builds, lints). Returns brief summary on success, full output on failure.
Field Type Required Description descriptionstring Yes Description shown in the agent list and task tool. inferboolean No Allow auto-delegation by the main agent. Default: true. mcp-serversobject No MCP servers to connect. Uses the same schema as ~/.copilot/mcp-config.json. modelstring No AI model for this agent. When unset, inherits the outer agent's model. namestring No Display name. Defaults to the filename. toolsstring[] No Tools available to the agent. Default: ["*"] (all tools).
Scope Location Project .github/agents/ or .claude/agents/User ~/.copilot/agents/ or ~/.claude/agents/Plugin <plugin>/agents/
Project-level agents take precedence over user-level agents. Plugin agents have the lowest priority.
When the CLI prompts for permission to execute an operation, you can respond with the following keys.
Key Effect yAllow this specific request once. nDeny this specific request once. !Allow all similar requests for the rest of the session. #Deny all similar requests for the rest of the session. ?Show detailed information about the request.
Session approvals reset when you run /clear or start a new session.
Flag Tier Description AUTOPILOT_MODEexperimentalAutonomous operation mode. BACKGROUND_AGENTSstaffRun agents in the background. QUEUED_COMMANDSstaffQueue commands while the agent is running. LSP_TOOLSonLanguage Server Protocol tools. PLAN_COMMANDonInteractive planning mode. AGENTIC_MEMORYonPersistent memory across sessions. CUSTOM_AGENTSonCustom agent definitions.
Copilot CLI can export traces and metrics via OpenTelemetry (OTel), giving you visibility into agent interactions, LLM calls, tool executions, and token usage. All signal names and attributes follow the OTel GenAI Semantic Conventions .
OTel is off by default with zero overhead. It activates when any of the following conditions are met:
COPILOT_OTEL_ENABLED=true
OTEL_EXPORTER_OTLP_ENDPOINT is set
COPILOT_OTEL_FILE_EXPORTER_PATH is set
Variable Default Description COPILOT_OTEL_ENABLEDfalseExplicitly enable OTel. Not required if OTEL_EXPORTER_OTLP_ENDPOINT is set. OTEL_EXPORTER_OTLP_ENDPOINT— OTLP endpoint URL. Setting this automatically enables OTel. COPILOT_OTEL_EXPORTER_TYPEotlp-httpExporter type: otlp-http or file. Auto-selects file when COPILOT_OTEL_FILE_EXPORTER_PATH is set. OTEL_SERVICE_NAMEgithub-copilotService name in resource attributes. OTEL_RESOURCE_ATTRIBUTES— Extra resource attributes as comma-separated key=value pairs. Use percent-encoding for special characters. OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTfalseCapture full prompt and response content. See Content capture . OTEL_LOG_LEVEL— OTel diagnostic log level: NONE, ERROR, WARN, INFO, DEBUG, VERBOSE, ALL. COPILOT_OTEL_FILE_EXPORTER_PATH— Write all signals to this file as JSON-lines. Setting this automatically enables OTel. COPILOT_OTEL_SOURCE_NAMEgithub.copilotInstrumentation scope name for tracer and meter. OTEL_EXPORTER_OTLP_HEADERS— Auth headers for the OTLP exporter (for example, Authorization=Bearer token).
The runtime emits a hierarchical span tree for each agent interaction. Each tree contains an invoke_agent root span, with chat and execute_tool child spans.
Wraps the entire agent invocation: all LLM calls and tool executions for one user message. Span kind: CLIENT.
Attribute Description gen_ai.operation.nameinvoke_agentgen_ai.provider.nameProvider (for example, github, anthropic) gen_ai.agent.idSession identifier gen_ai.agent.nameAgent name (subagents only) gen_ai.agent.descriptionAgent description (subagents only) gen_ai.agent.versionRuntime version gen_ai.conversation.idSession identifier gen_ai.request.modelRequested model gen_ai.response.modelResolved model gen_ai.response.idLast response ID gen_ai.response.finish_reasons["stop"] or ["error"]gen_ai.usage.input_tokensTotal input tokens (all turns) gen_ai.usage.output_tokensTotal output tokens (all turns) gen_ai.usage.cache_read.input_tokensCached input tokens read gen_ai.usage.cache_creation.input_tokensCached input tokens created github.copilot.turn_countNumber of LLM round-trips github.copilot.costMonetary cost github.copilot.aiuAI units consumed server.addressServer hostname server.portServer port error.typeError class name (on error) gen_ai.input.messagesFull input messages as JSON (content capture only) gen_ai.output.messagesFull output messages as JSON (content capture only) gen_ai.system_instructionsSystem prompt content as JSON (content capture only) gen_ai.tool.definitionsTool schemas as JSON (content capture only)
One span per LLM request. Span kind: CLIENT.
Attribute Description gen_ai.operation.namechatgen_ai.provider.nameProvider name gen_ai.request.modelRequested model gen_ai.conversation.idSession identifier gen_ai.response.idResponse ID gen_ai.response.modelResolved model gen_ai.response.finish_reasonsStop reasons gen_ai.usage.input_tokensInput tokens this turn gen_ai.usage.output_tokensOutput tokens this turn gen_ai.usage.cache_read.input_tokensCached tokens read gen_ai.usage.cache_creation.input_tokensCached tokens created github.copilot.costTurn cost github.copilot.aiuAI units consumed this turn github.copilot.server_durationServer-side duration github.copilot.initiatorRequest initiator github.copilot.turn_idTurn identifier github.copilot.interaction_idInteraction identifier server.addressServer hostname server.portServer port error.typeError class name (on error) gen_ai.input.messagesFull prompt messages as JSON (content capture only) gen_ai.output.messagesFull response messages as JSON (content capture only) gen_ai.system_instructionsSystem prompt content as JSON (content capture only)
One span per tool call. Span kind: INTERNAL.
Attribute Description gen_ai.operation.nameexecute_toolgen_ai.provider.nameProvider name (when available) gen_ai.tool.nameTool name (for example, readFile) gen_ai.tool.typefunctiongen_ai.tool.call.idTool call identifier gen_ai.tool.descriptionTool description error.typeError class name (on error) gen_ai.tool.call.argumentsTool input arguments as JSON (content capture only) gen_ai.tool.call.resultTool output as JSON (content capture only)
Metric Type Unit Description gen_ai.client.operation.durationHistogram s LLM API call and agent invocation duration gen_ai.client.token.usageHistogram tokens Token counts by type (input/output) gen_ai.client.operation.time_to_first_chunkHistogram s Time to receive first streaming chunk gen_ai.client.operation.time_per_output_chunkHistogram s Inter-chunk latency after first chunk
Metric Type Unit Description github.copilot.tool.call.countCounter calls Tool invocations by gen_ai.tool.name and success github.copilot.tool.call.durationHistogram s Tool execution latency by gen_ai.tool.name github.copilot.agent.turn.countHistogram turns LLM round-trips per agent invocation
Lifecycle events recorded on the active chat or invoke_agent span.
Event Description Key attributes github.copilot.session.truncationConversation history was truncated github.copilot.token_limit, github.copilot.pre_tokens, github.copilot.post_tokens, github.copilot.tokens_removed, github.copilot.messages_removedgithub.copilot.session.compaction_startHistory compaction began None github.copilot.session.compaction_completeHistory compaction completed github.copilot.success, github.copilot.pre_tokens, github.copilot.post_tokens, github.copilot.tokens_removed, github.copilot.messages_removedgithub.copilot.skill.invokedA skill was invoked github.copilot.skill.name, github.copilot.skill.path, github.copilot.skill.plugin_name, github.copilot.skill.plugin_versiongithub.copilot.session.shutdownSession is shutting down github.copilot.shutdown_type, github.copilot.total_premium_requests, github.copilot.lines_added, github.copilot.lines_removed, github.copilot.files_modified_countgithub.copilot.session.abortUser cancelled the current operation github.copilot.abort_reasonexceptionSession error github.copilot.error_type, github.copilot.error_status_code, github.copilot.error_provider_call_id
All signals carry these resource attributes.
Attribute Value service.namegithub-copilot (configurable via OTEL_SERVICE_NAME)service.versionRuntime version
By default, no prompt content, responses, or tool arguments are captured—only metadata like model names, token counts, and durations. To capture full content, set OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true.
Warning
Content capture may include sensitive information such as code, file contents, and user prompts. Only enable this in trusted environments.
When content capture is enabled, the following attributes are populated.
Attribute Content gen_ai.input.messagesFull prompt messages (JSON) gen_ai.output.messagesFull response messages (JSON) gen_ai.system_instructionsSystem prompt content (JSON) gen_ai.tool.definitionsTool schemas (JSON) gen_ai.tool.call.argumentsTool input arguments gen_ai.tool.call.resultTool output