Copilot Claude agent session: surface custom slash commands from .claude/commands in chat autocomplete
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Feature
Surface Claude Agent SDK custom slash commands (`.claude/commands/*.md`) in the Claude agent session's `/` autocomplete.
## Current behavior
The Claude chat session (`chatSessions` contribution, type `claude-code`) shows only the **static** command list declared in the Copilot extension manifest (`/init`, `/review`, `/simplify`, `/pr-comments`, …) when typing `/` in the chat input.
However, the session runs the Claude Agent SDK with `settingSources: ["user","project","local"]`, so project-level custom slash commands in `.claude/commands/*.md` **are loaded and fully executable** — typing e.g. `/speckit.specify build a login page` in full works correctly. They just never appear in autocomplete, so they are effectively undiscoverable.
The `ClaudeCustomizationProvider` already surfaces `.claude/agents`, `.claude/skills`, instructions, and hooks via `provideChatSessionCustomizations`, but not `.claude/commands`.
## Expected behavior
Typing `/spec` in a Claude session suggests `/speckit.specify`, `/speckit.plan`, etc. — i.e. custom commands discovered from `.claude/commands/` (workspace and user scopes), the same way Claude Code's own UI and the SDK's `init` message (`slash_commands`) expose them.
## Why it matters
- GitHub's own [spec-kit](https://github.com/github/spec-kit) installs its workflow as `.claude/commands/speckit.*.md`; users switching to the Copilot Claude session lose discoverability of the entire workflow (see e.g. github/spec-kit#865).
- The SDK already reports available slash commands at session init, so the data exists — only the completion wiring is missing.
## Suggested implementation
Either:
1. Extend `ClaudeCustomizationProvider.provideChatSessionCustomizations` to also emit `.claude/commands/*.md` as user-invocable prompt-type customizations (they already flow into `harnessService.getSlashCommands`), or
2. Populate the session's command list dynamically from the SDK `init` message's `slash_commands` field.
## Environment
- VS Code 1.127.0 (darwin-arm64)
- Copilot extension (built-in) 0.55.0, `github.copilot.chat.claudeAgent.useSdkExtension: true`
- ms-vscode.vscode-claude-sdk 0.1.1
## Workaround
Manually patching `contributes.chatSessions[type=claude-code].commands` in the built-in extension's `package.json` (plus clearing `extensions.builtin.cache`) makes the commands autocomplete and execute correctly — confirming only the static picker is the gap. This obviously does not survive VS Code updates.
Contributor guide
Assessment
This issue has not been assessed yet.