mitosis
mitosis takes work that one agent would grind through serially, splits it so
several agents run on it at once, and produces pull requests a human can
merge without discovering that the parallelism broke something. It validates
the input, schedules the split, prepares a worktree and branch per piece,
builds each Lane in its own clone of that branch, lands only the Lane's
write-set, gates the result, reconciles what was
actually written against the git log, and opens one pull request per
piece, stacked on its predecessor where one exists, or pushes each piece's
branch and hands back its pull request's title and body for the caller to
open.
Inputs
mitosis takes exactly one of three inputs, and needs nothing else to run:
--items, a JSON array of Steps, handed to it directly.
--spec, a document in any format, which mitosis decomposes into that same
Steps array, each Step with its task, in one structure call before
scheduling.
--asks, an asks file, one ask per line, each planned by its own call
through --decompose-command.
All three converge on the same items format before anything downstream runs.
On --spec and --asks each Step writes its own acceptance tests: mitosis adds
every test file a Step's acceptance names to that Step's files, unless the
charter locks it, so a plan mitosis makes has no check-author Step.
The file --items names is read through mitosis's own items schema,
schemas/mitosis-items.schema.json, which accepts every file h12 accepts and
the reference planner's Steps: a Step carries name, files, and task or
text; source, acceptance and spec_ref are optional. source names the
document by absolute path and SHA-256. A file that fails it is refused with
exit 3, each error named with its Step, before anything is planned. Two Steps
that build a validator and then its command-line flag:
[
{
"name": "validate-manifest",
"task": "Add validate_manifest(path) to app/manifest.py, returning one error per missing key.",
"files": ["app/manifest.py", "tests/test_manifest.py"],
"source": {
"path": "/work/app/docs/specs/manifest.md",
"sha256": "4bc2c86cd92744fbb47c8f13e04a42d78fec19f8c032ab091e4a8255720346c8"
},
"acceptance": [
{"file": "tests/test_manifest.py", "test": "a_missing_key_is_reported_by_name"}
],
"spec_ref": ["1.1"],
"complexity": "simple"
},
{
"name": "validate-flag",
"task": "Add --validate to app/cli.py, printing those errors and exiting 1 if any.",
"files": ["app/cli.py", "tests/test_cli.py"],
"source": {
"path": "/work/app/docs/specs/manifest.md",
"sha256": "4bc2c86cd92744fbb47c8f13e04a42d78fec19f8c032ab091e4a8255720346c8"
},
"acceptance": [
{"file": "tests/test_cli.py", "test": "validate_exits_one_on_a_bad_manifest"}
],
"spec_ref": ["1.2"],
"after": ["validate-manifest"],
"complexity": "simple"
}
]
What it never does
mitosis does not merge. Merging is a judgment call — review passed, CI green,
blast radius acceptable — and that judgment stays with a human.
mitosis does not run the full test suite; continuous integration does that, on
the pull request it opens. It does not name a model, hold an API key, or link
an SDK — every model invocation is a subprocess spawned from a command
template the caller supplies. And it does not judge a document's quality: it
reports how cleanly a document decomposed, and never refuses one.
Install
mitosis installs as a Claude Code plugin from this repository. Add the
repository as a plugin marketplace, install the plugin, then restart Claude
Code:
claude plugin marketplace add SatanshuMishra/mitosis
claude plugin install mitosis@mitosis
The plugin carries the skill and the eighteen modules it runs — core.py,
shape.py, decompose.py, run.py, isolation.py, pr_facts.py,
mitosis.py, metrics.py, spend.py, metrics_writer.py, referee.py,
outcomes.py, handoff.py, recon_text.py, step_names.py,
asks.py, own_tests.py, joint.py — the two data files they read,
prices.json and catalogue.json, the contracts/ folder beside the
modules, which holds byte-identical copies of the program's
contracts/validator.py and of every owned schema mitosis writes or reads,
and the schemas/ folder beside contracts/, which holds mitosis's own items
and recon schemas.
They need Python 3.9 or later. A run that names --pr-type and
--pr-subject also needs the pull-request command, 0.3.0 or later, on PATH
or named with --render-command, because mitosis writes no pull-request text
itself.
To update, refresh the marketplace, update the plugin, and restart:
claude plugin marketplace update mitosis
claude plugin update mitosis@mitosis
An installed copy only updates when the plugin's version changes, and every
release changes it; CHANGELOG.md lists them.