FREE RESOURCE · FROM THE "HARNESS" REEL
Build an agent harness: a practical Mini Harness guide
By Hammad Yousuf · 8 November 2026
Build an agent harness by tracing the parts of Paweł Huryn’s Mini Harness diagram. Use this guide to explore the software around a model: the loop that runs tools, keeps context and returns control to you.
Your first run
1. Read the project before installing
Open the upstream README, licence and source. Identify the tool runner and permission checks. The goal is to understand the execution path before allowing it to change files.
2. Install with uv
Install uv using its official instructions, then run the upstream install command below. The project uses Python 3.12 or newer.
step 2uv tool install git+https://github.com/phuryn/mini-harness3. Configure your provider privately
Follow the upstream Keys section for the model provider you will use. Store credentials in your local environment or secret manager. Check the provider’s usage limit before the first model call; the installation command alone does not supply API credit.
4. Trace a small first run
Start mini from a disposable project. Ask for a read-only explanation of one file. Watch the proposed tool call, approval decision, result and next model action.
step 4mini5. Test one change and review it
After the read-only run, ask for a small edit in that disposable project. Inspect the proposed action, review the diff and run the relevant check. Try an interruption and confirm that resuming retains the useful task state.
The 15 parts shown in the reel
- Reasoning loop
- Request an action, execute it, return the result, then repeat.
- Tool calls
- Define small operations and useful error responses.
- Context window
- Keep the conversation and tool results available to the next call.
- Saved sessions
- Record events so interrupted work can resume.
- Compaction
- Summarise crowded history while preserving the task.
- Memory
- Keep useful notes outside a single conversation.
- Permission gate
- Decide whether an action may run; this is not a sandbox.
- Permission judge
- Assess the proposed action separately from untrusted content.
- Read-only search
- Find relevant project material without editing it.
- Ask the user
- Resolve a decision when its answer changes the work.
- Subagents
- Give a bounded task its own working context.
- Goal review
- Check the result before declaring the task complete.
- Skills and MCP
- Load task instructions and connect external tools.
- Models and cost
- Track provider calls, usage and spending.
- Chat or headless
- Choose an interactive session or a bounded unattended task.
Review before real work
- Use a throwaway directory and inspect each requested action in the first run.
- Confirm the output with a real test or diff, not the model’s completion message alone.
- Compare harnesses only on the same task and setup; this guide makes no claim that Mini Harness beats another coding agent.
Official links
About the video: The HARNESS reel animates the reference diagram with source credit to Paweł Huryn and phuryn/mini-harness. It has original music and no presenter or cloned voice.
Keep going
- Read the full write-up: Build an agent harness by tracing one small task
- Understand harness engineering before changing the code
- Follow a basic AI agent loop
- Review the agent concepts behind the diagram
- All free resources from the reels
- More free prompts from my reels
- Follow @withhammad.ai on Instagram for the next one
- Subscribe to @with.hammad on YouTube