You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NanoClaw's container model is single-shot: agent wakes, processes messages, responds, and idles/dies. This works well for reactive tasks (quick questions, scheduled briefings, calendar management) but falls short for:
Deep coding sessions — multi-step refactors, debugging with 20+ file reads, iterative test-fix cycles
Complex research — rabbit-hole exploration that requires building progressive understanding
Document collaboration — 15 rounds of revision on a pitch deck or strategy doc
The fundamental limitation is that each invocation starts with a cold context. Conversation history replay (#2 from this repo's approach) bridges ~85-90% of the gap for planning/briefing tasks but only ~40-50% for deep coding, because replayed history lacks the reasoning chain, tool call results, and progressive context building of a continuous session.
Proposed Solution
Add a dispatch mechanism where the orchestrator can choose between execution modes based on task type:
Execution Modes
Mode
When
How
Container (current)
Quick reactive tasks, scheduled tasks
Existing container runner
Persistent session
Deep coding, research, multi-step work
Long-lived Claude Code process on host
Architecture
User (Telegram) → NanoClaw Orchestrator → Mode Router
├── Container Runner (existing)
└── Session Runner (new)
├── Spawns claude-code CLI process
├── Pipes messages via stdin
├── Streams responses back
└── Maintains session until explicitly ended
Session Runner Behavior
User triggers deep work mode (explicit command like /deep or agent detects complex task)
Orchestrator spawns a claude CLI process with the topic's working directory and CLAUDE.md
Messages from Telegram are piped into the session as follow-up prompts
Session stays alive until: user says "done", idle timeout (configurable), or explicit /end
On session end, key outcomes are summarized and written to the topic's state files
Key Design Decisions
Security model: Persistent sessions run on the host, not in containers. This means less isolation but access to the full filesystem (which is what deep coding needs). Could optionally run in a persistent container with mounted volumes.
Topic binding: Each topic can have at most one active persistent session. New messages in that topic go to the session, not a new container.
Hybrid: The orchestrator decides which mode to use. Quick messages still go through containers even if a session exists (or queue for the session — TBD).
Resource management: Max concurrent sessions, idle timeout, memory monitoring.
Problem
NanoClaw's container model is single-shot: agent wakes, processes messages, responds, and idles/dies. This works well for reactive tasks (quick questions, scheduled briefings, calendar management) but falls short for:
The fundamental limitation is that each invocation starts with a cold context. Conversation history replay (#2 from this repo's approach) bridges ~85-90% of the gap for planning/briefing tasks but only ~40-50% for deep coding, because replayed history lacks the reasoning chain, tool call results, and progressive context building of a continuous session.
Proposed Solution
Add a dispatch mechanism where the orchestrator can choose between execution modes based on task type:
Execution Modes
Architecture
Session Runner Behavior
/deepor agent detects complex task)claudeCLI process with the topic's working directory and CLAUDE.md/endKey Design Decisions
Related Issues
Alternatives Considered
Implementation Sketch
SessionRunnerclass alongsideContainerRunnerprocessGroupMessages(heuristic or explicit trigger)🤖 Generated with Claude Code