mikro
RLM algorithm CLI for coding agents — prompt externalization, Python REPL with symbolic recursion, code-driven navigation.
Based on the RLM paper (REPL-based LLM Method). Uses pi/ai as the multi-provider LLM client, plus two native providers of its own (station/, khal/).
Install
scripts/install.sh is the canonical installer — mikro is git-installed, not
npm-installed (see docs/release-contract.md):
curl -fsSL https://raw.githubusercontent.com/automagik-si/mikro/main/scripts/install.sh | bash
It clones to ~/.mikro/mikro, runs npm ci --include=dev and npm run build,
then symlinks dist/src/cli.js → ~/.local/bin/mikro. Re-running it against an
existing checkout refreshes it in place. From a clone you already have,
bash scripts/install.sh (or npm run install:local) does the same.
Four env vars override the defaults: MIKRO_REPO_URL, MIKRO_BRANCH,
MIKRO_INSTALL_DIR, MIKRO_BIN_DIR.
Update
mikro update # fetch origin/main, rebuild in place
mikro update --force # same, discarding local changes in the checkout
mikro update refuses to run over a dirty checkout without --force, then
resets to origin/main, reinstalls, rebuilds, and prints the before commit,
the target commit and the resulting version. Because mikro is a symlink into
that clone's dist/, this is what makes a new main commit take effect.
mikro update is safe to interrupt: the previous node_modules is parked
while npm ci runs and swapped back if the install fails, and ~/.local/bin/mikro
is a dependency-free launcher (bin/mikro.mjs) that repairs a missing or
half-written node_modules before loading the CLI — so a killed update never
leaves you without a working mikro. Set MIKRO_NO_SELF_HEAL=1 to disable
the repair (CI, or to see the raw error).
Not on npm
mikro is not published to npm — install.sh is the only distribution channel,
and mikro update the only update path. The programmatic SDK still exists in
the same checkout; consume it as a git dependency (dist/ is committed, so no
build step is needed on the consumer side):
npm install github:automagik-si/mikro # package name: mikro
This consumer install uses the consumer project’s npm manifest and lock; it is
not covered by Mikro’s checkout guard before dependency mutation.
Quick Start
# Scaffold .mikro/ config in the current directory
mikro init
# Run a query
mikro "What is the meaning of life?"
# Query with context (directory of docs)
mikro "How does IPC work?" --context ./docs/
# Query with a single file as context
mikro "Summarize this paper" --context paper.md --output json
# Pipe data in
cat data.csv | mikro "Analyze this dataset"
Use mikro from Claude Code / Codex (mikro mcp)
Offload repeatable work to a cheap or local model instead of paying host-model
prices for it every time.
claude mcp add mikro -- mikro mcp
That's it. Claude Code now has an mikro_query tool, plus one tool per
microagent you've defined — mikro_triage, mikro_test_writer, and so on — so
the model delegates to them by name.
Claude Code users: there is a plugin. It registers the same server with
--dir pointed at the project you have open, so agent discovery and the REPL
cwd agree with your project root instead of wherever the host spawned the
process:
claude plugin marketplace add ~/.mikro/mikro && claude plugin install mikro@mikro
The clone is the marketplace — .claude-plugin/marketplace.json sits at the
repository root — and ~/.mikro/mikro is exactly where install.sh put it.
The plugin needs mikro on PATH, which is what install.sh provides; if the
server shows as failed in claude mcp list, check command -v mikro in the
shell that launched Claude Code. It ships that one server plus two skills
(/mikro:offload-guidance, /mikro:microagent-create). Details, limits and
honest positioning: plugins/claude-code/README.md.
Tool contract
Every tool — mikro_query and each microagent — takes the same input, chosen to
mirror the host's own Agent tool so the model uses it without being taught:
| field | required | meaning |
|---|
prompt | yes | The task. A complete, standalone instruction: the agent runs to completion and cannot ask follow-up questions mid-run. |
query | — | Deprecated alias for prompt. Pass one or the other, never both. |
session_id | — | Continue an earlier call on this same tool — pass the session_id its result returned. |
context | — | Path to a file or directory to load as context, relative to the server's working directory. Same as the CLI's --context. |
model | — | mikro_query only: override the model as "<provider>/<model>", e.g. station/Brain-35B. |