fork() for AI agents — snapshot, branch, and merge live agent state.
Project description
ProcessFork
git for AI agents. Snapshot, fork, and merge live LLM sessions in 8 ms.
↑ Replay it locally: asciinema play demo/processfork-demo.cast
Why
You're 4 hours into a refactor with Claude Code. The agent has read 200 files, run 47 tests, opened a database, started a dev server. Then it suggests a destructive change.
Today: lose everything, undo by hand, or restart.
With ProcessFork: pf snapshot → 8 ms → safe. Try 12 alternatives in parallel, merge the winner back, ship the whole session to a teammate.
It's git — snapshot, branch, merge, push, clone — but for live AI agent state.
Highlights
- ⚡ 8 ms snapshots. Full agent state — model + KV-cache + files + tools + reasoning — into one content-addressed
.pfimg. - 🌳 Real fork & merge. 12 parallel attempts share storage automatically (CoW). Merge the winner with a real 3-way diff (files, tools, trace) — git-style
<<<<<<<markers and all. - 🔒 Won't double-send your email. HMAC-chained tool-call ledger; restored agents see prior side-effects as facts, not as actions to re-issue. (ACRFence-resistant.)
- 🤝 Drop-in for Claude Code, LangGraph, OpenInterpreter, vLLM, SGLang, AutoGen, CrewAI.
- 📦 Single binary, MIT, Rust core, Python + TypeScript SDKs. 200+ tests.
Quick start (60 seconds)
# install the CLI:
cargo install processfork # → `pf` on your $PATH
# snapshot a directory:
mkdir /tmp/sandbox && echo "fn main() {}" > /tmp/sandbox/main.rs
pf snapshot --agent-id demo --fs-root /tmp/sandbox
# → sha256:1c2497b0… ⏱ 8 ms
# edit something, snapshot again, see the diff:
echo "fn main() { println!(\"hi\") }" > /tmp/sandbox/main.rs
pf snapshot --agent-id demo --fs-root /tmp/sandbox --name v2
pf log
pf diff <first-cid> <second-cid>
Prefer Python? pip install processfork. TypeScript? npm install @processfork/sdk.
The full 60-second demo (snapshot → fork ×12 → merge → push → clone on a fresh store) is bash demo/script.sh. Runs end-to-end on a laptop. No GPU, no API keys.
When you'd reach for it
| Situation | Command |
|---|---|
| Agent about to do something destructive | pf snapshot pre-rm-rf |
| Stuck — want to try 12 approaches in parallel | pf fork -n 12 --explore "fix bug" |
| Hand a complex session to a teammate | pf push hf://you/session-name |
| Time-travel debug ("when did it go wrong?") | pf log then pf checkout <CID> |
| RL rollout fabric for agent training | snapshot, fan out, score, merge |
Use it with your stack
| Adapter | Status | What it gives you |
|---|---|---|
| Claude Code | ✅ ships now | /snapshot, /fork, /merge slash-commands inside any session |
| LangGraph | ✅ ships now | drop-in BaseCheckpointSaver (full 4-layer, not just state dict) |
| OpenInterpreter | ✅ ships now | interpreter.snapshot("pre-rm-rf") then .checkout("pre-rm-rf") |
| AutoGen | ✅ ships now | atomic snapshot across a whole agent group's state |
| CrewAI | ✅ ships now | CrewMemory drop-in; every step time-travelable |
| vLLM | ✅ ships now | bit-exact KV-cache snapshot/restore (V0 + V1 engine via collective_rpc) |
| SGLang | ✅ ships now | live RadixCache k_buffer/v_buffer capture, mock-mode parity tests |
How it works
ProcessFork captures the five things that together make up a live agent — atomically — into one content-addressed file:
| Layer | What it captures |
|---|---|
| Model | LoRA / IA³ / full-finetune weight diffs, in-place TTT updates |
| Cache | Paged KV-cache, content-addressed per page (CoW across forks) |
| World | Filesystem, env, in-flight subprocesses, browser DOM |
| Effects | Append-only ledger of irreversible tool calls (HMAC-chained) |
| Trace | Chat + tool-call message log |
Identical content shares storage automatically — 12 parallel forks use ~1.5× the space of one, not 12×. The merge engine handles each layer with the right algorithm: git-style 3-way diff for files, TIES + DARE for model weights, an HMAC chain that defends against semantic-rollback attacks (ACRFence), and an LLM-summarized "what branch B learned" patch injected into branch A's reasoning trace without re-prefilling the cache.
→ Architecture deep-dive · Three-way merge protocol · Engineering specs
Status
v1.0.5 tagged. Closes 4 follow-up audit findings (round 3): the npm package now ships its native binary at the package root (was a hard install blocker for @processfork/sdk@≤1.0.5 — first installable npm version is 1.0.6); OpenInterpreter ledger entries now include result_hash; --quiesce-cmd / --resume-cmd give the operator an app-level transaction-boundary hook (paired with --pause-pid for OS-level pause); _pf_py.pyi matches the runtime signature including effects. v1.0.3 security advisories remain in force.
| metric | observed | target |
|---|---|---|
| Snapshot p50, synthetic 4-layer fixture (macOS arm64) | 7.9 ms | < 500 ms p99 |
| Snapshot p50, real GPU host (Modal A10G, 64 × 4 KiB) | 42 ms (warm) | < 500 ms p99 |
| Bit-exact KV-cache replay, vLLM 0.6.6 + TinyLlama-1.1B on A10G | ✅ verified — 38 619 KV pages snapshotted, restored, regenerated text byte-identical | out_a == out_b |
| Cache capture, 64 pages | 531 µs | — |
| 12-fork ÷ 1-fork storage ratio | well < 1.5× | ≤ 1.5× |
| Total tests passing | 200 | — |
Synthetic-fixture numbers come from cargo bench --workspace. GPU numbers come from modal run scripts/gpu-validate-modal.py; raw JSON lives in benchmarks/gpu-validation/ and the breakdown in benchmarks/RESULTS.md. vLLM ≥0.10 (V1 engine, subprocess-worker architecture) is the v1.0.2 milestone — the v1.0.1 adapter targets V0's directly-introspectable CacheEngine.
Install
cargo install processfork # Rust CLI (the `pf` binary)
pip install processfork # Python SDK
npm install @processfork/sdk # TypeScript SDK
Per-adapter packages (one each on PyPI):
pip install processfork-claude-code
pip install processfork-langgraph
pip install processfork-openinterpreter
pip install "processfork-vllm[vllm]" # needs CUDA + vllm ≥ 0.10
pip install "processfork-sglang[sglang]" # needs CUDA + sglang ≥ 0.5
pip install "processfork-autogen[autogen]"
pip install "processfork-crewai[crewai]"
Build from source if you want to hack on it:
git clone https://github.com/manav8498/processfork && cd processfork
cargo build --release -p processfork # → target/release/pf
Full build-from-source instructions in docs/install.md. Pre-built wheels cover macOS arm64, Linux x86_64, and Linux aarch64; macOS Intel + Windows wheels arrive in v1.0.1 (operator: same package, just more platforms).
Repo layout
crates/ Rust workspace (10 crates: pf-core, pf-cache, pf-world, pf-effects,
pf-model, pf-merge, pf-registry, processfork (CLI, the `pf` binary), pf-py, pf-ts)
adapters/ 7 first-party integration packages
benchmarks/ PFBench harness + Criterion microbench
docs/ mdBook source (25+ pages)
examples/ 8 self-contained runnable examples
demo/ 60-second demo recording script
Docs
Your first fork (5 min) · 60-second demo · Architecture · Merge protocol · Security model · Performance tuning · Engineering specs
Contributing
PRs welcome. The bar is cargo fmt, cargo clippy --all-targets -- -D warnings, cargo test --workspace, plus a green coverage delta. See CONTRIBUTING.md.
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file processfork-1.0.5-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: processfork-1.0.5-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 771.4 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e96efc33eef0cd97deaf1924f503ec2496c8ba68e1e98b26940cae9c50dc5f85
|
|
| MD5 |
dad0eadeed79c25d09de09cfe60e6eba
|
|
| BLAKE2b-256 |
8898ed71156b62ed20ee3f5711c70e5176f3da0ea714a60f27b0737fb136c6e6
|
Provenance
The following attestation bundles were made for processfork-1.0.5-cp39-abi3-win_amd64.whl:
Publisher:
release.yml on manav8498/processfork
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
processfork-1.0.5-cp39-abi3-win_amd64.whl -
Subject digest:
e96efc33eef0cd97deaf1924f503ec2496c8ba68e1e98b26940cae9c50dc5f85 - Sigstore transparency entry: 1453096643
- Sigstore integration time:
-
Permalink:
manav8498/processfork@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file processfork-1.0.5-cp39-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: processfork-1.0.5-cp39-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef7739c954b5e1856f5b1778f2fb7e673a5fb752292031e0078fc68e3be37a83
|
|
| MD5 |
a4755778432c74524148b56fd4e14296
|
|
| BLAKE2b-256 |
97ab78684ca89b91a8ab12412b6694f154e8fca5c7ac72af2ea4483f53f94444
|
Provenance
The following attestation bundles were made for processfork-1.0.5-cp39-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on manav8498/processfork
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
processfork-1.0.5-cp39-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
ef7739c954b5e1856f5b1778f2fb7e673a5fb752292031e0078fc68e3be37a83 - Sigstore transparency entry: 1453096766
- Sigstore integration time:
-
Permalink:
manav8498/processfork@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file processfork-1.0.5-cp39-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: processfork-1.0.5-cp39-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 979.6 kB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8aef518eb989cc4fc255f47fbd5f01659c7d8892b3ac6c559b3e71a7b866812
|
|
| MD5 |
5ed3365510c418b2f5f95c26c52d73e8
|
|
| BLAKE2b-256 |
075611ab53fdc6f94ae5a9885195a26ffc76f04de50fa38441939166d73942d1
|
Provenance
The following attestation bundles were made for processfork-1.0.5-cp39-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on manav8498/processfork
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
processfork-1.0.5-cp39-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
e8aef518eb989cc4fc255f47fbd5f01659c7d8892b3ac6c559b3e71a7b866812 - Sigstore transparency entry: 1453096880
- Sigstore integration time:
-
Permalink:
manav8498/processfork@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file processfork-1.0.5-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: processfork-1.0.5-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 833.6 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7b98a4f5ff198fe367a330db5316a83cf5e22460c06a7eae419800a445185db
|
|
| MD5 |
a898e18b2e0a56c4bd49776317475b71
|
|
| BLAKE2b-256 |
148b9e0f90699710e1a785a0bfd9c68187ed9f522ba2c3f206897f190bb0e085
|
Provenance
The following attestation bundles were made for processfork-1.0.5-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on manav8498/processfork
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
processfork-1.0.5-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
b7b98a4f5ff198fe367a330db5316a83cf5e22460c06a7eae419800a445185db - Sigstore transparency entry: 1453096914
- Sigstore integration time:
-
Permalink:
manav8498/processfork@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file processfork-1.0.5-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: processfork-1.0.5-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 964.0 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4f4354d17af40bd5d93ac390f69948ca5a5b80e77bce1f44d4f6780b6980bc6
|
|
| MD5 |
d5f5dc4b47e088ce311446065a6f20c8
|
|
| BLAKE2b-256 |
300fddd5889f46289f635416864ea8547c1793df644f61de21a4bc91684ddcb8
|
Provenance
The following attestation bundles were made for processfork-1.0.5-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on manav8498/processfork
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
processfork-1.0.5-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
f4f4354d17af40bd5d93ac390f69948ca5a5b80e77bce1f44d4f6780b6980bc6 - Sigstore transparency entry: 1453096490
- Sigstore integration time:
-
Permalink:
manav8498/processfork@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca78480b69c32cfaaa53d257107166f7ee18c3d3 -
Trigger Event:
push
-
Statement type: