Four Layers
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OpenCLIs LAYERS β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β RUNTIME β
β Shared PTY terminal. Human and AI in the same shell. β
β Any CLI invokes any other CLI via shell command. β
β Each CLI uses its official model on human's subscription. β
β β
β OBSERVATION β
β Every file change recorded in real time. β
β Every save diffed against HEAD and stored. β
β When commit happens, all saves link to it. β
β Git sees the result. OpenCLIs sees the journey. β
β β
β MEMORY β
β Reads sessions from Claude, Codex, OpenCode, Gemini. β
β Indexes into single searchable database. β
β Any model recalls what any other model did. β
β Sessions end. Models change. Memory stays. β
β β
β UNDERSTANDING β
β Shared tools for human and AI alike. β
β Code search, document search, git structure, visual alignment. β
β Same tool, same result, regardless of who calls it. β
β Human sees AI's work. AI uses human's tools. β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Layer 1: Runtime
The foundation. A PTY terminal where human and AI share the same shell.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RUNTIME β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Human types: $ codex "review this function" β
β AI types: $ codex "review this function" β
β β
β Same command. Same PTY. Same result. β
β β
β Claude running in Tab 1 can: β
β $ codex "check this approach" β
β $ gemini "analyze this error" β
β $ opencode "run these tests" β
β β
β No API keys passed. No SDK imported. β
β Just shell commands, like a human would type. β
β Each CLI authenticates with its own subscription. β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The PTY daemon runs as a sidecar binary β if the app crashes, terminal sessions survive. Each session is managed by a SessionActor with no locks, guaranteed ordering, and independent state.
Layer 2: Observation
Every file change is recorded, diffed, and linked to commits.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OBSERVATION β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β File saved β
β β file watcher detects change β
β Diff computed against HEAD β
β β save tracker stores with timestamp β
β β records: who (ai_session_id), what (diff), when (ts) β
β Commit happens β
β β saves are linked to the commit β
β β
β Now you can ask: β
β "How was this commit made?" β
β β 12 saves, 3 were rollbacks, saves 7-10 from Claude β
β β
β git log sees: commit abc123, +200/-50 β
β OpenCLIs sees: the full journey to that commit β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Layer 3: Memory
Sessions are read from local files β not API calls.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MEMORY β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Claude Code β ~/.claude/projects/*/session.jsonl β
β Codex β ~/.codex/history.jsonl β
β OpenCode β ~/.local/share/opencode/opencode.db β
β Gemini CLI β ~/.gemini/tmp/*/chats/*.json β
β β
β NIIA reads all four, indexes into one database. β
β β
β From any CLI: β
β $ niia session search "the auth bug" β
β β Found in Claude session 3 days ago β
β β Found in Codex session yesterday β
β β Found in Gemini session this morning β
β β
β Memory is not locked to any model. β
β Identity persists across sessions and time. β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Layer 4: Understanding
The same tools serve human and AI equally.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UNDERSTANDING β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β monogram Human searches code. AI searches code. β
β Same trigram engine, same results. β
β β
β monomento Human searches docs. AI searches docs. β
β Same reference graph, same navigation. β
β β
β monokist Human checks branches. AI checks branches. β
β Same commit cache, same structure. β
β β
β monogrid Human writes boxes. AI writes boxes. β
β Same width rules, same alignment. β
β β
β git viewer Human reads AI's commits. β
β save history Human sees the saves behind each commit. β
β terminal log Human reviews AI's full terminal activity. β
β β
β AI's work is not a black box. β
β Human reads it through the same tools AI used. β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
How They Connect
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FLOW β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Human opens Monolex. Starts Claude Code. β
β Claude works on a feature. β
β β Runtime: Claude is in a PTY β
β β Observation: every save is diffed and stored β
β β Memory: Claude session is recorded locally β
β β
β Claude needs a second opinion. β
β $ codex "review this approach" β
β β Runtime: Codex runs in the same PTY β
β β Memory: Codex session is also recorded β
β β
β Human comes back next day. New Claude session. β
β $ niia recall β
β β Memory: shows what Claude and Codex did yesterday β
β $ niia session search "the approach" β
β β Memory: finds the exact conversation from both β
β β
β Human reviews the commit. β
β β Understanding: git viewer shows the commit β
β β Observation: save history shows 12 saves that made it β
β β Understanding: which saves were Claude, which Codex β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Both Sides Grow
Not an AI Tool. Not a Human Tool.
OpenCLIs doesn't pick a side. The same framework strengthens both.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI GETS STRONGER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Can call other models β
β Claude asks Codex for a second opinion. Codex asks Gemini β
β for a different perspective. Each uses its full capabilities. β
β β
β Memory persists β
β Session ends, but NIIA remembers. Next session picks up β
β where the last one stopped. Across models, across time. β
β β
β Uses human's tools β
β monogram for code search. Git for version control. β
β The same PATH, the same installed packages. β
β AI doesn't live in a sandbox. It lives in the real system. β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HUMAN GETS STRONGER AT USING AI β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Sees what AI did β
β Save history shows every save. Terminal log shows activity. β
β Git viewers show commits. Not a black box. β
β β
β Sees why AI did it β
β Save history per commit. Rollbacks visible. Direction changes β
β tracked. The journey, not just the result. β
β β
β Uses multiple models freely β
β Claude for deep reasoning. Codex for quick edits. β
β Gemini for a fresh perspective. Switch without friction. β
β β
β Switches without losing context β
β NIIA carries memory across models. Start Gemini, β
β pull Claude's yesterday session, continue working. β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The Loop
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REINFORCEMENT LOOP β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β AI works better β
β β β
β Human can delegate more β
β β β
β Human understands AI's work through shared tools β
β β β
β Human gives more precise instructions β
β β β
β AI works better β
β β β
β ... β
β β
β The tools don't pick a side. β
β They amplify the collaboration. β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ