-
Notifications
You must be signed in to change notification settings - Fork 589
Open
Description
Background
When running multiple AI coding agents (Claude Code, Codex, OpenClaw) simultaneously, each instance needs to manually join the office via API. This is tedious and error-prone — agents get duplicated, forget to leave, or never join at all.
Proposal
A lightweight daemon script that:
- Auto-detects running Claude Code / Codex processes every ~10 seconds (via
pgrep) - Auto-joins new instances with a descriptive name based on their working directory (e.g.
Claude Code (trading),Codex (podcast_juicer)) - Auto-removes agents when their process exits
- Monitors OpenClaw gateway logs to toggle lobster status between idle/writing
How it works
┌─────────────┐ pgrep -x claude ┌──────────────────┐
│ Claude Code │ ◄──────────────────────► │ │
│ (trading) │ │ star-office │
├─────────────┤ pgrep -x codex │ daemon │
│ Codex │ ◄──────────────────────► │ │
│ (juicer) │ │ (every 10s) │
├─────────────┤ gateway.log tail │ │
│ OpenClaw │ ◄──────────────────────► │ │
│ (lobster) │ └───────┬──────────┘
└─────────────┘ │
▼
/join-agent
/agent-push
/leave-agent
Why not hooks?
Claude Code supports PostToolUse / Stop hooks, but:
- Each hook invocation is a separate shell process with no stable session identifier
- This causes duplicate agent registrations (we saw it balloon to #97)
- Codex has no system-level hooks at all
A polling daemon avoids these issues entirely.
Status
I have a working prototype (star-office-daemon.sh) running locally. Happy to submit a PR if there's interest, or adapt to a preferred approach (e.g. integrate into the backend as a background thread).
Related PR: #64 (fixes agent overlap when many agents are in the same area)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels