TrueForge: an open-source harness for your agent loop

TrueFoundry's MIT-licensed TrueForge runs the agent loop for you: model calls, MCP tools, skills, sandboxing, approvals and context management.

An agent is a while loop wrapped in four layers of engineering: prompt, context, harness and loop, as @_avichawla laid out on Nov 22, 2026. TrueForge calls itself an open-source agent harness, the code around the model in the thread's terms, but it reaches past that one layer: TrueFoundry's MIT-licensed project runs the agent execution loop, model calls, MCP tools, skills, sandboxing, approvals, context management and session state, and exposes them through a chat UI, an HTTP API with a TypeScript SDK, and an embeddable UI SDK.

Two of the repo's context-engineering features, compaction and large-result offloading, match what the thread recommends for keeping the window lean: summarizing old turns and pushing big blobs to files. The repo also lists subagents, deferred tool loading and Code Mode. Flowtivity's Aug 20 comparison adds that compaction defaults to a 50,000-token threshold, tunable per agent, and that MCP tool schemas load only when a task needs them. TrueForge works with any catalog provider or any OpenAI-compatible endpoint. Skills are git-backed SKILL.md packs loaded on demand in a sandbox, which is Daytona today.

The cost argument rests on TrueFoundry's own benchmark, which the repo says you can reproduce from its benchmark/ folder. Flowtivity reports that on 14 Enterprise-Bench tasks, TrueForge on Opus 4.8 cost $8.50 a run against $11.80 for Claude Managed Agents. Switching TrueForge to GLM-5.2 brought the cost to $2.90. All three runs solved about 11 of 14. Flowtivity calls the benchmark small and vendor-run and says it hasn't verified the figures. Agent 37, which sells competing hosting, says to treat TrueForge's cost numbers as marketing. Its Oct 5 guide still calls TrueForge the closest architectural substitute for Managed Agents' harness, as long as you supply the model keys, a sandbox account and hosting.

Our read: owning the harness pays off when you want to route tasks to cheaper models, which held accuracy in this one small benchmark, or keep execution on your own infrastructure. Agent 37 points out that Managed Agents still wins for zero-infrastructure, bursty workloads. Local mode also has limits: the README says it has no login by default, stores data in a local SQLite file and is not for production or internet-facing use.

Try it: Run npx @truefoundry/trueforge@latest on localhost, connect one model and one MCP server you already use, and rebuild an agent you've been hand-rolling. Then open Sessions and compare its turns, tool calls and tokens on the same task with your own loop's, and check the task still succeeded. Treat a lower token count as one data point, not proof: a short task may never reach the 50,000-token compaction default Flowtivity reports.

Sources