Skip to main content

etchplan logo

etchplan

Your agent solves the same shape of task again and again. etchplan turns the repeatable parts into validated routines that can replay without model calls, with fallback to the agent whenever a guard does not hold.

Built by Egoist Machines, Inc. - efficient full-stack infrastructure for reliable AI systems.

etchplan watches local agent traces, mines recurring workflows, and compiles the safe ones into deterministic ExecutionPlans. A routine runs only after validation. If the input drifts, a guard fails, or a tool is unbound, the agent handles the request.

  • Zero model calls on a fully compiled replay.
  • Guards, static checks, validation, and mutation gates before any served result.
  • Local capture for Claude Code, Codex, and opencode; traces write to ~/.etchplan/.
  • Shadow, approval, canary, and drift kill-switch before live serving.
  • Append-only audit log for routine decisions, tool calls, and fallbacks.
  • CLI, MCP server, and runnable BYO, MCP, and real-API examples.

What It Is

etchplan removes repeat model calls when a validated tool workflow can replay directly, with the agent still behind the fallback. This is not prompt caching, response caching, observability, or a workflow builder you hand-author. Those are all valid techniques that one can use in combination with etchplan to make model calls cheaper, skip near-duplicates, or help you watch the agent.

etchplan is built for structured tool-call workflows: API/MCP integrations, browser actions, and repeated multi-step work where arguments bind to inputs or earlier tool outputs. Free-text coding churn is mined and usually refused because the arguments are code, shell, or prose instead of stable parameters.

Reference points: Agent JIT Compilation and Agent Workflow Optimization / meta-tools. The comparison notes are in RELATED_WORK.md.

Install

Apache-2.0, local-first, Python >= 3.11.

pip install etchplan        # or: uv tool install etchplan, pipx install etchplan
etch demo                   # the whole offline loop: import, mine, compile, validate, run. No agent, no keys.
etch doctor                 # confirm capture wiring and that etch is on your PATH

Try it with no install at all: uvx etchplan demo. Extras for the parts that need them: etchplan[mcp] (MCP server), etchplan[browser] (Playwright replay), etchplan[desktop] (macOS GUI capture). From source: git clone https://github.com/Egoist-Machines/etchplan && cd etchplan && uv run etch demo.

Use it on your agent

Install capture once and use your agent normally. etch setup runs the Quickstart discovery loop for you: an auto-pipeline captures, mines, and compiles draft routines on every session and turn end, so you never run those steps by hand.

uv run etch setup claude-code --write     # also: codex | opencode
# use your agent; sessions capture to ~/.etchplan/ and the auto-pipeline keeps routines fresh

uv run etch report                        # money and time saved, read from the store the pipeline fills
uv run etch report --format html --open

That auto-pipeline is Quickstart steps 1-3 (import, mine, compile drafts) on a schedule; etch report and etch yield just read what it found. etch doctor checks that capture is installed and events are flowing. etch mcp install registers the MCP server for Claude Code, Claude Desktop, Cursor, Codex, or all supported clients. The full command surface, dry-run behavior, serving modes, and MCP proxy details are in docs/cli.md.

Only serving stays manual, by design (Quickstart steps 4-5): gather agreement with etch run --shadow, approve once the evidence clears your bar, then canary an approved routine. Guard failure, missing binding, runtime error, or drift routes back to the agent.

Example results

Per recurring solve on AppWorld (gpt-5.5), after one agent solve to seed and one compile:

agent, every time etchplan
latency ~116 s ~0.2 s (~580x faster)
cost ~$0.47 $0 (zero model calls)
reuse economics pays full price every time break-even after ~1.07 reuses; ~9x cheaper by the 10th reuse

The heavy live-agent harness behind those numbers is not in this repo. The compact benchmark artifacts are, and each number is labeled measured, recorded, estimated, or assumed. See docs/results.md and docs/benchmark-methodology.md.

The real-API corpora show the same shape on flows:

domain workflow traces result
weather_brief geocode(city) -> forecast -> air_quality 30 3-node, 0 model
ip_weather geoip(ip) -> forecast 18 2-node, 0 model
zip_weather postal(zip) -> forecast 18 2-node, 0 model
github_repo get_repo(slug) -> get_branch 18 2-node, 0 model
word_assoc related(word) -> related(top) 18 2-node, 0 model
pokemon get_pokemon(name) -> get_ability(url) 18 2-node, 0 model

All six compile in the local yield check: 120 traces, 6 recurring workflows, 6 compiled. The traces and scope notes are in examples/real_traces.

Quickstart

The real flow finds the workflows an agent repeats, compiles and validates the safe ones, then serves them behind the agent. Steps 1-3 run as-is on a real public-API corpus shipped in the repo; steps 4-5 bind your own tools and earn a routine the right to serve live.

1. Get traces. The traces can be your agent's (etch setup <harness> --write captures sessions to ~/.etchplan/, see above). To run every step now, import a shipped real-API corpus into the same store:

db=.etchplan.sqlite
uv run etch import jsonl examples/real_traces/weather_brief/traces.jsonl --db $db

2. See what recurs and compiles. etch yield mines the recurring workflows and reports which compile and why the rest refuse. It measures only, it never serves:

uv run etch yield --db $db --min-support 5
#  recurring: 1  ->  compiled: 1   (weather_brief: geocode -> forecast -> air_quality, 0 model calls)

On captured agent traces, etch report turns the same store into money and time saved.

3. Compile and validate a routine. --pattern-id top takes the highest-support pattern that compiles; validation executes the routine over trace-derived cases (measured, not estimated):

uv run etch compile pattern --db $db --pattern-id top --out weather_brief.yaml
uv run etch validate plan weather_brief.yaml --db $db

4. Run it behind your tools, with the agent as fallback. --registry binds the plan's tool names to your callables; any guard failure, unbound tool, or runtime error routes to --fallback, and every call lands in the audit log:

uv run etch run weather_brief.yaml --input in.json \
  --registry your_tools:registry --fallback your_tools:agent --audit audit.jsonl

Runnable end to end with real bindings in examples/byo (plain callables) and examples/mcp (MCP tools plus a policy-gated live mutation).

5. Earn trust before serving live. Nothing serves on day one. Accumulate agreement in shadow, approve once the evidence clears your bar, then canary in; the drift kill-switch pulls a routine whose fallback rate climbs:

uv run etch run weather_brief.yaml --input in.json --registry your_tools:registry --shadow   # serves the agent, records match/mismatch
uv run etch plans approve weather_brief.yaml --min-matches 20 --max-mismatch-rate 0.0
uv run etch run weather_brief.yaml --input in.json --registry your_tools:registry --require-approval --canary --canary-pct 10

Just want to watch the loop once? uv run etch demo runs all of it offline on a bundled example, no agent and no keys.

How It Works

agent traces
    |
    v
 normalize      clean, redact, slot
    |
    v
   mine         find repeats, verify parameter flow, learn guards
    |
    v
  compile       synthesize a guarded ExecutionPlan
    |
    v
  validate      execute on trace-derived replay cases
    |
    v
   run ------>  guards hold: replay with zero model calls
    |
    +  ------>  guard fails: fall back to the agent

The trust loop is draft -> shadow -> approved -> canary -> served. Mutating steps stay behind idempotency and mutation gates, and a routine that fails validation is never run. The package map, guard implementation notes, and deeper diagrams are in docs/architecture.md and docs/security-model.md.

Workload Fit

Workload Fit Why
Repeated API / MCP tool workflows Excellent bindable arguments, data flow between steps, learnable guards
Browser / desktop action loops Preview semantic actions can replay behind the same trust loop
Coding-agent edit loops Refuses by design free-text step arguments do not bind to deterministic routines
One-off tasks No one seed solve plus one compile does not amortize

For natural compile-yield checks on your own traces, see docs/measuring-yield.md. Active forward edges are tracked in docs/roadmap.md.

Docs

License & Security

Apache-2.0, see LICENSE and NOTICE. The open-source code is free to use, including commercially; the "Etchplan" name and logo are trademarks (TRADEMARKS.md), and Apache-2.0 grants no trademark rights. etchplan is local-first: nothing leaves your machine by default.

Enterprise licensing and commercial support are available from Egoist Machines, Inc.: hosted/managed serving, SSO/RBAC, a multi-tenant plan registry, and on-prem / BYOC deployment. Contact sales@egoistmachines.com.

PRs welcome; see CONTRIBUTING.md (commits need a DCO sign-off: git commit -s). Report security issues privately per SECURITY.md, not in public issues. Other bugs and feature requests go to the issue tracker.

Metadata

Release files for etchplan 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for etchplan 0.1.1
File Size Uploaded Provenance Actions
etchplan-0.1.1.tar.gz 1.1 MB With provenance Details for etchplan-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for etchplan 0.1.1
File Interpreter ABI Platform Actions
etchplan-0.1.1-py3-none-any.whl Python 3 none any Details for etchplan-0.1.1-py3-none-any.whl

Total release size: 1.3 MB

Release files / etchplan-0.1.1.tar.gz

Download URL etchplan-0.1.1.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
dff94512b9b33ad7426daa432d63a5ed3fc4abdf3e686522984ed5cc952b532a
BLAKE2b-256 checksum
How to use checksums
d3d9ea9aa073861ffcf88757a18cde9bf5251fb93f5d637eff547c3f0fda63b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Release files / etchplan-0.1.1-py3-none-any.whl

Download URL etchplan-0.1.1-py3-none-any.whl
Size 220.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5794c4153ad1aaf9a5c77258c0cdf3179246270fc094334684cadd7f5e022a36
BLAKE2b-256 checksum
How to use checksums
88058116e7674f64d7e92329cc4e3b1b9ca5b0719d7e1ce81d0fea1312f8ac11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Security for etchplan 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for etchplan-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page