why you should use omp
August 11, 2026
there didn't seem to be great resources on why oh my pi (omp) is such a good harness, so i figured id write a short blog on why you should use it myself.
TLDR: omp is a better harness because it reduces context usage and latency for multi-step work. it does this by letting the model operate like an ide and manage work as a program rather than in its own context.
background
first, i'll briefly review how a vanilla code agent codes in your terminal.
say you are an engineer at empower(uber competitor). you are shipping a new privacy feature to ensure riders get in the right car.
you prompt claude code to come up with a plan to build this feature:
agents have access to commands like Read, Write, Edit, Grep, Glob, and Bash
an agent like claude code(or codex) operating any series of tasks runs on a loop like this. it picks one(or many) tools, executes it, takes in result, reads and decides what to do next.
"problems" with vanilla claude(or codex)
1. each bash call is a new shell
a human in a terminal window running bash commands retains their shell state.
the agents bash does not - it throws it away every single loop:
Bash("export API_KEY=sk-abc123")
Bash("curl -H \"Authorization: Bearer $API_KEY\" api.example.com")
# → 401 Unauthorized — $API_KEY is empty in the new shell
this also applies to functions, a virtualenv, or an in memory object
to carry state over the agent needs to serialize it to disk. it can do this for simple scenarios like test results- these are all just bytes and take milliseconds to write/read.
but its not always so simple, sometimes bash state:
- can't be serialized;
- DB connection, auth session
- or its serializable but very expensive to rebuild:
- a 5GB vector index
now continuing with the empower example — 12 test cases failed after you built the privacy feature. you hand it to claude and ask it to figure out why.
claude finds that the failing tests are because the matching endpoint returns zero waiting riders. so either the data has no riders, or the new privacy feature is hiding them....
to check, claude goes around the server request and instead queries the staging DB in postgres.
to run analysis, you need to auth in. but, a live tcp connection can't be serialized, so for each query, the agent needs to redo the auth:
Bash("python -c \"
conn = psycopg2.connect(...) # reconnect + re-auth
print(conn.execute(\"SELECT count(*) FROM riders WHERE status='waiting'\").fetchone()) \"")
# → (57,)
a human on the other hand could just open a repl in the terminal to maintain the tcp connection OR query directly in the DB.
each reconnect is less than a second, but if you are running many queries, it adds up.
2. tool use and code execution can't share a loop
this means the only way to use a tool after running code is to run an additional loop, which bloats context and increases latency.
the model's context is the only place where code can influence the agents next tool call. this makes it difficult to weave computation and reasoning together.
now continuing the empower example, we are analyzing the 12 failed tests. this is the process you'd have to go through with a vanilla subagent:
1. reads the last failed test and reasons about it (10k tokens)
2. performs a fix (12k)
3. re-runs the test suite, reads output, reasons about bug(14k)
4. makes another fix (16k)
5. ....
each of these is a loop, and creates context bloat. so far its already used 52k tokens to just re-read the same conversation 4 times.
note: an llm doesn't have memory in between loops, so it reads all the conversation history on each loop
3. vanilla claudes have no access to a debugger frame
for certain tasks, this can cause latency, and compounding context, since it prints, runs processes, etc, all in the normal loop.
vanilla claude can still typecheck using the cli, but it has to remember to run the checker.
in sum, in the vanilla claude code setup:
- each new shell we run is stateless - anything you want to keep must be saved to disk, and anything that can't be gets redone on every call.
- in session context bloats overtime. each loop sends the entire convo that came before it, compounding the token bill overtime.
- debugging is painful, and requires slower feedback loops since agents cannot run debug loops in an ide.
these first two issues interact with each other - since you need to redo certain operations, it contributes to additional context bloat, which further compounds the cost.
the solution: omp(oh my pi)
oh my pi keeps the agent loop, but changes where its executed.
instead of it running in a fresh shell, running, and exiting, it gives the agent a pair of persistent kernels:
- a javascript bun worker - the default. runs like a jupyter notebook and used for web/repo-native work.
- a python subprocess - the main model uses it for data analysis.
1. the kernels stay alive for the whole session, which means entire session is stateful
variables, imports, db connections can all be saved as state throughout many tool calls.
| vanilla | omp |
|---|---|
| loop 1 connects to db with auth, and runs a query for awaiting riders loop 2 re-do auth, then run query | loop 1 connects to db with auth, and runs query loop 2 just query - auth is still in RAM |
the persistent kernel keeps auth connections, and variables alive across calls so anything expensive to rebuild is only done once.
2. in OMP, code running inside the kernel can call the agents own tools through a bridge!
this means additional iterations on test cases doesn't have to pass through the orchestrators token stream, and can instead be self contained to the subagents in kernel:
attempts = {}; // stores data from previous loops
while (true) {
const { code, text } = await runTests();
const failures = parseFailures(text);
if (code === 0 && failures.length === 0) break;
const reports = await parallel(
failures.map(f => () => agent(
`fix ${f.name}: ${f.traceback}\n` +
`previous attempts and why they failed:\n${(attempts[f.name] ?? []).join("\n")}`,
{ agent: "task", schema }
))
);
failures.forEach((f, i) => {
(attempts[f.name] ??= []).push(reports[i].fix);
});
}
omp actually doesn't remove context, it still creates a ledger inside the program(attempts). in our example, we have the subagent end with a concise report so future subagents have the relevant context.
for a single debug round, this isn't any different than just spawning a subagent to do it in vanilla.
but if multiple iterations are required, the subagents context bloat and latency starts to add up. omp uses significantly less tokens relative to a vanilla agent.
this is the power of combining more programmatic workflows with an agents reasoning!
3. omp has access to the debugger!
with vanilla claude, the typical loop for debugging is:
- guess where the bug is
- add print statements
- run
- read stdout
- process exits, lose state
- back to top
with omp its:
- attach breakpoint
- run to it
- process stops
- inspect frame
- step forward, inspect again
- only re-run if it overshot breakpoint placement, or to verify fix
with breakpoints, the cost of a guess is much lower. they can access all the data/context relating to the bug, step through it, reason about it, and test a fix. all without compounding context.
note: omp also has more access to more lsp tools than vanilla agents, but i did not find it important enough to warrant a full deep dive.
4. hash-anchored edits
before, in vanilla claude, a tool like edit would work by string matching. the model sends the exact old text it wants to replace, and the harness finds and replaces it. BUT sometimes the model misremembers what the old text was(e.g. it thinks theres a whitespace somewhere). each failure wastes an entire loop.
after, with hashlines, each line is prefixed with a hash. to edit, it just says "replace line at hash ajk2 with this "..."
this saves tons of tokens, and is much more efficient. omp quotes 61% reduction in token usage(grok 4 fast).
how omp works
first you fire up a session from the terminal:

at this moment, we have initiated a session in the harness, which looks like this now:
harness process memory
└─ session object
├─ shell (brush): cwd, env, vars
├─ messages: [...] ← full chat transcript every query/loop
└─ kernels:
├─ js:
└─ py:
the main model operates at the harness level and has access to all message history. it can use tools on its own or writes programs for the kernels to run, which includes tool use and calling subagents.
for example, say i ask omp to to debug a test cases that failed:
This repo has failing tests in both packages. Run bun test from backend/ and bun run test from frontend/ to see them. Find the root causes in the source code and fix them. Re-run both suites after each change and keep going until both are fully green. Then give me a summary: what each root cause was and exactly what you changed.
Use the eval tool for this: write a loop that re-runs both suites and captures failing output into variables (don't print full tracebacks). Each round, dispatch a subagent (tool.task) per failure group with its traceback to diagnose and fix at the source, keeping each report in a variable. Loop until both suites are green, then show one summary: rounds taken and what each fix was.
what happens
- the main model spins up a program to run in kernel:
while (true) {
const { code, text } = await runTests();
const failures = parseFailures(text);
if (code === 0 && failures.length === 0) break;
if (round >= MAX) break;
round++;
const reports = await parallel(entries.map(([file, fs]) =>
() => agent(buildPrompt(file, fs), { agent: "task", schema })));
roundLog.push({ round, failuresBefore, fixes });
}
here the instructions is simple, run this program, dispatch subagents for each bug, have them go in, make a fix, post a summary of the change they made.
- it runs a separate subagent through the kernel for each test bug in parallel
the js kernel boots up each subagent, which runs in memory inside the harness. they go through their own loops, append a summary at the end. then the loop runs the test again, and if they don't pass, a fresh subagent goes through again.
the harness session now looks like this:
harness process memory
└─ session object
├─ shell (brush): cwd, env, vars
├─ messages: [...]
├─ kernels:
│ ├─ js: ← while-loop program running here
│ └─ py: (idle)
└─ subagent workers (spawned by the js program):
├─ task: fix test_a ← own messages, own loop
├─ task: fix test_b
└─ task: fix test_c
- when they finish the main model gets a summary of results, context only increments by 42k tokens(4.2%)
since most of the work was done with subagents, the main orchestrator didn't need to keep track of much context. if we had multiple rounds of fixing, the orchestrator agents context would not bloat like it does in vanilla claude code.
see data here for analysis on cost/token savings:
- https://x.com/composio/status/2085330850300797394?s=20
- (as fyi, this eval is across a variety of tasks, when omp is generally best for coding)
4. a few other reasons to use omp
image processing
- in vanilla claude, reading images can be very token-expensive to put into context. one high-res screenshot can cost 2,691 tokens everytime we go through loop.
- omp has an inspect_image tool that sends the image to a separate vision model, which returns a short text description. this saves significant
- note: sometimes sending image to claude is better if the full context is needed. there also is a snapcompact product where you can use an image that contains 10k tokens worth of text, and only be billed by anthropics pixel formula of 3279 pixel tokens.
model routing superpowers
- you can switch orchestrator model mid session
- you can also specify which models you want to use by giving them roles, for example:
- default: fable
- plan: opus 4.8
- smol: sol 5.6
- commit: writing commit messages
more LSP tools
- vanilla has 9 LSP tools through IDE. integrations. but thats it.
- omp has 14. the biggest edge being a file rename tool.
convo forking and refreshing history
- you can use
/treeand literally look back and fork from different parts of ur convo - you can use
/resumeto view a list of recent sessions, and select one.
final thoughts
overall, oh my pi reduces:
- context
- latency
- state rebuilds
but something more exciting(which pi also does), is it gives us the ability to introduce more deterministic methods into our agent processes. rather than writing a skill, we can make it a program instead, and have more trust in our agents!
