microsoft/vscode-copilot-chat/troubleshoot
Claude Code and agent skill by microsoft/vscode-copilot-chat
- vendor
Checking that the SKILL.md file is still in the repository.
Investigate unexpected chat agent behavior by analyzing direct debug logs in JSONL files. Use when users ask why something happened, why a request was slow, why tools or subagents were used or skipped, or why instructions/skills/agents did not load.
Install
npx vskill@latest install microsoft/vscode-copilot-chat/troubleshootSKILL.md
Troubleshoot
Purpose
This skill investigates and explains unexpected chat agent behavior using direct log files.
Use this skill for questions like:
- Why did this request take so long?
- Why was a tool or subagent called?
- Why did instruction/skill/agent files not load?
- Why was a tool call blocked or failed?
- Why did the model not follow expectations?
Base conclusions on evidence from logs. Do not guess.
Data Source
- Target session log directory/directories for analysis:
{{VSCODE_TARGET_SESSION_LOG}}
Use direct debug log files written by Copilot Chat:
Always read main.jsonl first — it has the full conversation flow. Child files only appear when those operations occurred. main.jsonl contains child_session_ref entries that link to each child file by name. Title, categorization, and summarize files are UI housekeeping and rarely relevant to troubleshooting. When investigating model availability or selection issues, read models.json — it contains the full list of models (with capabilities, billing, and limits) that were available when the session started.
When investigating what the model was told (system prompt, instructions), read the system_prompt_*.json file referenced by a system_prompt_ref entry in main.jsonl. The file contains the full untruncated system prompt as { "content": "..." }. When investigating which tools were available, read the tools_*.json file similarly. If the model changed mid-session, multiple numbered files exist — each llm_request entry has a systemPromptFile attr indicating which file was active for that request.
Each line is a JSON object. Common fields: ts (epoch ms), dur (duration ms), sid (session ID), type, name, spanId, parentSpanId, status (ok|error), attrs (type-specific details).
Event Type Reference with Examples
discovery — customization file loading (instructions, skills, agents, hooks)
Key attrs: details (human-readable summary with folder paths, loaded items, skip reasons), category (always "discovery"), source ("core").
tool_call — tool invocation (success or failure)
Key attrs: args (JSON string of tool input), result (tool output or error text), error (present when status:"error").
llm_request — model round-trip
Key attrs: model, inputTokens, outputTokens, ttft (time to first token in ms), maxTokens, temperature, topP, systemPromptFile (references a system prompt file in the session directory), toolsFile (references a tools file in the session directory), userRequest (the full user message content, untruncated), inputMessages (full messages array as JSON, pre-truncated at 64KB), error (when failed).
agent_response — model output (text + tool calls)
Key attrs: response (JSON-encoded array of message parts; may be truncated), reasoning (optional — the model's chain-of-thought/thinking text when thinking mode is active; may be truncated).
user_message — user input
Key attrs: content (the user's message text).
subagent — subagent invocation
Key attrs: agentName, description (optional), error (when failed).
generic — miscellaneous events
Special generic entries:
system_prompt_ref— references asystem_prompt_*.jsonfile in the session directory.attrs.fileis the filename,attrs.modelis the model it was written for. Read this file to see the full system prompt.tools_ref— references atools_*.jsonfile.attrs.fileis the filename,attrs.modelis the model.
session_start — session metadata (appears once at session start)
Key attrs: copilotVersion, vscodeVersion. Useful for identifying which build produced the logs.
turn_start / turn_end — tool-calling loop iteration boundaries
Key attrs: turnId (iteration number within a single user request's tool-calling loop). Use these to identify which iteration events belong to and to count total loop iterations.
Reading the event hierarchy
Events form a tree via spanId/parentSpanId. A typical chain:
user_message(spanId:X) — the user's turnllm_request(parentSpanId:X) — model call for that turnagent_response(parentSpanId:X) — what the model returnedtool_call(parentSpanId:X) — tool executed from the response- Another
llm_request(parentSpanId:X) — next model call after tool result
Subagent calls create nested hierarchies: the tool_call for runSubagent (spanId: Y) becomes the parent for a child subagent span, which in turn parents its own llm_request/tool_call events.
Tooling Strategy (important)
Debug log files live outside the workspace (in user storage), so workspace-scoped search tools like grep_search cannot access them. Use the terminal instead.
Do not use `grep_search` for log files — it only works on workspace files.
macOS / Linux / WSL / Git Bash
Use run_in_terminal with grep or jq:
- Find errors:
grep '"status":"error"' <logPath> - Find discovery events:
grep '"type":"discovery"' <logPath> - Find slow events (duration > 5s):
jq -c 'select(.dur > 5000)' <logPath> - Find tool calls:
grep '"type":"tool_call"' <logPath> - Search for specific text:
grep 'search_term' <logPath> - Get last N lines:
tail -n 50 <logPath> - Count events by type:
jq -r '.type' <logPath> | sort | uniq -c | sort -rn - Extract specific fields:
jq -c '{type, name, status, dur}' <logPath> - Filter by type and show details:
jq -c 'select(.type == "discovery")' <logPath> - Find user messages:
jq -c 'select(.type == "user_message") | .attrs.content' <logPath>
Windows (PowerShell)
Use run_in_terminal with PowerShell commands:
- Find errors:
Select-String '"status":"error"' <logPath> - Find discovery events:
Select-String '"type":"discovery"' <logPath> - Find tool calls:
Select-String '"type":"tool_call"' <logPath> - Search for specific text:
Select-String 'search_term' <logPath> - Get last N lines:
Get-Content <logPath> -Tail 50 - Parse and filter with Node.js (always available):
node -e "require('fs').readFileSync('<logPath>','utf8').split('\n').filter(Boolean).map(JSON.parse).filter(e => e.dur > 5000).forEach(e => console.log(JSON.stringify(e)))" - Count events by type:
node -e "const lines=require('fs').readFileSync('<logPath>','utf8').split('\n').filter(Boolean).map(JSON.parse);const c={};lines.forEach(e=>c[e.type]=(c[e.type]||0)+1);Object.entries(c).sort((a,b)=>b[1]-a[1]).forEach(([t,n])=>console.log(n,t))"
General rules
- Log files can be very large (tens of MB or more for long sessions). Always check file size first if unsure:
ls -lh <logPath>(or(Get-Item <logPath>).Lengthon Windows). If the file is large, avoid commands that load the entire file into memory (e.g.node -ewithreadFileSync). Prefer streaming tools likegrep,jq,Select-String,tail, orhead. - Use
read_fileonly for small targeted ranges (a few lines) once you know the line numbers. Never read entire log files. - Use
run_in_terminalwithls -lh(ordiron Windows) to locate candidate.jsonlfiles and check their sizes. - On Windows, if
grep/jqare not available, fall back toSelect-Stringornode -eone-liners (only for smaller files).
Investigation Workflow
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 12 Mar 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingassets/prompts/skills/troubleshoot/SKILL.md
Popularity
- Repository stars
- 9,658
- Repository forks
- 1,753
- Repository npm downloads, 7 days
- 30
- 7-day trend score
- 57
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 21 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/vscode-copilot-chat/troubleshoot)