Read this at session start. This file is the persistent brain across Claude Code sessions. It survives context loss, session boundaries, and compaction.
Inspired by halthelobster/proactive-agent WAL Protocol + Working Buffer patterns.
| Tier | File | Purpose | Update Frequency |
|---|---|---|---|
| Active State | memory/working-buffer.md |
What's happening RIGHT NOW — current task, blockers, decisions | Every session, every significant decision |
| Progress Log | memory/YYYY-MM-DD.md |
Daily raw capture — what was done, what was tried, what failed | During session |
| Long-Term | This file (MEMORY.md) |
Curated project state, architecture decisions, where things stand | Periodically distilled from daily logs |
The rule: If a decision, correction, or important detail surfaces during a session, write it to memory/working-buffer.md BEFORE continuing work. Context will vanish. The working buffer won't.
Triggers — scan every user message for:
- Corrections: "actually...", "no, I meant...", "use X not Y"
- Decisions: "let's go with...", "skip that", "do X first"
- Architecture choices: "we should use...", "don't add..."
- Priorities: "this is blocking...", "do this before..."
- Names/values: specific IDs, URLs, branch names, config values
When a session starts with truncated context or <summary> tags:
- Read
memory/working-buffer.md— raw recent state - Read this file (
MEMORY.md) — curated long-term state - Read today's daily log if it exists
- Read
tasks/todo.md— active work items - Read
tasks/lessons.md— patterns to avoid
Never ask "what were we doing?" — the memory files have it.
Autonomous engineering platform. Users describe features → system plans them (spec-driven pipeline) → agents execute in Daytona sandboxes → PRs are produced. Multi-agent orchestration with monitoring, trajectory analysis, and self-correction.
Frontend (Next.js 15) → Backend (FastAPI) → Daytona Sandboxes (Claude Agent SDK)
↕
PostgreSQL + Redis + EventBus (WebSocket)
Key reference: ARCHITECTURE.md — the canonical architecture doc with deep-dive links.
- Planning System: Spec-Sandbox state machine (EXPLORE → PRD → REQUIREMENTS → DESIGN → TASKS → SYNC)
- Execution System: OrchestratorWorker → DaytonaSpawner → ClaudeSandboxWorker
- Monitoring: IntelligentGuardian (trajectory), ConductorService (coherence), heartbeats
- Task Queue: PostgreSQL-based with dynamic priority scoring
- Event System: Redis pub/sub → WebSocket to frontend
- Frontend: ~94 pages, ShadCN UI, Kanban board, spec workspace, sandbox event viewer
- Auth: JWT + OAuth (GitHub/Google)
- Billing: Stripe integration with tier-based subscriptions
- Memory: Pattern RAG with pgvector embeddings
Critical gaps (from docs/architecture/14-integration-gaps.md):
FIXED 2026-02-07CoordinationService— not initialized anywhereFIXED 2026-02-07ConvergenceMergeService— not initialized anywhereFIXED 2026-02-07OwnershipValidationService— not initialized anywhereDAG merge system — designed but not wired end-to-endFIXED 2026-02-07 (87 tests)- Git workflow — branch creation → commit → push → PR needs E2E testing with real Daytona sandboxes
New features (designed, not built):
- Live preview rendering (Daytona preview URLs in iframe)
- Prototyping sandbox mode (fast prompt → code → HMR loop)
- Warm sandbox pool (snapshot-based <3s startup)
- Interactive agent sessions (ask_user, interrupt/resume)
- Agent adapter abstraction (multi-agent support)
Status: Done (2026-02-07) What was done:
- Wired CoordinationService, ConvergenceMergeService, OwnershipValidationService into orchestrator_worker.py
- Updated ARCHITECTURE.md Service Availability Matrix
- Created test_dag_event_chain.py (7 tests: full 3-service event chain verification)
- Created test_dag_merge_e2e.py (12 tests: real git repos, real DB records, LocalGitSandbox adapter)
- All 87 DAG-related tests passing
- Commits:
402d3133,99e60e50
Status: Design doc complete, prototype plan written, starting Phase 0 Design docs:
docs/design/live-preview/prototype-plan.md— phased implementation plan- Root-level design docs (live-preview-design-doc.md, background-agent-design-doc.md)
Implementation order:
- Phase 0: POC script proving Daytona preview URLs work with HMR
- Phase 1: Backend preview routes + DaytonaSpawner integration
- Phase 2: Frontend PreviewPanel component
- Phase 3: Prototyping mode (separate fast-iteration UI)
- Phase 4: Warm pool for <3s startup
- Phase 5: Interactive agent sessions
Key insight from analysis: ~60% of the Background Agent design doc describes existing infrastructure. Skip Cloudflare Durable Objects (use existing Redis + WebSocket). Skip Redis sorted set queue (our PostgreSQL queue is better). Skip Agent Adapter abstraction until we have a second agent.
Status: Dark mode fixed, fake social proof removed, conversion optimization backlog exists
Reference: tasks/todo.md has detailed checklist
Key metric: 8s avg session, 23% scroll depth, 84% bounce rate (from PostHog)
Next when resumed: Headline clarity test, above-fold email capture, real social proof
| Date | Decision | Rationale |
|---|---|---|
| 2026-02-07 | Skip Cloudflare Durable Objects for live preview v1 | Existing Redis pub/sub + WebSocket handles our scale. Adding CF edge layer is premature complexity. |
| 2026-02-07 | Keep PostgreSQL TaskQueueService, don't switch to Redis sorted sets | Our queue has dynamic scoring (age, deadline, blockers, retry penalty). Redis sorted sets would be a downgrade. |
| 2026-02-07 | Defer Agent Adapter abstraction until second agent is ready | YAGNI. Only Claude Agent SDK is used. Build the interface when OpenCode/Aider integration is imminent. |
| 2026-02-07 | DAG + git gaps must close before live preview work begins | Preview rendering requires reliable sandbox execution with working git operations. Without that foundation, debugging preview issues becomes impossible. |
| 2026-02-07 | Use public=True Daytona sandboxes for dev/staging previews |
Simpler than managing auth tokens for iframe embedding. Production can use private sandboxes with x-daytona-preview-token. |
| What | Where |
|---|---|
| Architecture overview | ARCHITECTURE.md |
| Backend-specific guide | backend/CLAUDE.md |
| Integration gaps | docs/architecture/14-integration-gaps.md |
| Current vs target arch | docs/architecture/services/architecture_comparison_current_vs_target.md |
| Live preview design | docs/design/live-preview/prototype-plan.md |
| Active tasks | tasks/todo.md |
| Lessons learned | tasks/lessons.md |
| Daily session logs | memory/YYYY-MM-DD.md |
| Working buffer | memory/working-buffer.md |
| Product vision | docs/product_vision.md |
| Frontend architecture | docs/design/frontend/frontend_architecture_shadcn_nextjs.md |
| DaytonaSpawner | backend/omoi_os/services/daytona_spawner.py |
| TaskQueueService | backend/omoi_os/services/task_queue.py |
| EventBusService | backend/omoi_os/services/event_bus.py |
| Orchestrator worker | backend/omoi_os/workers/orchestrator_worker.py |
- Read
MEMORY.md(this file) — project state, active workstreams, decisions - Read
memory/working-buffer.md— what was happening most recently - Read
tasks/todo.md— active checklist - Read
tasks/lessons.md— mistakes to avoid - If resuming specific work: read the relevant daily log
- WAL Protocol: Write decisions/corrections to
memory/working-buffer.mdbefore acting on them - Track progress: Update
tasks/todo.mdas items complete - Capture lessons: When something fails unexpectedly, add pattern to
tasks/lessons.md - Daily log: Write significant actions to
memory/YYYY-MM-DD.md
- Update
memory/working-buffer.mdwith current state and next steps - Mark completed items in
tasks/todo.md - If new lessons learned: update
tasks/lessons.md - If architecture decisions made: add to the ADL table in this file
- Write daily log entry to
memory/YYYY-MM-DD.md