Skip to content

Support Claude Code VS Code extension (native panel) sessions #74

@drewf

Description

@drewf

Love this extension! I'm using Claude Code through the VS Code native panel and noticed it doesn't pick up those sessions. Here's what I found investigating why:

Summary

Pixel Agents currently only maps characters to Claude Code terminal sessions (vscode.Terminal). However, Claude Code also runs as a native VS Code extension panel, and those sessions produce identical JSONL transcript files in the same location. They just aren't discovered because there's no terminal to map to.

How extension sessions work

  • The VS Code extension communicates via WebSocket (not a terminal)
  • Transcripts are written to the same ~/.claude/projects/{sanitized-path}/{uuid}.jsonl path
  • The JSONL record format is identical — same type, sessionId, message, tool usage, etc.
  • Sub-agent transcripts also appear in the same {sessionId}/subagents/ subdirectories

Available discovery signals

Since there's no vscode.Terminal object, extension sessions could be identified through:

Signal Location Details
IDE lock files ~/.claude/ide/{pid}.lock Contains workspace paths, IDE name, transport type ("ws") — but no session ID
JSONL modification time ~/.claude/projects/{path}/*.jsonl Most recently modified file not mapped to a terminal is likely the active extension session
<ide_opened_file> tags Inside JSONL user message content Only present in extension sessions, never in terminal sessions — useful as a heuristic

Suggested approach

The transcript parsing and activity detection logic would work unmodified. The change would be to decouple session discovery from vscode.Terminal lifecycle:

  1. During the project directory scan, identify active JSONL files not mapped to any terminal
  2. Use modification timestamps and/or <ide_opened_file> heuristics to confirm it's an extension session
  3. Spawn a character for it the same way terminal sessions get one — just without terminal lifecycle binding

Why this matters

Many users run Claude Code through the VS Code extension panel rather than the terminal. It would be great to see pixel agents working alongside the native extension experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: agent-connectionAgent discovery, session linking, transcript communicationtype: featureNew feature or capability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions