Skip to content

feat: standalone server for running Pixel Agents outside VS Code#166

Open
MikaelDDavidd wants to merge 1 commit intopablodelucca:mainfrom
MikaelDDavidd:feat/standalone-server
Open

feat: standalone server for running Pixel Agents outside VS Code#166
MikaelDDavidd wants to merge 1 commit intopablodelucca:mainfrom
MikaelDDavidd:feat/standalone-server

Conversation

@MikaelDDavidd
Copy link

Summary

Adds a standalone/ directory with a lightweight Node.js server that serves the Pixel Agents webview in any browser, making it work with Claude Code sessions running in any terminal (Warp, iTerm, Hyper, native Terminal, etc.) — not just VS Code's integrated terminal.

Motivation

Many Claude Code users don't use VS Code as their primary editor. They use Warp, iTerm, or other terminals. Currently, Pixel Agents only works inside VS Code because it relies on vscode.window.createTerminal() to detect agents.

This standalone server solves that by scanning ~/.claude/projects/ directly for active JSONL transcript files, regardless of which terminal created them.

How it works

  1. Server (src/server.js): Express + WebSocket server on port 3333. Loads all assets (characters, furniture, floors, walls) from the installed VS Code extension's built files. Serves the existing React webview with an injected WebSocket adapter.

  2. Scanner (src/scanner.js): Scans ~/.claude/projects/ every 5 seconds for JSONL files modified in the last 15 minutes. Parses Claude Code transcript events (tool_use, tool_result, turn_duration) and broadcasts agent activity to all connected browser clients via WebSocket.

  3. WS Adapter (public/ws-adapter.js): Replaces acquireVsCodeApi() with a WebSocket-based fake that routes postMessage calls over WebSocket. The React app runs unmodified — it thinks it's inside VS Code.

Usage

```bash
cd standalone
npm install
node build.js
node dist/server.js

Open http://localhost:3333

```

Features

  • Detects Claude Code sessions from any terminal
  • Auto-discovers new sessions within 5 seconds
  • Same pixel office, furniture editor, and character animations
  • Layout shared with VS Code extension (~/.pixel-agents/layout.json)
  • Multiple browser tabs supported
  • Zero changes to the existing codebase — purely additive

Test plan

  • Server starts and loads all 38 furniture assets, 6 characters, 9 floors, 1 wall set
  • Browser connects via WebSocket and renders the office
  • Active Claude Code sessions (from Warp) detected and displayed as characters
  • Characters animate based on tool usage (typing for Write/Edit, reading for Read/Grep)
  • Layout editor works and persists to ~/.pixel-agents/layout.json

Adds a `standalone/` directory with a Node.js server that serves the
Pixel Agents webview in any browser, detecting Claude Code sessions
from any terminal (Warp, iTerm, Hyper, etc.) by scanning JSONL
transcript files directly.

- Express + WebSocket server on port 3333
- JSONL scanner with hybrid fs.watch + polling
- WS adapter replacing VS Code postMessage API
- Full asset loading (characters, furniture, floors, walls)
- Auto-discovery of new Claude Code sessions every 5s
- Layout shared with VS Code extension (~/.pixel-agents/layout.json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant