Overview

Amaleh is a self-contained workflow skill for Codex and Claude: discovery, planning, delegated parallel implementation, independent review and verified delivery. This page explains why it exists and who does what.

The problem Amaleh solves

Top-tier models are too expensive to do the work. Without structure, an expensive model spends its premium context writing every edit, every check and every micro-decision. Amaleh turns that model into a director instead of a laborer: it segments the work into chunks with clear outcomes, delegates each chunk to cheap Flash models, and verifies direction only at the chunk boundaries.

The project's name is عمله — Persian in origin, pronounced Ah-mah-leh, meaning workers / laborers. Amaleh is the Latin-script name for coordinated workers contributing to a shared, verified outcome.

Two things make that delegation safe. Each chunk is reviewed independently by a different model family while it runs, and each material outcome is checkpointed to disk. A checkpointed run continues in another session, on another day, without replaying the conversation that produced it.

Amaleh is not an unattended background service. A closed session resumes from disk on the next invocation, and the host keeps control of network access and project context.

How the work is divided

Four roles carry a run. The expensive model coordinates, cheap models execute, a second cheap family reviews, and a third cheap role answers the questions that would otherwise stall either of them.

accepted chunkCoordinatorClaude Code · CodexFlash poolDeepSeekGLMMiMoStealthrouted per chunkReviewerread-onlyJevbounded decisionsKimideeper specialist1 delegate2 consult3 review4 escalate5 return
One chunk, end to end: Claude Code or Codex hands a chunk to a routed Flash family — DeepSeek, GLM, MiMo or Stealth — Jev answers bounded choices, the other family reviews read-only, exhausted repairs escalate to Kimi, and the accepted chunk returns.

Coordinator

minimal turns

Clarifies intent, chunks the work, defines acceptance criteria and integrates the results. One delegate call per chunk: no per-step instructions, no hand-written briefs, no micro-management.

Workers

pi / OpenRouter

The routed Flash families — DeepSeek, GLM, MiMo and Stealth — each own a chunk end to end: implementation, checks and repair cycles. When a choice inside the chunk is uncertain they consult Jev directly through the bundled helper instead of escalating to the coordinator.

Reviewer

read-only

The other Flash family independently verifies each chunk with structured coverage. Findings route back into the worker’s repair loop, not to the coordinator.

Jev

bounded decisions

Answers bounded either/or questions for the workers and the coordinator. Dependencies, ownership, checks and review coverage are enforced by TypeScript code, not by a model.

The coordinator works like a director: clarify intent, segment the work into chunks with clear outcomes and acceptance criteria, hand each chunk over, then inspect the returned evidence and integrate it. Everything inside a chunk — implementation, in-task decisions, checks, independent review and repair cycles — runs without the coordinator in the loop.

Routing and escalation

Worker and reviewer models are chosen by deterministic round-robin across eligible stable Flash families, seeded by the run’s session hash, so work spreads across vendors instead of fixating on one. No Jev call is spent on mechanical selection. A provider that fails its retry budget is skipped for five minutes, which costs capacity rather than the whole run. A model whose average call takes at least twice the median of its configured peers for a role is skipped for that role only, until its slow calls are a week old.

Only genuine boundaries reach the expensive model: an exhausted repair allowance, missing evidence, or ambiguous intent. Repair escalation is enforced by persistent counters inside the chunk loop, so the coordinator only sees the final escalation.

Repair stageWho actsWhen it is used
Flash repairThe routed workerDefault repair of review findings, inside the chunk’s own loop.
Kimi repairA deeper specialist modelJustified deeper work once the Flash repair allowance is exhausted.
HostThe coordinatorJustified escalated diagnosis, missing evidence and genuine external blockers. The last step: host work is accepted on its checks, with no model review.

What stays with the host

The host prepares an isolated workspace for each task and integrates the accepted results. Integration stays serial: parallel chunks work in their own checkouts, and their changes meet again in the main workspace.

Network access and permission to send project context remain host-controlled, and Amaleh never edits global permission settings. Credentials stay in the host environment or in pi’s configuration, never in the repository.

Continue with getting started for the prerequisites and the first run, or read the command reference for the CLI operations behind each step.