two-agent-harness
Two-Agent Harness System Setup
This skill installs a complete two-agent development architecture that separates planning from implementation. Based on the research paper "Effective Harnesses for Long-Running Agents", it enables Claude Code to handle complex, multi-session projects with proper progress tracking and state recovery.
System Overview
The two-agent harness creates a workflow where:
- Opus (you) orchestrates and delegates - never implements directly
- Initializer Agent (sonnet) breaks down projects into 200+ trackable features
- Coding Agent (sonnet) implements features one at a time with quality assurance
Auto-Setup Process
To set up the complete two-agent system, execute the setup script:
bash ~/.claude/skills/two-agent-harness/scripts/setup-two-agent-system.sh
This script will automatically:
- Create agent definitions in
~/.claude/agents/ - Install enforcement hooks in
~/.claude/hooks/ - Add reference documentation to
~/.claude/REFRENCE/TWO-AGENT-HARNESS/ - Configure
~/.claude/CLAUDE.mdwith delegation instructions - Validate the installation
What Gets Installed
Agents (~/.claude/agents/)
| Agent | Model | Purpose |
|---|---|---|
initializer-agent |
sonnet | Breaks down complex tasks into feature-list.json with 200+ features |
coding-agent |
sonnet | Implements features systematically, one at a time |
Hooks (~/.claude/hooks/)
| Hook | Event | Action |
|---|---|---|
pre-tool-guard.sh |
PreToolUse | Blocks Opus from editing src/ files, updates heartbeat |
post-tool-guard.sh |
PostToolUse | Reminds about progress updates after code changes |
session-progress-check.sh |
SessionStart | Detects pending features and abnormal exits |
verify-coding-agent.sh |
SubagentStop | Verifies coding-agent updated progress files |
session-end.sh |
SessionEnd | Marks session complete for recovery detection |
Reference Documentation (~/.claude/REFRENCE/TWO-AGENT-HARNESS/)
Nine comprehensive guides covering:
- Framework overview and philosophy
- Agent specifications
- Feature tracking system
- Hook system
- Git integration
- Session workflow
- Testing strategy
- File structure
Post-Installation Usage
Starting a New Project
User: "Initialize this as a new project with comprehensive feature breakdown"
Opus: [Invokes initializer-agent via Task tool]
Result: Creates feature-list.json with 200+ features, init.sh, and progress tracking
Implementing Features
User: "Implement the next feature"
Opus: [Invokes coding-agent via Task tool]
Result: Implements one feature, updates progress, commits changes
Delegation Rules
| Situation | Agent to Use |
|---|---|
| New project, complex breakdown | initializer-agent |
| Implement feature from feature-list | coding-agent |
| Need codebase understanding | Explore (built-in) |
| Quick fix (<5 min), explicit request | Do directly (say "quick fix" or "direct edit") |
Bypass Keywords
When you need to bypass the enforcement hooks, include these keywords in your prompt:
"quick fix"- Single line change"direct edit"- User explicitly requested direct editing"no progress"- No feature-list.json exists yet
Project Progress Files
When a project is initialized, these files are created in .claude/progress/:
feature-list.json- Comprehensive feature breakdown with status trackingsession-state.json- Session state for recovery detectionclaude-progress.txt- Human-readable progress log
Templates
The skill includes templates for new projects in assets/templates/:
feature-list-template.json- Starting point for feature breakdownsession-state-template.json- Initial session stateinit-template.sh- Environment setup script
Troubleshooting
Agents Not Appearing in Task Tool
Verify agents are in ~/.claude/agents/:
ls -la ~/.claude/agents/
Hooks Not Triggering
Check hook configuration in ~/.claude/settings.json and verify hooks are executable:
chmod +x ~/.claude/hooks/*.sh
Recovery After Crash
If a session ended abnormally, the session-progress-check.sh hook will detect it on next startup and prompt you to invoke coding-agent for recovery.
Reference Documentation
For detailed information, see the reference files:
references/two-agent-framework-overview.md- Full system designreferences/initializer-agent-spec.md- Initializer agent detailsreferences/coding-agent-spec.md- Coding agent detailsreferences/hook-system.md- Hook configuration and behaviorreferences/feature-tracking-system.md- Progress tracking detailsreferences/session-workflow.md- Session lifecycle management
More from ingpoc/skills
scroll-storyteller
Use when creating interactive scroll-based storytelling experiences with mouse-following spotlight effects, animated SVG art, and the Anthropic design language. Load for explainer pages, product showcases, visual narratives, or any content needing immersive scroll storytelling with organic shapes and smooth animations. Supports GSAP-powered or lightweight CSS-only animations.
124terminal-ui-design
Use when creating CLI tools, terminal user interfaces (TUI), or any command-line applications. Load for terminal UI design, ASCII art, color schemes, box drawing characters, and polished terminal output. Also use for refactoring boring CLIs into distinctive experiences.
34browser-testing
Use when testing web applications, debugging browser console errors, automating form interactions, or verifying UI implementations. Load for localhost testing, authenticated app testing (Gmail, Notion), or recording demo GIFs. Requires Chrome extension 1.0.36+, Claude Code 2.0.73+, paid plan.
21tufte-slide-design
This skill applies Edward Tufte's data visualization principles from "The Visual Display of Quantitative Information" to create high-impact slides. Use when designing presentations, creating charts/graphs, reviewing slides for clarity, or transforming data into visual displays. Triggers on phrases like "make a slide", "create presentation", "design chart", "visualize data", "review my slides", or "make this more impactful".
20postgresql-skill
This skill provides PostgreSQL-specific patterns for database design, optimization, and transaction management
13token-efficient
Use when processing 50+ items, analyzing CSV/log files, executing code in sandbox, or searching for tools. Load for data processing tasks. Achieves 98%+ token savings via in-sandbox execution, progressive disclosure, and pagination. Supports heredocs for multi-line bash.
12