Coding Agent Viewer
A VS Code extension that visualizes agent definition files for coding agent services such as GitHub Copilot.
It combines a live Markdown preview, a dedicated outline view, an
Agent Collaboration Visualizer for *.agent.md files, a Session List & Details view for local
Copilot chat sessions, and Copilot Hooks timing capture for sessions and subagents — all in a single extension.
Browse the heading structure of agent definitions, scroll the editor and preview in sync, and edit how custom agents hand off work to each other directly on a directed graph. You can also browse, inspect, and replay local Copilot sessions as Mermaid sequence diagrams, and aggregate how often each custom agent is used.
Features
Markdown Preview & Outline
- Live Markdown preview that re-renders as you type
- Two display modes: side-by-side / replace the current editor column
- Outline view (H1–H6) in a dedicated Activity Bar container with click-to-jump
- The outline keeps the most recent Markdown even when focus moves to the preview or Output panel
- Synchronized scrolling between editor and preview
- Syntax-highlighted code blocks
- WebView rendering designed with strong security in mind
Agent Collaboration Visualizer
- Auto-detects
*.agent.mdin the workspace (configurable glob pattern) - Renders inter-agent handoffs as a directed graph using
cytoscape+cytoscape-dagre(top-to-bottom hierarchical layout) - Agent Detail tree view displays
name,namespace,description,tools, andhandoffsof the current agent file - Toolbar: search, namespace filter (persisted per user), add edge, subtree focus, SVG / PNG export
- Edit directly from the graph: double-click an edge to rename, right-click to delete, "Add edge" to create new ones. All changes are written back to YAML front matter
- Clicking a node opens the corresponding
.agent.mdin the smallest non-graph editor column (no extra splits) - Theme-aware, strict CSP, per-render nonces, optimistic edits (rolled back if the extension host rejects)
Copilot Session List & Details
- The Session List tree view in the Activity Bar (
markdownViewerSessionList) lists local Copilot chat sessions. Each row shows a session-name label and anagent · updated datedescription - Filter toggle: All Sessions / Current Workspace Only (command
markdownViewer.setSessionListFilter; the selection is persisted in workspace state) - Near real-time updates: the ingest pipeline imports new sessions and refreshes the view when a Copilot hook event arrives or when Refresh Session List (
markdownViewer.refreshSessionList) is run - Clicking a session opens the Session Details panel (
markdownViewerSessionAgentOrder) showing- Full metadata (id / session name / title / agent / summary / cwd / host type / created & updated timestamps / turn count / ingest bookkeeping)
- Session timing (start / end / duration) and per-subagent timing (agent id / type / start / end / duration) — captured from Copilot Hooks
- The first-seen order of agents used in the session
- The complete per-turn conversation (each turn's timestamp, model, and User / Assistant message bodies)
Copilot Hooks timing capture (opt-in)
- Uses GitHub Copilot Hooks to measure session/subagent start and stop timing. The bundled receiver script
copilot-hook.jsis invoked onSessionStart/Stop/SubagentStart/SubagentStopevents and appends a JSON Lines record per event - Opt-in: consent is requested on first activation. You can enable/disable it at any time via Enable Copilot Hook Timing (
markdownViewer.installCopilotHook) / Disable Copilot Hook Timing (markdownViewer.uninstallCopilotHook), and the choice is remembered inglobalState - When enabled, it writes the workspace-specific hook config
.github/hooks/vscode-doc-viewer.json. When disabled, it removes only the entry this extension manages and leaves other hooks untouched - The captured timing is written to
hook-timing.jsonlin the extension's global storage and ingested into the session index DB (session-index.db) by the ingest pipeline
Copilot Session Visualizer
- The command
markdownViewer.openSessionVisualizer(Open Copilot Session Visualizer) visualizes local GitHub Copilot chat sessions as MermaidsequenceDiagram - Instead of reading the Copilot Chat store directly, it reads the extension-owned session index DB (
session-index.db) viasql.js. That DB is produced by the ingest pipeline from the local Copilot chat session store - Because the store is resolved relative to the extension's own global storage, it is found across all VS Code variants (Stable / Insiders / VSCodium / portable / remote & WSL hosts)
- Includes a per-turn detail pane for each session
- Scope toggle: current workspace / all known sessions on the machine
- List size is configurable via
markdownViewer.sessionVisualizer.maxSessions(1–500, default 50) - Persists UI zoom and sequence-diagram zoom in
globalState; strict CSP with per-render nonces, theme-aware - Fully offline: ships
sql.jsWebAssembly (sql-wasm.wasm)
Agent Usage
- The Agent Usage tree view in the Activity Bar (
markdownViewerAgentUsage) aggregates session counts per custom agent from the session index DB (session-index.db) - Shows the agent name, total session count, and last session date
- Click an entry to open the matching
.agent.mdin the workspace - The command
markdownViewer.refreshAgentUsage(Refresh Agent Usage) re-aggregates the data, andmarkdownViewer.setAgentUsageScope(Set Agent Usage Scope) switches between the current workspace and all workspaces - Sessions whose
agent_nameis blank orNULLare grouped under the(unknown)bucket.
Commands
| Command ID | Title |
|---|---|
markdownViewer.open |
Open Preview |
markdownViewer.openCurrentColumn |
Open Preview (Current Column) |
markdownViewer.openAgentGraph |
Open Agent Collaboration Graph |
markdownViewer.refreshAgents |
Refresh Agent Collaboration Graph |
markdownViewer.openSessionVisualizer |
Open Copilot Session Visualizer |
markdownViewer.installCopilotHook |
Enable Copilot Hook Timing |
markdownViewer.uninstallCopilotHook |
Disable Copilot Hook Timing |
markdownViewer.refreshSessionList |
Refresh Session List |
markdownViewer.setSessionListFilter |
Set Session List Filter |
markdownViewer.refreshAgentUsage |
Refresh Agent Usage |
markdownViewer.setAgentUsageScope |
Set Agent Usage Scope |
(markdownViewer.revealHeading and markdownViewer.openSessionAgentOrder are internal commands and are not shown in the Command Palette.)
Settings
| Setting key | Type | Default | Description |
|---|---|---|---|
markdownViewer.agentGlob |
string | **/*.agent.md |
Glob pattern used to discover agent definition files |
markdownViewer.agents.maxFiles |
number | 2000 |
Maximum number of files loaded per scan |
markdownViewer.debug |
boolean | false |
Emit debug logs to the Output panel |
markdownViewer.namespaceFilter |
string[] | [] |
Allowlist of namespaces to display |
markdownViewer.sessionVisualizer.maxSessions |
number (1–500) | 50 |
Number of sessions listed in the Session Visualizer |
Views
| View ID | Name | When shown |
|---|---|---|
markdownViewerToc |
Outline | Always |
markdownViewerAgentDetail |
Agent Detail | When a .agent.md file is open |
markdownViewerAgentUsage |
Agent Usage | Always |
markdownViewerSessionList |
Session List | Always |
markdownViewerAgentGraph |
Agent Collaboration Graph | WebView opened by command |
markdownViewerSessionVisualizer |
Copilot Session Visualizer | WebView opened by command |
markdownViewerSessionAgentOrder |
Session Details | WebView opened by clicking a session in the Session List |
Requirements
- Visual Studio Code 1.120 or later. The Copilot session features read the WAL-mode Copilot session store via Node's built-in
node:sqlitemodule, which requires the Node.js 24 runtime provided by the 1.120 extension host (engines.node >= 24inpackage.json) - (Building from source also requires Node.js 24 or later.)
Installation
Search for "Coding Agent Viewer" in the VS Code Marketplace, or open the store directly from the "View on Marketplace" button at the top of the page.
