agent-harness
Skill0 starsChanged 3 months agoMITView on GitHub
Orchestrate external agent CLI harnesses (pi, hermes) in turn-by-turn sessions from within Claude Code. Use when the user wants to delegate tasks to pi or hermes, chain multiple agent turns, compare outputs across harnesses, or build multi-agent workflows where Claude acts as the coordinator.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Cure-Consulting-Group/ProductEngineeringSkillstheir own version, first seen Nov 1, 2026
- netresearch/agent-harness-skilltheir own version, first seen Oct 30, 2026
- vcompagnucci/skillstheir own version, first seen Oct 23, 2026
- berekvolgyipeter/dotclaudetheir own version, first seen Oct 13, 2026
- Hassaan146/claude-skillstheir own version, first seen Jul 25, 2026
- redleafluan/claude-skillstheir own version, first seen Jul 13, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- Hassaan146/claude-skills★ 18same name
- netresearch/agent-harness-skill★ 7same name
- Cure-Consulting-Group/ProductEngineeringSkills★ 3same name
- berekvolgyipeter/dotclaude★ 2same name
- redleafluan/claude-skills★ 0same name
- vcompagnucci/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- adversarial-diff-verifySkill
- agents-md-generatorSkill
- plugin-manifest-referenceSkill
- publish-postSkill
- research-sweepSkill
- workflow-designSkill
- workflow-feature-specSkill
- workflow-monthly-skill-auditSkill
- workflow-stage-draftSkill
- workflow-vault-weeklySkill
- work-trackingSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Use $AGENT_TURN in place of agent-turn throughout all Bash calls in this skill.
- Very specific: line 45
Before sending the first turn, check for a STATE.md in the working directory.
- Distinctive: line 49
Follow this loop until the task is complete or you hit a stop condition:
- Distinctive: line 59
Follow-up → compose next prompt, go to step 1
- Distinctive: line 88
Stop the loop and present results when:
- Distinctive: line 96
After any task that took 4+ turns, write to STATE.md before ending.
- Distinctive: line 106
If STATE.md doesn't exist, create it.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Harness Orchestration
You are orchestrating external agent harnesses (pi, hermes) via the agent-turn wrapper script. You are the coordinator — you decide what prompt to send each turn, read the response, and determine next steps.
Prerequisites
The agent-turn script ships alongside this skill. Resolve it at runtime:
SKILL_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]:-$0}")")"
AGENT_TURN="$SKILL_DIR/agent-turn"Use $AGENT_TURN in place of agent-turn throughout all Bash calls in this skill.
Note on pi sessions: pi uses UUID-based sessions internally. The script maps your human-readable session IDs to pi UUIDs automatically — pass a stable name like
20260512-my-taskand the script handles the rest. Session data lives in/tmp/agent-sessions/pi-sessions/and the name→UUID map in/tmp/agent-sessions/pi-session-map.
Session ID Convention
Generate a stable session ID at the start of a task and reuse it across all turns:
SESSION="$(date +%Y%m%d)-$(echo "$TASK_DESCRIPTION" | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | cut -c1-30)"
echo "$SESSION" # e.g. 20260512-summarize-quarterly-reportStore it in context — you'll need it for every subsequent turn.
Invoking a Turn
"$AGENT_TURN" <tool> <session-id> "<prompt>"
# tool: pi | hermes
# session-id: stable string, reused across turns
# prompt: the message for this turnOutput is printed to stdout and logged to /tmp/agent-sessions/<session-id>.log.
Session Open
Before sending the first turn, check for a STATE.md in the working directory. If it exists, read it and carry Verified facts, General rules, and Last session into context. This is stage 5 (Consult) of the memory progression — skip it and the next session restarts from zero.
Turn-by-Turn Loop
Follow this loop until the task is complete or you hit a stop condition:
- Send turn — call
agent-turnwith the current prompt - Read response — the full output is in stdout
- Evaluate — score the response against the task goal:
- ✓ advances task → continue normally
- △ partial / off-track → note specifically what's missing; compose a targeted corrective prompt
- ✗ stuck (same issue 2+ turns) → pivot: state explicitly what isn't working, then try a structurally different approach (different framing, different constraints, decompose differently)
- Act:
- Done → verify with a separate harness session (new session ID, no shared context with the maker) before presenting to user. A verifier with no exposure to the maker's reasoning finds gaps the maker won't. Self-critique in the same session misses structural errors.
- Follow-up → compose next prompt, go to step 1
- Correction → compose corrective prompt naming the gap and varying the approach, go to step 1
- Switch tools → synthesize context from current log, start new harness session
Switching Between Harnesses
pi and hermes use separate session IDs. To hand off, synthesize the relevant context from the current session log and pass it as part of the first prompt in the new harness:
# Read current session log for context
cat /tmp/agent-sessions/${SESSION}.log
# Start hermes turn with context summary
HERMES_SESSION="${SESSION}-hermes"
"$AGENT_TURN" hermes "$HERMES_SESSION" "Context from prior session: [summary]. Now: [new task]"Reviewing Session History
# Full log for a session
cat /tmp/agent-sessions/<session-id>.log
# Just agent responses
grep -A999 '\[agent\]' /tmp/agent-sessions/<session-id>.logStop Conditions
Stop the loop and present results when:
- The agent's response fully satisfies the original task (confirmed by self-check turn)
- The agent indicates it cannot proceed (escalate to user)
- You've made 3+ corrective turns on the same issue without progress (escalate to user)
- The user has specified a max number of turns
Session Close
After any task that took 4+ turns, write to STATE.md before ending. Five sections, only update what changed:
## Verified facts # things the session stopped guessing about
## General rules # distilled patterns that apply beyond this task
## Open failures # failures investigated but not yet resolved
## Lessons learned # new rules distilled from this session's post-mortems
## Last session # resume pointer — what to do first next sessionIf STATE.md doesn't exist, create it. Write before closing — a session that ends without a write restarts from zero next time.
Skills that surfaced new failure modes or anti-patterns during the session should be updated directly: write the lesson into the Skill file, not just STATE.md. STATE.md is project-scoped; Skill updates travel across projects.
Multi-Agent Pattern (pi + hermes in parallel)
For tasks where you want both harnesses to attempt independently:
# Run both concurrently, capture outputs
PI_OUT=$("$AGENT_TURN" pi "$SESSION-pi" "$PROMPT")
HERMES_OUT=$("$AGENT_TURN" hermes "$SESSION-hermes" "$PROMPT")
# Compare and synthesize
echo "=== pi ===" && echo "$PI_OUT"
echo "=== hermes ===" && echo "$HERMES_OUT"Then synthesize or pick the better response before continuing.
Example Orchestration
Task: Research and summarize recent advances in vector databases
Turn 1 (pi): "List the 5 most significant advances in vector databases in 2025. Be specific — names, benchmarks, capabilities."
→ Response: [list]
Turn 2 (pi): "For each item you listed, identify one concrete use case where it changes what's now possible."
→ Response: [use cases]
Turn 3 (pi): "Synthesize this into a 3-paragraph summary suitable for a technical blog post introduction."
→ Response: [draft]
Evaluate: Draft is good. Present to user.Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

