Add tmux integration and external agent detection#43
Open
lusqua wants to merge 1 commit intopablodelucca:mainfrom
Open
Add tmux integration and external agent detection#43lusqua wants to merge 1 commit intopablodelucca:mainfrom
lusqua wants to merge 1 commit intopablodelucca:mainfrom
Conversation
Detect Claude Code sessions running outside VS Code (e.g. in tmux) and show them as animated characters in the office. Add "Use tmux" mode where agents are created as tmux windows in a shared session, surviving editor restarts. Include right-click context menu with type-aware actions and re-attach logic when terminal tabs are closed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
[ext]characters in the office+ Agentcreates tmux windows inside a sharedpixel-agentssession instead of VS Code terminals, so agents survive editor restartsWhat changed
New files
src/tmuxResolver.tspgrep+lsof, walk process tree to resolve tmux sessions, create/kill tmux windowssrc/externalAgentScanner.tswebview-ui/src/components/AgentContextMenu.tsxBackend changes
src/types.tsterminalRefnow nullable; addedisExternal,isTmux,tmuxSessionName,tmuxWindowName,lastDataTimestampsrc/constants.tssrc/PixelAgentsViewProvider.tsopenClaudechecks "Use tmux" setting;focusAgentre-attaches tmux/external agents;closeAgentkills tmux windows;onDidCloseTerminaldetaches instead of removing for tmux/external; new methods:launchTmuxAgent(),reattachTmuxAgent(),attachExternalAgent(), external scanning lifecyclesrc/agentManager.tssendExistingAgentsincludesexternalIdssrc/fileWatcher.tslastDataTimestampon new JSONL data; adopted agents initialize new fieldsWebview changes
webview-ui/src/App.tsxfocusAgent; wires tmux/external settings toggleswebview-ui/src/hooks/useExtensionMessages.tsexternalAgentIds,externalAgentsEnabled,useTmuxstatewebview-ui/src/components/SettingsModal.tsxwebview-ui/src/components/BottomToolbar.tsxwebview-ui/src/office/components/ToolOverlay.tsx[ext]label prefix; close button visible for external agentswebview-ui/src/office/components/OfficeCanvas.tsxwebview-ui/src/office/engine/officeState.tsaddAgent()acceptsisExternalparamwebview-ui/src/office/engine/characters.tscreateCharacterinitializesisExternalwebview-ui/src/office/types.tsisExternalfield onCharacterHow tmux resolution works
pgrep -x claudefinds all Claude process PIDslsof -p <pid> -Fngets each process's cwd:/\with-) and compared against project dir hashps -o ppid=) up to 10 levelstmux list-panes -a -F '#{pane_pid} #{session_name}'How "Use tmux" agents work
+ Agentwith setting enabledpixel-agentstmux session exists (creates if needed)agent-N) with workspace cwdclaude --session-id <uuid>into the tmux windowtmux attach -t pixel-agents:agent-N<uuid>.jsonlto appear, then starts file watchingTest plan
claudein a tmux session with the same workspace → character appears as[ext]+ Agent→ tmux window created, VS Code terminal attached[ext]characters removed🤖 Generated with Claude Code