Claude Code Headless Access to Nexus
Key Insight
When LARS calls Claude Code via SSH headlessly, Claude Code still has full MCP gateway access.
How It Works
-
LARS receives complex request
User: "Hey LARS, help me refactor the authentication module" -
LARS delegates via SSH
python subprocess.run([ "claude", "-p", "Refactor the auth module in /project/path", "--session-id", session_id ]) -
Claude Code runs workflow.init
- Gets full Nexus context
- Knows who Chris is
- Knows all protocols and tools
-
Has access to MCP gateway
-
Claude Code does the work
- Can read/write files
- Can use all Nexus tools
- Can save to context, track, kb
-
Full capabilities
-
LARS reports back
- Claude Code output returned to LARS
- LARS summarizes via voice
- User hears the result
No Markdown File Needed
The workflow.init IS the context. It contains:
- Who Chris is
- What Nexus is
- All protocols and patterns
- Environment status
- Tool schemas
- Voice preferences
LARS doesn't need to pass a markdown briefing file. Claude Code already knows everything through workflow.init.
Session Persistence
# First call - starts session
claude -p "Start refactoring" --session-id abc123
# Follow-up - resumes with context
claude -r --session-id abc123 -p "Now add tests"
The -r flag resumes the previous session with full conversation history.
The Vision
You (voice) -> "Hey LARS, we need Claude to build X"
|
v
LARS (local) -> Understands request
|
v
SSH to Claude Code -> claude -p "build X" --session-id ...
|
v
Claude Code -> workflow.init -> Full Nexus context
|
v
Claude Code -> Does complex work with all tools
|
v
Output -> Returns to LARS
|
v
LARS -> Summarizes via InWorld TTS
|
v
You hear the result
All seamless. All voice-driven. LARS as the interface, Claude Code as the heavy lifter.