An exo-kernel for AI agents.

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.

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.

Task class

Executor ladder

  1. Haiku High
  2. Haiku XHigh
  3. Haiku Max
  4. Sonnet High
  5. Opus Medium
  6. Opus High

Current rung: Haiku HighFloor 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

  1. Opus Medium
  2. Opus High
  3. Opus XHigh
  4. 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
JobOwnerManager
Graph and structure, orient firstGraphifyMemory
Memory across sessionsagentmemoryMemory
Shell outputRTKContext
Sandbox, grep, slice, web fetchContext ModeContext
Read, AST, path jail, injection guardLeanCTXContext

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.

  1. Commit and push Each session’s ledger is committed and pushed on its thread branch.
  2. Reconcile It is reconciled against the default branch: main wins, then this session’s rows are replayed on top.
  3. 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.

Claude Code

  1. Add the Ālo Labs catalog
    /plugin marketplace add alo-labs/agent-plugins
  2. Install the plugin
    /plugin install optimax@alo-labs
  3. Turn it on for this session
    /optimax:optimax on

Codex

  1. Add the Ālo Labs catalog
    codex plugin marketplace add alo-labs/agent-plugins
  2. Install the plugin
    codex plugin add optimax@alo-labs-codex
  3. Turn it on, after trusting the hook once with /hooks
    $optimax on

Standing defaults and controls

Full instructions, including cloud sessions, are in INSTALL.md.

on --scope project
On for every new session in this project.
on --scope user
On for every project you open.
off
Off for this session.
status
Show what applies here and why.
OPTIMAX_AUTOACTIVATE=0
Kill switch. No default applies while it is set.

What Optimax cannot do

Optimax is a set of instructions plus a deterministic controller. That is a deliberate design, and it has edges.