feat: detect agents across all workspace folders in multi-root workspaces#102
Open
Commandershadow9 wants to merge 2 commits intopablodelucca:mainfrom
Open
feat: detect agents across all workspace folders in multi-root workspaces#102Commandershadow9 wants to merge 2 commits intopablodelucca:mainfrom
Commandershadow9 wants to merge 2 commits intopablodelucca:mainfrom
Conversation
In multi-root workspaces, Claude Code sessions started in different workspace folders write their JSONL transcripts to different project directories (e.g. `-home-user-projectA/` vs `-home-user-projectB/`). Currently only the first workspace folder's project dir is scanned, making agents in other folders invisible. Changes: - ensureProjectScan now tracks all registered project dirs in a module-level Set and scans all of them in the shared interval timer. Calling it multiple times with different dirs is safe — the seed logic always runs, but the timer is only started once. - PixelAgentsViewProvider registers project dirs for all workspace folders (not just the first) when webviewReady fires. This means in a multi-root workspace with folders [~/projectA, ~/projectB], Claude agents started in either folder will be discovered and tracked. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two fixes for multi-workspace scanning: 1. ensureProjectScan: Add smart pre-registration logic that skips files >3KB and modified within the last 10 minutes, so active JSONL files can still be picked up by terminal scanning. 2. scanForNewJsonlFiles: Iterate over all vscode.window.terminals instead of only vscode.window.activeTerminal, so agents in non-focused terminals are also discovered. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
VS Code's multi-root workspaces let users open multiple project folders in a single window. Claude Code writes JSONL transcripts to a directory based on the workspace path — so each folder gets its own project directory under
~/.claude/projects/.Currently,
ensureProjectScanonly registers the first workspace folder's project directory. If a user starts Claude Code in their second or third folder, those sessions are never detected because their JSONL directory isn't being watched.Example: User has
~/frontendand~/backendopen as a multi-root workspace. They start Claude in~/backend— the agent works fine but never appears in the Pixel Agents panel because only~/frontend's project dir is scanned.Changes
src/fileWatcher.tsensureProjectScannow maintains a module-levelSet<string>of tracked project directoriesensureProjectScanmultiple times with different dirs is safe and idempotent — the seed logic always runs but the timer only starts oncesrc/PixelAgentsViewProvider.tswebviewReady, registers project dirs for all workspace folders (not just the first)Backward compatibility
nullproject dir gracefullyensureProjectScanfunction signature is unchanged — existing callers inagentManager.tswork without modificationTest plan
File → Add Folder to Workspace)[Pixel Agents] Registering additional project dir:log messages🤖 Generated with Claude Code