How dealignai/mythos-router works
mythos-router is a local CLI for AI-assisted coding with Claude, filesystem write verification, and persistent project memory. The main workflow starts at chat: it sends conversation turns to Claude, checks claimed file actions against filesystem snapshots, and records results in memory; session budgets constrain the interaction. Separate verify and dream commands scan for memory drift and compress older logs. The SDK also exposes the verification engine and memory/client APIs. Some command internals were only partially sampled, so unsupported call links are omitted.
Main entry points: chat.ts Chat Command · client.ts Model Client · memory.ts Memory Manager · cli.ts CLI Router
Components 15
CLI and SDK
- CLI Router
src/cli.ts - SDK Exports
src/index.ts - Terminal Utilities
src/utils.ts
Chat Session
- Chat Command
src/commands/chat.ts - Model Client
src/client.ts - Model Config
src/config.ts - Session Budget
src/budget.ts
Verification
- Write Discipline
src/swd.ts - Drift Scanner
src/commands/verify.ts
Project Memory
- Memory Dream
src/commands/dream.ts - Memory Manager
src/memory.ts - MEMORY.md
Other components
- Developer
- Anthropic API
- Project Files
Connections 20
- Developer → CLI Router: runs command
README.md - CLI Router → Chat Command: dispatches chat
src/cli.ts - CLI Router → Drift Scanner: dispatches verify
src/cli.ts - CLI Router → Memory Dream: dispatches dream
src/cli.ts - Chat Command → Model Client: streams turns
src/commands/chat.ts - Model Client → Anthropic API: requests responses
src/client.ts - Model Client → Model Config: validates key
src/client.ts - Chat Command → Write Discipline: checks file actions
src/commands/chat.ts - Write Discipline → Project Files: snapshots and verifies
src/swd.ts - Chat Command → Memory Manager: logs session results
src/commands/chat.ts - Memory Manager → MEMORY.md: reads and writes
src/memory.ts - Drift Scanner → Memory Manager: reads and logs
src/commands/verify.ts - Drift Scanner → Project Files: scans project
README.md - Memory Dream → Memory Manager: compresses entries
src/commands/dream.ts - Memory Dream → Model Client: requests summary
src/commands/dream.ts - Chat Command → Session Budget: tracks session limits
src/commands/chat.ts - Developer → SDK Exports: uses programmatic API
README.md - SDK Exports → Write Discipline: exports engine
src/index.ts - SDK Exports → Model Client: exports client
src/index.ts - SDK Exports → Memory Manager: exports memory API
src/index.ts