Skip to content

feat: watch all sessions across all project directories#157

Open
ronilaukkarinen wants to merge 1 commit intopablodelucca:mainfrom
ronilaukkarinen:feat/watch-all-sessions
Open

feat: watch all sessions across all project directories#157
ronilaukkarinen wants to merge 1 commit intopablodelucca:mainfrom
ronilaukkarinen:feat/watch-all-sessions

Conversation

@ronilaukkarinen
Copy link

@ronilaukkarinen ronilaukkarinen commented Mar 17, 2026

Summary

Scans all directories under ~/.claude/projects/ for active JSONL session files, not just the current VS Code workspace. Creates virtual agents (nullable terminalRef) for sessions running in external terminals.

Related issues: #8, #46

  • Add scanAllProjectDirs() to fileWatcher.ts - discovers sessions across all project directories
  • Only adopt files modified in the last 30 minutes to avoid stale sessions
  • Make terminalRef nullable in AgentState for virtual agents
  • Guard focusAgent/closeAgent for null terminal refs
  • Show project folder name as agent label

Test plan

  • Open VS Code in one project, run Claude Code in a different directory from an external terminal
  • Verify both the VS Code session and external session appear as characters
  • Verify clicking an external session character does not crash
  • Verify close button on external agents does not crash
  • Verify normal VS Code terminal agents still work (focus, close, /clear detection)

Scan all directories under ~/.claude/projects/ for active JSONL session
files, not just the current workspace. Creates virtual agents (without
terminal references) for sessions running in external terminals.

- fileWatcher.ts: add scanAllProjectDirs() that discovers sessions across
  all project directories and adopts active ones (modified < 30 min)
- types.ts: make terminalRef nullable for virtual agents
- agentManager.ts: handle null terminalRef in persistAgents
- PixelAgentsViewProvider.ts: call scanAllProjectDirs on webviewReady,
  guard focusAgent/closeAgent for null terminal refs
@ronilaukkarinen ronilaukkarinen marked this pull request as ready for review March 17, 2026 17:21
@gaby
Copy link

gaby commented Mar 18, 2026

@ronilaukkarinen is this why pixel-agents never works? I have tried using it in all different ways: vscode, terminal, etc and none of them work

@florintimbuc florintimbuc added type: feature New feature or capability area: agent-connection Agent discovery, session linking, transcript communication labels Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agent-connection Agent discovery, session linking, transcript communication type: feature New feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants