Technical Reference

Frontmatter specs, compatibility matrices, MCP tool naming, and debugging playbook

Discovery

File Discovery Matrix

Which platform reads which files.

File / FolderClaude CodeVS Code Copilot
.claude/agents/*.mdYesYes
.github/agents/*.agent.mdNoYes
.claude/skills/*/SKILL.mdYesYes
.claude/rules/*.mdYesYes
.github/instructions/**/*.instructions.mdNoYes (recursive since v1.111)
CLAUDE.mdYesYes (via setting)
AGENTS.mdYes (v2.1.277+, via agents-md@builtin — default mode reads it only when there is no CLAUDE.md)Yes
.mcp.jsonYesNo
.vscode/mcp.jsonNoYes

Cross-Platform Rule

VS Code reads Claude’s formats. Claude does NOT read VS Code’s formats — with one exception since Claude Code v2.1.277: AGENTS.md, through the built-in agents-md@builtin plugin. Shared agents go in .claude/agents/. Shared skills go in .claude/skills/.

Frontmatter

Skill Frontmatter Spec

Every field a skill can use, with platform compatibility.

FieldRequiredClaude CodeCopilot CLI
nameYesSlash command nameSlash command name
descriptionYesAuto-invocation matchingHelp text
argument-hintNoUI placeholderUI placeholder
context: forkNoIsolated subagentIgnored (runs inline)
agentNoSubagent type for forkIgnored
modelNoAlias: opus / sonnet / haiku — never a pinned idIgnored
effortNolow / medium / high / xhigh / max — only honored from v2.1.267Ignored
pathsNoLimit auto-activation to file globsIgnored
disable-model-invocationNoPrevent auto-invokeSupported
Frontmatter

Agent Frontmatter Spec

Full field comparison across both platforms.

FieldClaude CodeCopilot
namekebab-casePascalCase
toolsComma string: Read, Glob, BashYAML list: [read, search, execute]
modelAlias: sonnet, opusFull string or array (fallback chain)
effortlow / medium / high / xhigh / maxNot supported
memoryproject / user / localNot supported
isolationworktreeNot supported
agentsN/ASubagent restriction list
handoffsN/AWorkflow navigation buttons
hooksSupported (settings.json + frontmatter)Frontmatter only (v1.111+ preview)
user-invocableN/AControls visibility in agent picker
maxTurnsNumberIgnored
permissionModeStringIgnored
Max bodyNo limit30,000 characters
MCP

MCP Tool Naming

Getting tool names right is critical -- wrong prefixes cause silent failures.

ContextFormatExample
Claude Code (project-level)mcp__<server>__<tool>mcp__ado__wit_work_item
Claude Code (plugin)mcp__plugin_<plugin>_<server>__<tool>mcp__plugin_dx-aem_AEM__getNodeContent
Copilot CLI / VS Code ChatBare name (no prefix)getNodeContent
Codex CLIBare name; TOML [mcp_servers.<server>]. Tool names constrained to ^[a-zA-Z0-9_-]+$ — dots disallowedgetNodeContent
Gemini CLImcp_<server>_<tool> (single underscore). Server name must not contain _mcp_aem_getnodecontent

Plugin MCP Prefix

MCP servers in a plugin’s .mcp.json get the full prefix: mcp__plugin_<plugin-name>_<server>__<tool>. Using the shorthand (mcp__AEM__ instead of mcp__plugin_dx-aem_AEM__) causes “tool not found” failures.

Copilot Tool Alias Mapping

Copilot AliasClaude Code Equivalent
execute / shellBash
readRead
editEdit, Write
searchGrep, Glob
agentTask (Agent tool)
webWebSearch, WebFetch
Hooks

Hook System

Which platform reads which hook file -- the plugin file is shared, the rest are not.

Hook SourceActive In
Plugin hooks/hooks.jsonClaude Code CLI (Stop / SubagentStop) and Copilot CLI — both read this same file
.github/hooks/hooks.jsonCopilot CLI only (v1.0.10+; Notification 1.0.18+; HTTP hooks 1.0.35+)
Agent frontmatter hooks:VS Code Chat only (v1.111+)

Copilot CLI v1.0.40+ needs an env var

Repo hooks in .github/hooks/hooks.json are silently ignored unless GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS=1 is exported in your shell. The same applies to project-root .mcp.json, which needs GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP=1.

Event names differ per platform

Claude Code uses Stop / SubagentStop; Copilot CLI uses agentStop / subagentStop. To give both platforms the same safety hooks, install to both locations — /dx-init step 9i does this for branch-guard and the Stop guard.

Hook Events

Pre-Tool Hooks

PreToolUse fires before any tool invocation. Use to block dangerous operations or modify input. The branch-guard hook blocks commits on protected branches.

Post-Tool Hooks

PostToolUse fires after tool completion. Use for auto-formatting, logging, or result processing. PostToolUseFailure fires on tool errors.

Hook Events (Claude Code)

Grouped by what they observe. This mirrors the list in CLAUDE.md; the upstream hooks reference occasionally adds events ahead of us, so treat it as current-as-of-our-last-sweep rather than exhaustive.

GroupEventsFires whenTypical use
SessionSessionStart, Setup, SessionEnd, InstructionsLoaded, ConfigChange, CwdChangedSession starts or ends, or its environment changesContext setup, re-read config, teardown
PromptUserPromptSubmit, UserPromptExpansionA prompt is submitted, before expansion completesAudit, inject context
ToolsPreToolUse, PostToolUse, PostToolUseFailure, PostToolBatch (parallel-tool batch)Around each tool invocation, or a parallel batchBlock dangerous ops, formatters, logging
PermissionsPermissionRequest, PermissionDeniedA permission is requested or deniedAudit trail, custom allow logic
StopStop, StopFailureThe agent finishes a turn, or fails toCleanup, completion guards
Subagents & tasksSubagentStart, SubagentStop, TaskCreated, TaskCompleted, TeammateIdleSubagent or background-task lifecycleTracking, result processing
Files & worktreesFileChanged, WorktreeCreate, WorktreeRemoveA file changes on disk, or a worktree is created/removedRe-index, workspace setup and teardown
ContextPreCompact, PostCompactImmediately before and after compactionPreserve state across a compact
OtherElicitation, ElicitationResult, NotificationInteractive elicitation, or a notification is raisedCustom prompts, external alerting

Handler type: values: command, http, mcp_tool, prompt, agent.

Hook Authoring — Key Fields

FieldPurposeExample
matcherWhich tool events to listen for”Bash”, “Edit”, “mcp__*figma*“
ifFine-grained permission-rule filter, evaluated before spawning”Bash(git commit*)“
statusMessageSpinner text while the hook runs”Checking branch protection…“
asyncNon-blocking background executiontrue for observational hooks
asyncRewakeBackground execution that wakes Claude on exit code 2true for long checks that must signal failure
timeoutSeconds before cancelling30
onceOne-shot per session. Skill/agent frontmatter only — not settings.jsontrue for init scripts

Never use exit 1 to block

0 = success (JSON is parsed from stdout). 2 = blocking error, with stderr fed back as feedback. Any other code is a non-blocking error, shown only in verbose mode — so a hook that exits 1 to reject something fails open and looks like it did nothing.

Hook Profiles — DX_HOOK_PROFILE

ProfileLevelBehavior
minimal1Only blocking safety hooks (branch-guard). Informational hooks skipped
standard2Default. All hooks enabled
strict3All hooks plus extra guardrails (future use)

Export DX_HOOK_PROFILE=minimal to suppress informational hooks during focused work, or strict for CI and pipeline environments. Hook scripts gate themselves with source hook-profile.sh && require_profile “standard”.

Debug

Debugging Playbook

Common issues and how to fix them.

Skill Not Found

  1. Check file is at correct skills path
  2. Verify name: in frontmatter matches what you are typing
  3. Check description: contains trigger phrases for auto-invocation
  4. Verify no trailing spaces on --- delimiters

MCP Tools Not Available

  1. Check server is running
  2. Verify config in .mcp.json or .claude/settings.json
  3. If agent, check that tools: is NOT set (blocks MCP inheritance)
  4. Run ToolSearch(“+servername”) to load deferred tools

Copilot Agent Not Appearing

  1. File must have .agent.md extension
  2. Must be in .github/agents/ directory
  3. Check user-invokable: is not false
  4. Restart VS Code after adding new agents
  5. Use /troubleshoot to inspect loaded customizations

Deferred vs Pre-loaded MCP

  1. If tools: is omitted, MCP tools are deferred — must ToolSearch before calling
  2. If tools: lists MCP tools explicitly, they are pre-loaded — ToolSearch returns nothing
  3. Always try calling the tool directly first, fall back to ToolSearch

The #2 Gotcha: ToolSearch False Negatives

If an agent has MCP tools explicitly listed in tools:, those tools are pre-loaded and ToolSearch will return nothing for them. This leads agents to wrongly conclude MCP is unavailable. Always try calling the tool directly first.

Settings

Settings Reference

Configuration file hierarchy and key fields.

File Hierarchy (highest priority first)

PriorityLocation
1 (highest)Enterprise managed settings
2~/.claude/settings.json (user)
3.claude/settings.json (project)
4 (lowest).claude/settings.local.json (local, gitignored)

Permission Modes

ModeBehavior
defaultPrompts on first use of each tool
acceptEditsAuto-accepts file edits, prompts for other tools
planRead-only, no modifications allowed
dontAskAuto-denies unless pre-approved via permissions
bypassPermissionsSkips all prompts (isolated environments only)
Docs

External References

Official documentation for both platforms.

Claude Code

KAI by Dragan Filipovic