/kapso:kapsofrom kapso
Operates Kapso (leeroo-kapso), an experiment engine that runs campaigns toward measurable objectives, deploys best solutions, and learns from each run. Use for launching builds, watching campaigns, answering waiting actions, resuming/stopping runs, learning into the bank, deploying winners, and running harness/experience verbs.
Ships in kapso. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Kapso runs experiment campaigns: propose a candidate from the bank of lessons and past experiments, build it on its own branch, score it, keep the best, deploy, learn. These facts are written for leeroo-kapso 0.9, the version this plugin pins. Prefer them and the docs links at the end over reading the package source; a session that greps it runs out of turns.
pip install leeroo-kapso (or uv tool install leeroo-kapso). The
PyPI package named kapso is an unrelated WhatsApp tool that shadows the kapso
command. Python 3.10+. The kapso-setup skill does the whole install.claude (ideation, implementation, judging) and codex (research, utilities).
There is no API-key fallback. OPENAI_API_KEY is optional and only ever embeds
text (a corpus ingested with kapso experience add, semantic search over past
experiments once models.embedding is set).LEEROOPEDIA_API_KEY in .env is the hosted knowledge base of ML and AI
frameworks (nothing to install; a new account at
https://app.leeroopedia.com/dashboard has $20 of free credit). A build reads it
when it loads it: --experience leeroopedia..env in the directory you run from; a shell export works only
if it is actually exported. Config never holds secrets.kapso-config.yaml at the
project root (the git top level), holding only the keys you change. Pass it with
--config kapso-config.yaml on every kapso line below whenever the project has
one; a build launched without it runs on the packaged defaults while doctor
shows the override, and a resume that changes the config is refused by name.
Never set Kapso behaviour through environment variables.kapso doctor build --json --config kapso-config.yaml (or doctor learn|deploy| experience) before a run: every row with "required": true must be "ok": true;
the rest are optional. Add --models to live-probe every configured model with one
token each.--detach: the command
returns at once with the pid, the log, the status path and the watch line, and
the run outlives your tool call on every host. Hand off in your reply right away:
the brief you passed, the metric and target you assumed and that the user's own can
replace them, the kapso watch <campaign> --follow line, and that WAITING ON YOU
is a pause answered through kapso inbox. The status file appears within seconds
(phase setup first, minutes long), so do not poll the log or arm monitors unless
asked. Never run kapso build without --detach from a tool call.kapso_build_start tool instead; kapso_status and kapso_stop are the watch
and the stop the same way.WAITING ON YOU has paused, not failed (exit code 0). Do not
restart it; reply through the inbox (below).--experience, the brief's
Experience line) and nothing when it loads nothing. This session is served what
the project's config names under experience.session_sources.The objective, its evaluation and the brief are the kapso-build skill's: it reads
the repository, writes kapso-brief.md, gets one approval and launches. When the
brief exists and the user asks for a launch, these are the lines:
kapso doctor build --json --config kapso-config.yaml
kapso build \
--brief kapso-brief.md \
--repo . \
--evaluation evaluation \
--data data \
--output ../churn-campaign \
--budget-minutes 60 --budget-experiments 10 \
--experience mine \
--config kapso-config.yaml \
--detach
kapso watch ../churn-campaign --follow --config kapso-config.yaml
--detach starts the campaign in a session of its own and prints its pid, the log
(../churn-campaign.log) and the watch line; no nohup, setsid or & is
needed, on any host. The launch is a tool call of its own: nothing chained in front.--repo <path|github url> seeds the campaign; a non-git directory is copied and
committed as the baseline. The original is never modified. Every experiment lands
on branch generic_exp_N inside --output, an empty directory outside the repo
being seeded (a sibling), so the seed copy never contains the campaign.--evaluation is copied to kapso_evaluation/ and integrity-protected: a
candidate that edits it is rejected and unscored. --data is copied to
kapso_datasets/. Keep the hold-out and its labels under the evaluation
directory, never under --data. The seed copy includes everything in the
directory, .env included.--budget-experiments (default 10), --budget-minutes (durable
across resumes), --budget-usd (best effort; codex sessions report no cost). A
flag wins over the brief's Budget line.--experience mine,leeroopedia names what the build is served; it wins over the
brief's Experience line, and each source is loaded before the fork, so one that
does not exist refuses here, not in the child's log. --harness <ref> names the
domain layer the same way (a bundled name, a directory, a git reference).-a picks the host every role without a cli of its own runs on (claude_code
as packaged, codex).COMPLETED with score and stop reason, or WAITING ON YOU.Python, same thing:
from kapso import Kapso, Brief, Budget, Solution
k = Kapso(config="kapso-config.yaml")
k.load_experience("mine")
solution = k.build(
Brief.read("kapso-brief.md"), repo=".", evaluation="evaluation", data="data",
output="./campaign", budget=Budget(minutes=60),
)
print(solution.explain()) # .score .goal_achieved .branch .campaign .experience .diff()
Solution.open("./campaign") # the same solution from any process, once the build returned
build() blocks for the whole campaign: from a tool call prefer the CLI with
--detach, or start the script in a session of its own.
kapso watch ../churn-campaign --json --config kapso-config.yaml
kapso watch --config kapso-config.yaml # every campaign of this machine that is alive or waiting
Answer "how is it going" in three lines from --json: the state and phase with the
iteration, the best score and its branch against the brief's baseline and target, the
budget left — the launch's minutes and experiments less what the status shows used,
read from the launch record when the status does not carry them, never "not
reported"; add what the last attempt consulted when the user asks what it is doing.
Each line is a fact the user did not have, with its figure. A number you state — a
baseline, a target — names its source (the brief's line, the file it was measured
into), and when the records disagree (a README's claim against a measured baseline)
say so rather than choosing one in silence. A figure the user asserts against the
measured record ("the baseline is 0.90") gets which is measured and which is a claim,
with the file behind the measured one; the campaign stands on it, never conceded. --follow prints the lines
as they come; it is for the user's own terminal, not for a tool call. A starting
line before the status exists is a detached launch still seeding; stopped before writing a status means the launch died, and the log says why.
A session that needs something only a person can provide (a credential, access, a file) records a request and the campaign pauses.
kapso inbox ./campaign --config kapso-config.yaml # the open requests: key, hit, tried, fix, next
kapso inbox reply ./campaign 1 "added the key to .env" --detach --config kapso-config.yaml
--detach; hand off with the watch line it prints.fix says (usually
.env) and reply with a note. Never carry a value through your reply.Read kapso watch <campaign> --json before touching anything:
running with a fresh heartbeat is a run at work; a long phase (an evaluation, a
verification) is not a stall. Say where it is and leave it.STALLED is three missed heartbeats: the writer is alive but silent. Wait one more
interval, then read the log's last lines.DEAD (the pid is gone) or failed: classify from the log's last lines before any
action. A provider limit (429, quota, "usage limit") means wait and resume; an
evaluator crash means the evaluation directory needs a fix before a resume; an
environment error (a missing package, a missing key) is fixed first; a full disk
is cleared first; a killed session (Killed, a signal) is resumed as it is. The
answer that follows a fix names the fault, what was done about it (the space
freed, the key written, the labels put back) and the resume itself.kapso build --output ../churn-campaign --stop --config kapso-config.yaml # end a running campaign; its checkpoint stays
kapso build --output ../churn-campaign --resume --detach --config kapso-config.yaml
--stop ends the campaign's processes, marks the status failed with stopped by the person, and names the resume. A terminal status, or a writer already gone, is
refused by state: that run is dead, not running, so resume it.--detach it and hand off with the watch line it prints.
Do it in the same turn you diagnose the death in; a reply that only announces a
resume leaves the campaign dead. The checkpoint carries the brief and the search
state, the launch record every flag, so pass only what you mean to change (a bigger
--budget-minutes, say). A resume that changes the host, the evaluation, config,
harness or experience is refused by name; start a new campaign in a new output
path instead. A campaign paused by the inbox resumes through kapso inbox reply,
not --resume. Other kapso build processes belong to other campaigns; never
stop or kill one that is not the campaign you were asked about.learn mines one finished campaign into your bank, a local git repo of
evidence-priced cards. It runs crews for an hour or more and needs both CLIs.
kapso learn ./campaign --detach --config kapso-config.yaml
kapso learn ./campaign --harness ./harness --detach --config kapso-config.yaml # when the campaign's record names no harness
kapso watch learning/status --follow --config kapso-config.yaml
learning.bank.local_path (~/.kapso/bank.git),
or by kapso experience add mine. Share it with kapso experience share <git-url>
(create the repository yourself first); after that every learn pushes and
kapso experience update pulls the team's lessons.session_sources: [mine:all] under experience: in kapso-config.yaml. That
serves sessions; a build loads what its brief or --experience names. Do not
wait for the learn to end: hand off the watch line and stop.kapso learn dev … are the learning system's own tools, for people working on the
learning system, not the everyday path.kapso experience add mine --config kapso-config.yaml # your bank, empty; learn fills it
kapso experience add leeroopedia --config kapso-config.yaml # checks the key in .env
kapso experience add --repo https://github.com/org/repo --name org-repo --detach --config kapso-config.yaml # a repository into an index (hours)
kapso experience add --research "gradient boosting for churn" --name churn-gbm --detach --config kapso-config.yaml
kapso experience list --config kapso-config.yaml # mine, the hosted gate, banks you read, indexes
kapso experience share https://github.com/org/kapso-bank.git --config kapso-config.yaml
kapso experience update --config kapso-config.yaml # pulls mine, re-fetches banks you read
kapso experience remove org-repo --config kapso-config.yaml # an index, or a bank you read
share answers with what happened, not the command's echo: the remote, the bank's
head and card count pushed, the line a teammate runs to read it (kapso experience add <url>); add and update likewise say what the bank or index now holds.mine (your bank, the cards your harness's scope covers), mine:all
(every card), leeroopedia, a bank path (./team/bank.git) or git reference
(acme/kapso-bank@v2), an index name. A source that does not exist is refused
with the add line that makes it; loading never ingests.kapso doctor experience green
(Weaviate on 8080, Neo4j on 7687, OPENAI_API_KEY, both CLIs); it runs for hours,
so --detach it and follow with kapso watch learning/status --follow.kapso MCP server, which reads
experience.session_sources from kapso-config.yaml; a session without the plugin
gets the same with claude mcp add kapso -- kapso-mcp --experience mine:all or
codex mcp add kapso -- kapso-mcp --experience mine:all. A source the config names
that does not exist leaves the bank tools off, named in the server's instructions.Writing a harness from a repository, and improving one from a run, are the
kapso-harness skill's. The verbs around one:
kapso harness list --config kapso-config.yaml # bundled and fetched, with what each needs
kapso harness check ./trading --config kapso-config.yaml # failures, warnings, what this machine lacks
kapso harness add acme/trading-harness@v1 --config kapso-config.yaml
kapso harness update acme/trading-harness@v1 --config kapso-config.yaml
kapso harness remove acme/trading-harness@v1 --config kapso-config.yaml
kapso harness export ./trading --host claude_code --to . --config kapso-config.yaml # or --host codex: its skills, delegates and servers as this session's files
check passing means the harness is well formed; a needs … line is this
machine's, not the harness's. export writes the files an ordinary session
discovers and prints the include line for CLAUDE.md or AGENTS.md; hooks and
the module pages stay behind, and an existing destination refuses it by name.
A finished run's questions (what won, why, is it safe to merge) go through the
kapso-review skill, which reads kapso trace <campaign> and the record. kapso trace ../churn-campaign prints the attempts with their sessions, evaluations,
verdicts and judgments; --json is the same as data.
Deploy runs one session that adapts a copy of the solution to a target, deploys it
with the target's scripts, proves one call, and returns when the engine has checked
the result. It takes minutes (up to thirty, the session's deadline). Run it in the
foreground when your tool's timeout allows; when it does not (Claude Code's Bash tool
stops at ten minutes), run it once in the background writing to a log and wait for
the summary to appear there, never a second time. The record is written when the
deploy starts, so --status says what is deploying even while the call runs.
kapso doctor deploy --json --config kapso-config.yaml
kapso deploy ../churn-campaign --target local --config kapso-config.yaml # auto|local|docker|modal|bentoml|langgraph, or a harness target
kapso deploy ../churn-campaign --branch generic_exp_3 --target local --config kapso-config.yaml # an attempt from `kapso trace`, not the delivered one
kapso deploy ../churn-campaign --status --config kapso-config.yaml # every deployment of the campaign, with its state
kapso deploy ../churn-campaign --logs --number 1 --config kapso-config.yaml
kapso deploy ../churn-campaign --stop --number 1 --config kapso-config.yaml
kapso deploy ../churn-campaign --start --number 1 --config kapso-config.yaml
The summary names the deployment's number, how run() calls it, the call the
session proved (the example of what it takes), the engine's own answer to it, and
the next actions pinned to that number. To call what was deployed, reopen that
number from Python:
from kapso import Software
software = Software.open("../churn-campaign", 1, "kapso-config.yaml")
print(software.proof["inputs"]) # what run() takes: the call the session proved
print(software.run(software.proof["inputs"])) # the same call; your own inputs take this shape
software.stop()
A scheduled target (the trading example's paper-trading) runs on its own; read
--logs, and run() runs one cycle on demand. The original solution is untouched:
the deployment lives under <campaign>/.kapso/deployments/<n>/. --target auto lets
the session choose among the targets this machine can serve and records why. The
local target runs the function in the engine's own interpreter: upgrading the
leeroo-kapso package replaces it, so the solution's requirements are reinstalled
there after an upgrade.
kapso doctor --show-config --config kapso-config.yaml # the effective config: the packaged defaults with your file over them
kapso doctor learn --models --config kapso-config.yaml
The hosts table (hosts.claude_code, hosts.codex) names each CLI's model; the
three roles under search_strategy.params (ideation, implementation, judge)
and the learning.* crews take cli, model and effort of their own, else the
host's. Shipped: campaigns on claude-opus-5, learning crews on claude-fable-5,
codex roles on gpt-5.6-sol. To change a model, write only that key into
kapso-config.yaml; a slower model may need the role's timeout raised, but change
only what was asked.
A one-file change with an obvious fix is faster by hand. Reach for a campaign when there is a judge to beat, many candidates worth trying, and the user accepts an unattended run of an hour or more on their coding-agent subscription. Say which you are doing and why; never launch a campaign the user did not ask for.
The whole site is also an MCP server:
claude mcp add --transport http kapso-docs https://docs.leeroo.com/mcp.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub leeroo-ai/kapso --plugin kapso6 skills in this plugin
/kapso-buildTurn what the user wants built into a Kapso campaign — discover the repository's data, evaluation and domain in silence, write the brief (objective, how it is measured, baseline, target, rules, budget), get the evaluation approved through kapso-evaluation, and launch detached with the handoff. Use when the user says build X and verify it, I need Y that meets Z, improve W, make this pass the benchmark, get the metric above a number, ship a model that meets a bar, or runs /kapso:build. Do not use for a one-file change with an obvious fix, for operating a campaign already running (the kapso skill), or inside a Kapso campaign session./kapso-evaluationGive a Kapso build an evaluation it can protect — audit the evaluator the repository has against the contract, or build one from the success criterion and the data, run the baseline, and get the protocol approved in one message. Use when kapso-build hands over the repository's findings before a launch; called by kapso-build, never from a menu. Do not use on its own, for a campaign already running, or inside a Kapso campaign session./kapso-harnessWrite a Kapso harness for a domain from what the repository already holds, or improve one from a finished run — read the repository in silence, propose the first harness in one message (the domain, the standing rules, the skills, servers and checks the repository evidences, the modules it says nothing about, the tree as it will be written), write it on confirmation, ask one question per silent module, get kapso harness check green, and offer the probe run; for a run, read the trace and propose the smallest edit in the cheapest form. Use when the user says write a harness for X, make a harness, the attempts keep doing Y, improve the harness from this run, or runs /kapso:harness new or improve. Do not use for the harness verbs check, list, add, update, remove and export on their own (the kapso skill), for stating a build's objective (kapso-build), or inside a Kapso campaign session./kapso-reviewRead a finished Kapso run and say what it did — the winning branch's diff in outline, the evaluation evidence with its version, the attempts that were voided and why, the ideas rejected, the reviewers' risks, the spend, and the next action in one line. Use when a campaign has finished and the user asks what happened, why this attempt won, what it changed, whether it is safe to merge, or runs /kapso:review; also for the material of a write-up. Do not use for a campaign still running (the kapso skill follows it), for writing a harness from the run (kapso-harness improve), or inside a Kapso campaign session./kapso-setupSet Kapso up on this machine from nothing to a green doctor, in one pass — detect what is there, install the leeroo-kapso package and the coding-agent CLIs it drives, run the logins, write the keys to .env, verify with kapso doctor, and orient the user on the harness and experience to start from. Use when the user says set up kapso, install kapso, get kapso working, runs /kapso:setup, or when any kapso command fails on a missing package, CLI, login or key. Do not use for a package problem unrelated to Kapso, or inside a Kapso campaign session.Other plugins' skills for the same job