Purpose
Trinity Lite is a local AgentOps control plane for cross-vendor CLI coding agents (such as Codex, Claude Code, Hermes, and custom CLI agents). It connects the tools you already use instead of requiring you to rebuild them within another framework.
When you use multiple capable coding agents at the same time, the difficulty is no longer starting another agent, but maintaining task truth across tools, restoring state after a client disconnects, preventing duplicate work, and determining when a result is truly accepted. Trinity Lite is this local operations layer.
Main Capabilities
- Route by capability rather than name: You describe the task, and the router matches it to the appropriate agent, without hardcoding agent names and without fragile scheduling logic. Agents labeled implement receive implementation tasks, and agents labeled review receive review tasks.
- Provide a pull queue for each agent: Workers read pending tasks from the shared bus, execute them through the CLI, and write results back. Each agent polls at its own pace, with no need to copy and paste output between terminals.
- Record every decision: Every task, state change, result, error, and inter-agent message is written to a local SQLite database, so you can query who did what and when, and what happened, without setting up a logging pipeline.
- Review, verify, then accept:
orchestrateRun the main task, route the required review, run local verification, and write acceptance evidence back to SQLite. - Prevent dangerous operations: Self-routing becomes an explicit local work decision rather than forming a loop; delegation depth has a hard limit; the working directory must be within the allowlist.
- Evidence-based acceptance: The review process records routing decisions, review links, verification results, acceptance reasons, and accepted_at in SQLite. Only after the local verifier passes is a reviewed task accepted.
- Export proof packages:
trinity-lite proof <task_id>Write a task's routing, results, review, verification, and acceptance evidence into a portable JSON package and a human-readable Markdown summary. Missing stages are clearly marked and never fabricated. - Use git worktree to isolate agent code edits (v0.6 preview):
trinity-lite worktreeCreate managed branches and checkouts, record the base commit, and return diff evidence without touching the main checkout. - Run CLI workers on demand:
trinity-lite worker codex --oncePull a queued task, execute that agent's command, and write the result. Can be run in a loop, via cron, or manually. - Execute safely, with no shell injection: Agent commands are JSON arrays run with shell=False, with no string interpolation into the shell.
- Test with mock agents: Mock agents can simulate the full loop without a real CLI, allowing you to prototype routing, persistence, and review handoff before connecting real agents.
- Prevent runaway delegation: Self-delegation is blocked, delegation depth is capped, working directories are added to the allowlist, and it is safe by default.
- One-click health check:
trinity-lite doctorValidate Python, SQLite, routing configuration, agent configuration, and release readiness.trinity-lite doctor --onboardingRate each check as blocker or optional, probe the agent CLI, and fail only on blockers. - Zero core dependencies: By default, the runtime uses only the Python standard library. YAML pipelines are available via an optional extra.
- 150+ tests: Cover mock workflows, safety checks, routing, persistence, MCP, and acceptance gates.
- Optional model selection hints: Based on the model pool you declare, select using transparent task, tier, and capability rules, without claiming that a universally best or cheapest model exists.
Usage
Requires Python 3.10+, with zero core runtime dependencies (unless optional extras are installed).
30 seconds, no agent needed: The built-in Mock agent lets you see the complete route → work → review → verify → accept loop before connecting a real agent.
Workflow example: Route the main task → run worker → run reviewer → verify → accept. One command, one audit trail. The main task line records route_json、review_task_id、verification_json、acceptance_status、acceptance_reason and accepted_at.
Initialize a real CLI: Automatically detect what is installed and generate a safe starting configuration:
trinity-lite init
It probes PATH for Codex, Claude Code, and Hermes, writes agents.local.jsonfor the CLIs it finds (including a JSON array command), leaves the rest in mock mode, never writes credentials, and never overwrites an existing configuration without --force . If you prefer manual editing, run:
cp examples/agents.command.example.json agents.local.json
When you prefer manual control, you can use lower-level bus commands.
Worktree preview (v0.6 preview, manages isolated worktree lifecycles and diff evidence; automatic merging back to the main branch is out of scope): Create an isolated checkout and record the branch, base commit, path, agent id, task id, and diff evidence. By default, it does not merge branches or delete branches.
MCP server: You can turn the task bus into an MCP server, letting any MCP client dispatch, query, and route tasks. It provides 3 resources:trinity://health、trinity://tasks/recent、trinity://tasks/{task_id}. If the MCP client disconnects or times out before the task id is displayed, you can first call trinity_lateston the source agent, then use the returned main task id to call trinity_status. By default, trinity_latest skips secondary review subtasks, so recovery lands on the user-facing task.
Acceptance evidence:trinity-lite orchestrate writes a local acceptance trail into the task line, including route_json(the JSON-encoded routing decision for the main dispatch),review_task_id and parent_task_id(links between the main task and secondary reviews),gate_status(primary_pending、review_pending、review_passed、review_attention、verification_failed or accepted)、verification_json(the JSON-encoded local verifier result, by default trinity-lite doctor) and acceptance_status、acceptance_reason、accepted_at. If the reviewer reports P0/P1 issues, the flow stops at review_attention ; if local verification fails, it stops at verification_failed. It writes accepted_atonly after the required review and verification pass.
Export proof:
trinity-lite proof <task_id>
The JSON package carries the proof_bundle_version field for schema evolution; the Markdown file summarizes each stage and ends with a timeline table. Stages that were never recorded are exported as explicit null and marked as "not recorded", never fabricated.
Optional model selector: Use the model pool you control to select based on task complexity and declared capabilities. This is a transparent routing aid, not a general-purpose cost optimizer. The model pool has tiers (budget/standard/premium) and strength tags; the selector picks automatically. Manual invocation is also supported (API usage). A custom model pool can be created ~/.trinity/model_pool.json. Works for 1, 2, or 10 models, without hardcoding agent names.
When to use it
It applies when you are already using multiple coding agents across multiple terminals and need reliable task handoff, disconnect recovery, independent review, and acceptance trails. It is aimed at "operating the agents you already have," not building agents from scratch.
Limitations
- Trinity Lite does not build agents; it operates the agents you already have.
- It takes a different path from frameworks like LangGraph and CrewAI that build agents from scratch: it does not provide new agent abstractions, but rather targets local AgentOps for the CLIs you are already using.
- The Worktree feature is a v0.6 preview; automatic merging back to the main branch is out of scope, and by default branches are not merged/deleted.
- The model selector does not claim that a universally best or cheapest model exists.
- Requires Python 3.10+.
Differences from frameworks
LangGraph and CrewAI provide primitives for building agents from scratch—graph definitions, role abstractions, and tool wrappers. Trinity Lite starts from the opposite end: Claude Code runs in one terminal, Codex runs in another, and their work needs reliable handoff, recovery, independent review, and acceptance trails. There are no new agent abstractions, just local AgentOps for the CLIs you already use.