Optimax stays thin and leaves your Orchestrator model in charge. Underneath it, one layer manages the three resources of an agent session: which model does each delegated task, what enters the context window, and what persists between sessions.
For Claude Code and Codex. MIT licensed. By Ālo Labs.
Models and effortExecutor and Advisor ladders
Context windowRTK, Context Mode, LeanCTX
Across sessionsGraphify, agentmemory
Optimaxexo-kernel
ProcessContextMemory
Your OrchestratorPlans, delegates, decides.
Claude Code · CodexAgent host
The same stack, seen from the side
An exokernel does resource management and nothing else. Policy stays with the application above it, and both run inside the agent host you already use.
Agent host
Claude Code · CodexRuns your Orchestrator session and loads Optimax as a plugin.
Application
Your OrchestratorThe session model you chose. It plans, delegates and decides.
Optimaxexo-kernel
ProcessContextMemory
Resources
Models and effortExecutor and Advisor ladders
Context windowRTK, Context Mode, LeanCTX
Across sessionsGraphify, agentmemory
The kernelOne layer down: the thin sheet Optimax adds.
Three managers, one thin layer
An operating system kernel answers three questions about scarce resources. An agent session has the same three, and before Optimax each one was answered ad hoc.
Process
Which model, at which effort, does this delegated task?
Your session model stays the Orchestrator. Delegated work goes to an Executor ladder and an Advisor ladder, and each rung is earned from independently assessed results.
Run by the controller and a score ledger
Context
What enters the context window, and how compressed?
Shell output, file reads, searches and web pages each have exactly one tool responsible for shrinking them. Nothing is compressed twice.
Run by RTK, Context Mode and LeanCTX
Memory
What persists after the session ends?
A graph of the repository to orient in before reading files, and a store of decisions that the next session can recall.
Run by Graphify and agentmemory
Routing that learns from results
Every delegated result is assessed independently on a 0 to 5 rubric. Five eligible runs decide whether the next task of that kind goes to a stronger rung, a cheaper one, or the same one.
Executor ladder
Haiku High
Haiku XHigh
Haiku Max
Sonnet High
Opus Medium
Opus High
Current rung: Floor for this class: Haiku High
Last five assessed runs
Record a score
Record five scores to see the controller decide.
Average of 4.5 or less Move up one rung.
Five straight 5s Move down one rung, never below the floor.
Anything else Stay where you are.
Advisor ladder
Opus Medium
Opus High
Opus XHigh
Opus Max
An Advisor is consulted before any plan or design is finalized. The Orchestrator checks the advice and owns the decision. The Advisor ladder follows the same five-run rule.
Where the scores live
In a plain CSV ledger, one per user and project, that you can read and diff:
model-perf/<user>-model-perf.csv
Tasks are classified low, medium or high. Each class starts on its own rung, and that rung is also its floor.
Review Ladder
Also bundled: a staged, independent review-and-repair sweep that takes a bounded scope through every rung of the Executor ladder.
/optimax:review-ladder
The resourcesThe bottom layer: what the kernel manages.
Five tools, one owner per job
The context and memory managers are the Silver Bullet five-tool stack. The bundled Context Stack skill installs, wires, verifies and repairs it on both hosts.
Which tool owns which job
Job
Owner
Manager
Graph and structure, orient first
Graphify
Memory
Memory across sessions
agentmemory
Memory
Shell output
RTK
Context
Sandbox, grep, slice, web fetch
Context Mode
Context
Read, AST, path jail, injection guard
LeanCTX
Context
Nothing changes without a yes
stack.py plan shows every file diff and command before anything runs. Consent is recorded per user and never read from a repository.
Verification that can fail
stack.py verify exits nonzero on any failed check, so it works in scripts as well as by eye.
Shared with Silver Bullet
Both read and write the vendor-neutral five-tool-stack/v1 manifest. When Silver Bullet is installed it owns the wiring, and Optimax only verifies.
Claude Code
/optimax:context-stack
Codex
$context-stack
Scores that survive a fresh container
Added in 0.6.0. Cloud sessions start from a clean checkout, and parallel threads each learn something. A repository can opt in to syncing the score ledger through git so none of it is lost.
.optimax/team.json
{"schema":1,"sync":"on"}
Commit this file to turn syncing on for the project.
Commit and push Each session’s ledger is committed and pushed on its thread branch.
Reconcile It is reconciled against the default branch: main wins, then this session’s rows are replayed on top.
Carry on The next container, or a parallel thread, starts from what every session has learned.
Enabled per project, never per person
OPTIMAX_SYNC=0 is a personal opt-out
Never force-pushes
Never bypasses hooks
Never syncs on the default branch
Back at the surfaceBring the layer up in your own sessions.
Install, then switch it on
Installing enables nothing. Optimax applies only after you turn it on, for a session or as a standing default.