Skip to main content
The REPL Handoff pattern bridges interactive planning in a coding assistant (like Claude Code) with autonomous execution in Fabro. You collaborate with an AI in your terminal to produce a plan, then hand it off to a workflow that implements the plan, runs it through multi-model simplification, and verifies the result — all on cloud resources. This pattern is useful when a task is well-understood enough to plan interactively but large enough that you don’t want to babysit the implementation. The human stays in the loop for the creative part (planning) and delegates the mechanical part (coding, testing, reviewing) to an automated pipeline.

When to use this

  • You’ve scoped a feature or fix and can describe the steps in a plan
  • The implementation involves writing code, running tests, and iterating on lint/build failures
  • You want multi-model review (not just the model that wrote the code) before calling it done
  • You’d rather not wait at your terminal while the agent codes — let it run in the background on cloud resources

The workflow

Start → Toolchain → Preflight Compile → Preflight Lint → Implement → Simplify (Opus) → Simplify (Gemini) → Simplify (GPT-54) → Verify → Format → Exit, with Preflight Lint/Fix Lints retry loop, Verify/Fixup retry loop, and early exit from Toolchain and Preflight Compile on failure
implement.fabro

How the handoff works

The key insight is that planning happens interactively and implementation happens autonomously. The workflow’s implement node reads a plan file that you created in your REPL session — it doesn’t generate its own plan.

Step 1: Plan in Claude Code

Use Claude Code’s plan mode to collaborate on an implementation plan. Go back and forth until you’re happy with the steps, file changes, and test strategy:

Step 2: Hand off to Fabro

Once the plan is ready, run the /fabro-implement slash command. This reads your Claude Code plan file and launches a Fabro workflow run:
The command runs:
The --detach flag returns immediately so you get your terminal back. Fabro executes the workflow on cloud resources in the background.

The Claude Code command

To set up the /fabro-implement slash command, create this file:
~/.claude/commands/fabro-implement.md
Claude Code resolves CLAUDE_CODE_PLAN_FILE_PATH to the actual plan file, passes it as the --goal-file to Fabro, and the workflow’s implement node reads that file to know what to build.

How it works

Preflight checks

Before touching any code, the workflow validates the environment:
  1. Toolchain — ensures Rust is installed (installs via rustup if not). Exits immediately if this fails.
  2. Preflight Compilecargo check --workspace confirms the codebase compiles. Exits if it doesn’t — no point implementing against a broken baseline.
  3. Preflight Lintcargo clippy --workspace -D warnings checks for lint warnings. If lints fail, the fix_lints agent fixes them (up to 3 attempts) before proceeding.
This guarantees the implement node starts from a clean, compiling, lint-free codebase.

Implementation

The implement node is the core agent stage. Its prompt is simple:
The agent reads your plan file (passed via --goal-file), then writes code, creates tests, and iterates until all plan steps are complete. The “red/green TDD” instruction means: write a failing test first, then make it pass.

Multi-model simplification

After implementation, the code passes through three independent simplification stages:
Each model runs the same @prompts/simplify.md prompt but brings different strengths. Running the same review prompt across Claude, Gemini, and GPT catches different classes of issues — verbose code one model wrote that another would simplify, edge cases one model spots that others miss, naming improvements that vary by model preference. The models override the graph-level default via per-node model attributes:

Verification and fixup

The verify node runs clippy and the full test suite:
This node has two important attributes:
  • goal_gate=true — the workflow cannot succeed unless verification passes
  • retry_target="fixup" — if verification fails at the exit node, route back to the fixup agent instead of failing immediately
The fixup agent reads the build output and fixes lint warnings and test failures. It loops back to verify, with max_visits=3 as a circuit breaker.

Format

A final cargo fmt --all ensures consistent formatting. This is also a goal gate — unformatted code means the workflow fails.

Adapting for other languages

This workflow is Rust-specific, but the pattern generalizes. Replace the shell commands for your language: The agent stages (implement, simplify, fixup) work with any language — they use the Fabro agent’s standard tools (Read, Write, Edit, Bash) and follow the plan file regardless of language.

Further reading

Multi-Model Workflows

Assigning different models to different workflow nodes.

Failures & Retries

Goal gates, retry targets, max visits, and circuit breakers.

Run Configuration

TOML configs, goal files, and detached runs.

Environments

Running workflows on cloud resources with sandboxed execution.