Skip to content
s1 get_emailss2 get_calendars3 get_weathers4 AI · write briefs5 send_message ⚡

JIT compiler for AI agents/ open source · MCP · Apache-2.0

Your agentthinks once.Hotpath runs itforever.

Record an AI agent's tool calls once, drop its mistakes, and replay the task as a workflow that calls AI only where judgment is needed. On our demo tasks: 3–5× faster, ~10× cheaper.

install
git clone https://github.com/mourad-baazi/hotpath && cd hotpath && pnpm install

npm package soon · Node 22+ · Windows, macOS, Linux

calls → steps
8 → 5
mistakes dropped
4
replay on new data
~0.5 s
cheap AI call
1

01 · How it works

Like a JIT compiler, for agent tasks.

A JIT compiler finds the code that runs most often, the hot path, and compiles it. Hotpath does that for the tasks your agent repeats every day.

  1. 01

    Record

    Hotpath sits between your agent and its MCP server as a proxy. Do the task once, the way you already do; every tool call lands in a trace.

    $ hotpath wrap claude-code my-server --task brief
    wrapped “my-server”: records task “brief”
  2. 02

    Compile

    Failed and retried calls are dropped. Your inputs become {{inputs}}, values passed between tools become references, written text becomes one AI step, repeats over a list become a loop.

    $ hotpath compile brief
    compiled 5 steps (dropped 4 failed/retried calls)
  3. 03

    Run

    Tool steps run as plain code. Only the judgment step calls a cheap model. Guards check every result; on drift it falls back to your agent and recompiles.

    $ hotpath run brief --input date=2026-10-02
    ✓ brief in 0.5s, $0.0009 (1 llm call)

02 · What compile keeps

It keeps what worked. It drops the rest.

Agents fumble: a wrong date, a missing argument, a retry. Hotpath reads the whole trace, throws away every failed call, turns your inputs into variables and the text the agent wrote into a single AI step.

  • tool step = plain code
  • AI step = cheap model
  • ⚡ side effect
  • ✗ dropped
traces/brief/2026-10-01.jsonlworkflows/brief.json
  1. get_emailsdate: "today"
    error: invalid date
  2. get_emailsdate: "2026-10-01"date: {{inputs.date}}
  3. get_calendar{}
    error: date is required
  4. get_calendardate: "2026-10-01"date: {{inputs.date}}
  5. get_weathercity: "paris, fr"
    error: unknown city
  6. get_weathercity: "Paris", date: "2026-10-01"city: "Paris", date: {{inputs.date}}
  7. AI stepcheap model writes the brief from s1–s3
  8. send_messageto: "Me"
    error: unknown recipient
  9. send_messageto: "me", text: "Good morning! 3 emails…"to: "me", text: {{steps.s4.output}}⚡
Agent: 8 tool calls, 4 failed, a frontier model on every stepHotpath: 5 steps, 1 cheap AI call, replays in ~0.5s

Illustration of a real recording: Claude Code did the task once with 4 failed calls.

03 · Proof

Recorded Claude Code once. Replayed it on new data.

A real run, not a mockup: Claude Code did a morning brief through Hotpath, made 4 mistakes on the way, and Hotpath kept the 5 steps that mattered. Then the benchmark, agent vs. workflow:

Wall time, secondsagenthotpath
  • morning-brief · same data

    4×

    faster · 10× cheaper

  • morning-brief · new data

    3×

    faster · 10× cheaper

  • weekly-report · same data

    4×

    faster · 13× cheaper

  • weekly-report · new data

    5×

    faster · 12× cheaper

Small demo tasks on Groq, one run each, rate-limit waits excluded, costs from placeholder per-token prices. Full results and limits →

REC · the real recording
Screen recording: Claude Code doing the morning brief through the Hotpath recorder
Claude Code doing the task once, through Hotpath. Everything after this runs without it.

Works with Claude Code, OpenClaw, any stdio MCP server and your own agent.

04 · Features

Almost everything is plain code. One step is AI.

  • 01

    Drops the agent's mistakes

    Wrong arguments, retries and errors stay in the trace and out of the workflow, so a replay never repeats them.

  • 02

    AI only where judgment is needed

    Fetching and sending run as code. A cheap model writes only the parts that need words, grounded in this run's data.

    get_emailsget_calendarget_weatherAI · write the briefsend_message ⚡
  • 03

    Self-heals on drift

    Every result is checked against what was recorded. If a tool changes, Hotpath runs your agent once and recompiles, never after a side effect.

  • 04

    Runs on a schedule

    Cron schedules with @today-style inputs. Safe by default: side effects stay dry-run and the agent isn't started until you allow it.

  • 05

    Loops over lists

    “For each email, open it” compiles into a loop, so the workflow still works when tomorrow's list is longer.

  • 06

    Plain files, local-first

    Traces, workflows and run history are JSON in your folder. Read them, edit them, commit them. Apache-2.0.

    workflows/brief.json
    { "id": "s2", "type": "foreach", "as": "email",
      "over": "{{steps.s1.result.emails}}", "maxItems": 50,
      "body": [{ "id": "s2.1", "type": "tool", "tool": "get_email",
                 "args": { "id": "{{email.id}}" }, "sideEffect": false }] }

05 · Honest limits

Questions, answered straight.

Hotpath is early and says so. Here is what it does, and doesn't do, today.

01Is Hotpath another agent?

No. Your agent (Claude Code, OpenClaw, your own) stays the brain: it figures a task out the first time. Hotpath is the muscle memory: it replays what worked, fast and cheap, and calls the agent back when something changes.

02Which tasks can it compile?

Sequences of tool calls, data passed between them, written text, and loops over a list, through stdio MCP servers. Tasks that branch (if this, do that) aren't compiled yet; they keep running through your agent.

03What happens when a tool or its data changes?

Each step has a guard (the result's shape, and for AI steps the facts the text must mention). A failed guard is drift: Hotpath falls back to your agent for that run and recompiles. If a side effect already ran, it stops instead, so nothing is sent twice.

04Where does my data go?

Nowhere new. Traces, workflows and run history are files in your project folder. AI steps call the OpenAI-compatible provider you configure (Groq, OpenAI, Moonshot, NVIDIA…), and nothing else.

05How mature is it?

Early. The record → compile → run loop, drift fallback, schedules and loops work and are tested; the benchmark covers small demo tasks with a single run each. Read the limits in BENCHMARK.md before relying on the numbers.

06What does it cost?

The CLI is free and open source (Apache-2.0). You pay your model provider for the one cheap AI call per run. Hotpath Cloud, for running tasks without your laptop, will be a paid option.

Hotpath Cloud · coming later

Runs 24/7 without your laptop.

The open-source CLI stays free. Cloud is for when your workflows should keep running while you sleep.

  • Your schedules run 24/7, laptop closed
  • Runs, costs and savings at a glance
  • Alerts on drift and failures, where your team is
  • Share workflows with your team

We store your email, and your answer if you give one, only to tell you when Cloud opens. No tracking, no sharing. Every email has an unsubscribe link; reply to any of them and we delete your data.

Rather follow along on GitHub? Star the repo and watch releases.