reforge
Make local models frontier-good at your work
Created on 28th September 2026
•
reforge
Make local models frontier-good at your work
The problem reforge solves
Smart contracts shouldn’t force a choice between privacy and performance.
Smart contract teams need powerful AI, but unreleased contracts, unpatched vulnerabilities, and audit findings are sensitive material to share with third-party models. Running a model locally protects that boundary, but a generic local model may struggle with complex contract logic, security checks, and your team’s development practices.
Reforge addresses this by building better harnesses around local models. It uses your team’s development history, invariants, Foundry tests, and resolved audit findings to evolve the instructions, tools, context retrieval, and verification steps that guide the model. Instead of relying on raw model capability, it equips local AI with workflows tailored to your contracts.
The goal: local models that perform on par with frontier models on your specific smart contract workflows, without sending sensitive code to third-party models.
Your best training data is being thrown away
Every session you run in Claude Code, Codex, Cursor, OpenCode or Copilot CLI is a frontier model working on your codebase: your conventions, your build, your bugs, and the corrections you gave it. That is exactly the data you would need to make a small local model good at your work. Today it sits in scattered transcript files and native databases, and then it is gone.
The gap between a local model and a frontier model on your repositories is mostly a data problem and a harness problem, not a model-size problem. reforge closes the data side, and that data is what a better harness is built from.
The harness matters as much as the model
An agent's score comes from the model and the harness around it: the context it is shown, the tools it gets, when it retries, and when it stops. Keep the model fixed and change only the harness, and published results move a lot. On SWE-bench Verified Mini, GPT-5 goes from 12% to 46% and Claude Sonnet 4.5 from 34% to 68% (HAL, via Zhang et al. 2026). On SWE-bench Pro, Claude Opus 4.5 scores 45.9% in a standard scaffold and 55.4% inside Claude Code.
The weights are the same. Only the harness changed. A local model is bottlenecked the same way, and a harness tuned to your repos needs a record of how work on those repos actually goes.
What reforge does
reforge is a desktop app (macOS and Linux) plus a capture collector that turns your day-to-day agent work into a private corpus that belongs to you:
-
Captures every major coding agent from outside its process. Claude Code, Codex, OpenCode, GitHub Copilot CLI, Cursor, OMP and Superset workspaces are read from their own transcripts and stores, on the collector's schedule. A capture failure can never break or slow the session being observed.
-
Records what happened, not just what was said. Each session is folded into friction signals (retry loops, test runs, edited files, idle gaps) and an end-of-session outcome from read-only git probes (files changed, insertions, deletions). That is the signal for which context and which loops actually produced working code.
-
Sealed on your machine. Records are redacted, compressed, then encrypted with a fresh AES-256-GCM key per record, wrapped to your own key. Only the training side, holding that key, can open them.
On-prem by design
The whole stack is infrastructure-as-code, and for the teams we work with we deploy it on their own infrastructure. Capture, storage, keys, training and the resulting model all live inside your boundary. Your sessions are never our data.
Where it goes
The corpus feeds a learning step that turns how frontier agents solved your problems into models and harnesses you run yourself: agents that already know your codebase, private by construction, owned by you rather than rented per token.
Built as joint work with Shine Gupta.
Challenges we ran into
1. Enforcing privacy rules on data the enforcer can't read
This was the design problem that shaped everything else. We had two requirements that pull against each other:
- The component that stores data must not be able to read your work. Prompts, code and tool output are the most sensitive data a team has, and storage is the widest-exposed part of any system.
- That same component must still enforce the rules. Only registered repositories may be collected, and a buggy or malicious client must not be able to write anything else.
If you encrypt everything, storage can't check scope. If storage can read what it checks, it can read your code. We solved it by splitting every record in two:
- A small cleartext envelope carries only what a rule needs: session id, working directory, git remote, timestamp. Every envelope is re-resolved against the registered repos before it is stored, and anything outside them is rejected, whatever the client claims.
- A sealed payload carries the content. It is encrypted on the device with a fresh AES-256-GCM key per record, and that key is wrapped to an RSA-4096 key that only the training role may use to decrypt. The ingest role has no decrypt permission at all, so even a fully compromised ingest service sees ciphertext. It checks only the payload's shape (field lengths, size ceiling) and derives nothing from it.
Two harder cases fell out of this:
- Deciding scope before reading content. For Claude and Codex, the working directory lives in the same JSONL rows as the messages. So the collector reads a bounded number of header rows, pulls out only the identity fields, discards the rows, and checks scope before full parsing starts. An unregistered repo's messages are never parsed into a record.
- Scope that changes after capture. A record can be sealed and queued while a repo is registered, then the repo is removed before it is stored. Because scope is re-checked at ingest, not trusted from the device, that ciphertext is rejected on arrival, and the refusal goes to an audit trail: proof of what was not collected. If scope can't be answered at all, the event is dropped (fail closed).
The cost is that the storage side can never help with anything that needs content, such as search, dedup by text, or previews. We accepted that: everything content-aware lives in the training step, the only thing that holds the key.
2. Capturing from inside the agent was the wrong design
Our first Claude Code integration was a hook running inside Claude's own process. It worked, but any capture bug became the user's bug. We removed it (#80) and moved every provider to one external collector that reads transcripts and native stores from outside. On upgrade the collector unregisters the old hook and skips the time window the hook had already delivered, so nothing is duplicated.
3. Electron's Node couldn't read OpenCode
OpenCode keeps sessions in SQLite, and Electron 33 ships Node 20, which has no node:sqlite. Rather than bundling a native module, the desktop app runs the collector as a separate Node 24 worker. It opens every store read-only with query_only and a short busy timeout, and fails closed on an unknown schema version.
4. Big sessions didn't fit in a batch
Long transcripts and tool outputs were being truncated to fit batch size limits, which throws away the most useful training signal. We now compress before encrypting (#90): text shrinks 5 to 10x, and nothing is cut. Compress-then-encrypt is usually a red flag (CRIME/BREACH), so we checked the threat model: those attacks need an attacker injecting guesses and watching sizes live, and these are offline batches with no such oracle.
5. The same repo, many paths
One repository shows up as many paths: git worktrees, Superset workspaces, clones on different machines. Matching by path missed sessions entirely. We match by git identity (owner/repo from the origin remote) first and path second, and made the git host part of the dedup key (#83) so github.com/a/b and gitlab.com/a/b never merge.
6. Never losing a record
A queue that expires old entries quietly loses data after a long offline stretch. The queue now never drops an identified record, journals every acknowledgement (#58), and on start catches up on every session inside retention, oldest first (#57), instead of only what grows after launch.
Tracks Applied (1)
Local AI, Private AI & User-Owned Data
Cheer Project
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.
