LazyBridge¶
Build Python pipelines with Claude Code and Codex as engines. Swap the engine while keeping tools and application state; let one engine write and the other review. LazyBridge uses one contract: Agent = Engine + Tools + State.
from lazybridge import Agent, ClaudeCodeEngine, CodexEngine, Memory, Session, Store
def project_status() -> str:
"""Return this example project's status."""
return "The draft is ready for review."
state = dict(tools=[project_status], memory=Memory(), store=Store(), session=Session())
claude = Agent(name="claude", engine=ClaudeCodeEngine(), **state)
codex = Agent(name="codex", engine=CodexEngine(), **state)
assert claude.memory is codex.memory
assert claude.store is codex.store
assert claude.session is codex.session
With a subscription login, coding runtimes use the account's plan quota.
The adapters reuse runtime authentication; the configured login can also use
another billing path. Provider APIs remain available through LLMEngine.
Native Claude sessions and Codex threads keep their own history: switching
engines shares Python state, and does not migrate a native transcript.
One writes, the other reviews¶
from lazybridge import Agent, ClaudeCodeEngine, CodexEngine
reviewer = Agent(name="codex-reviewer", engine=CodexEngine(
system='Start with "approved" or "rejected: <reason>". Check boundary cases.',
))
writer = Agent(name="claude-writer", engine=ClaudeCodeEngine(),
verify=reviewer, max_verify=3)
result = writer("Draft a function that blocks weekend deployment.")
print(result.text())
verify= sends the draft and original task to the reviewer, then feeds rejection
back into the next attempt. max_verify counts total attempts. Exhaustion
returns the last draft even if rejected; use tests and explicit acceptance
records before shipping. Opposite-engine review is wired by the caller here.
Claude Code writes, Codex reviews shows the complete pattern and links to repository delegation.
Durable conversations and connected work¶
Use persist_session / session_id for Claude, persist_thread / thread_id
for Codex, or session_alias with a SessionRegistry.
Keep native history distinct from Memory, Store and the observability Session.
LazyTools is the integration layer. Its code bridge supports detached jobs, durable approval tickets, results and tier-based opposite-engine review. Its MCP server exposes coding and project tools; projects hold plans, claims and acceptance evidence. Code computes results and renders schedules; deterministic checks decide whether a result may ship.
Quota routing applies a deterministic tier ladder to available telemetry. The quota routing benchmark is in progress; there are no comparative quality, speed or savings results to report.
Start here¶
- Quickstart: install, call a tool, swap engines and add review.
- Coding agents: engine differences and composition.
- Claude Code and Codex: setup and options.
- Permissions: native controls and approvals.
- Mental model, recipes and reference.
- For LLM assistants: code generation contract and searchable corpus.
- Website and working projects: examples of the connected workflow.
Design and documentation map¶
Engine choice, recursive Tools and optional state keep composition explicit. Use deterministic Plans when control flow should be declared; use model loops when the worker should choose. Type hints derive tool schemas, while Envelopes and opt-in Session/exporters expose results and run evidence.
| Need | Read next |
|---|---|
| Composition and convenience forms | Everything is a tool, progressive complexity, canonical vs sugar |
| Basic contracts | Agent, Tool, Envelope, native tools |
| Application state and quality | Memory, Store, Session, guards, verify=, evals |
| Pipelines and human decisions | Chain, parallel, as tool, HumanEngine, SupervisorEngine |
| Deterministic production work | Plan, Step, sentinels, routing, parallel bands, checkpoint |
| Runtime inspection | Exporters, GraphSchema, OpenTelemetry, Visualizer |
| Extensions and integration boundaries | Engine protocol, BaseProvider, provider catalogue, Plan serialization, multimodal, LazyTools MCP and gateway |
| Choosing and recovering | Decisions, errors, framework comparison, why |
Maturity¶
This documentation targets LazyBridge 1.8.2. The core is Stable; this does not establish a Stable guarantee for every engine or extension. LazyTools 0.10.1 declares Alpha.
| Subsystem | Status | Boundary |
|---|---|---|
Agent, LLMEngine, Tool, Envelope, Plan, Step, sentinels |
Stable | Core public API; breaking changes require a major version. |
Memory, Store, Session, event log, exporters, GraphSchema |
Stable | Persistence and exporters are opt-in; credential redaction is enabled by default. |
| Provider adapters | Stable | Model catalogues and runtime capabilities change independently. |
| Checkpoint/resume and guards | Stable | Checkpoints do not roll back external side effects. |
| Claude Code / Codex engines, native persistence and aliases | Shipped | Runtime-specific permissions, attachments and history; no blanket engine maturity promotion. |
| Approval, delegation and knowledge extensions | Shipped | Generic hooks; application policy remains caller-defined. |
| MCP, code support, code bridge, projects and quota routing | LazyTools Alpha | See the integration-layer docs rather than importing removed core connectors. |
NativeTool, HumanEngine, SupervisorEngine |
Alpha | See the corresponding guides for capability boundaries. |
| Evals and Visualizer | Experimental | Extension APIs may consolidate. |
| Provider fallback-chain tables; automatic PII redaction | Planned | Explicit Agent(fallback=...) works; default redaction masks credentials, not arbitrary personal data. |
See the changelog and migration history for the withdrawn, incompatible April 2026 release numbered 1.0.0.