An efficient, token-optimized orchestration system that coordinates specialized AI agents to complete complex software projects without redundant research or context exhaustion.
"Research once, reuse everywhere."
This system prevents different agents from performing the same research by implementing a file-based memory architecture where research is done ONCE during planning, saved to persistent files, and reused by all implementing agents.
Traditional AI coding workflows suffer from:
- Redundant research - Multiple agents searching for the same information
- Context exhaustion - Token limits hit from repeated documentation lookups
- Lost knowledge - Research done early gets forgotten later
- Inconsistent decisions - Different agents making different architectural choices
Orchestrator (You)
βββ Planning Phase
β βββ task-planner
β βββ task-context-gatherer (for each task)
β βββ research-specialist (Context7/Web)
β βββ Explore (codebase patterns)
β
βββ Implementation Phase
β βββ task-coder (reads research files)
β βββ script-kitty (system operations)
β βββ debug-resolver (error fixing)
β
βββ Documentation Phase
βββ doc-maintainer (function stubs)
βββ historian (checkpoint snapshots)
When agents work on a project, they organize everything under agent_context/:
project_root/
βββ src/ # Your application code
βββ tests/ # Your test files
βββ agent_context/ # Agent workspace (never pollutes your code)
βββ tasks/
β βββ Current_tasks.md # Active task list with status
β βββ TASK1_research.md # Research for task 1
β βββ TASK2_research.md # Research for task 2
β βββ archived/ # Completed/pivoted work
β βββ 2024-11-01_auth/
β βββ Current_tasks.md
β βββ TASK*_research.md
β
βββ context/
β βββ PROJECT_CONTEXT.md # Architectural decisions
β βββ ENVIRONMENT.md # Deployment & infrastructure
β
βββ docs/
βββ UserService.md # Function stubs (not full code)
βββ AuthController.md # Token-efficient documentation
User Request β task-planner β task-context-gatherer
βββ research-specialist (APIs/syntax)
βββ Explore (codebase patterns)
β
TASK1_research.md (saved)
task-coder β Reads TASK1_research.md β Implements β Complete
β
(If more info needed - rare)
β
task-coder β research-specialist/Explore directly β Updates research file
- No redundant Context7 searches - Results cached in TASK{N}_research.md
- No re-reading source code - Function stubs in docs/{file}.md
- Parallel research - Multiple agents can research simultaneously
- Persistent across crashes - File-based system survives interruptions
| Agent | Role | When Called | What It Saves |
|---|---|---|---|
| task-planner | Breaks down features into micro-tasks | Start of any feature | Current_tasks.md, PROJECT_CONTEXT.md |
| task-context-gatherer | Coordinates research for tasks | By task-planner ONLY | TASK{N}_research.md |
| task-coder | Implements production-ready code | For each coding task | Updated files, calls doc-maintainer |
| debug-resolver | Fixes compilation/runtime errors | When errors occur | Fixed code, known issues |
| script-kitty | System operations, deployments | Terminal/cloud tasks | ENVIRONMENT.md, scripts |
| research-specialist | API/syntax documentation | When current info needed | Returns only diffs |
| doc-maintainer | Creates function stub docs | After file changes | docs/{file}.md |
- task-planner is the ONLY agent that calls task-context-gatherer
- task-context-gatherer coordinates research and saves to files
- Implementing agents (task-coder, debug-resolver, script-kitty) read research files
- If more research needed, they call research-specialist/Explore directly
- No stub functions or placeholder code
- No fake credentials or TODO comments
- Complete, working implementations only
Discover need for API key
β
Check ENVIRONMENT.md
β
Check .env files
β
Check task research files
β
Ask script-kitty to check system
β
ONLY if not found β Block and ask user
- Context7 (PRIMARY) - Curated documentation, returns only diffs
- Web Search (SECONDARY) - For recent updates or missing info
- Planning phase - task-planner catches obvious blockers
- Implementation phase - Agents discover runtime blockers
- All blockers - Stop immediately, report to orchestrator
| Traditional Approach | This System | Savings |
|---|---|---|
| Each agent searches docs | Research once, save to file | 80% fewer API calls |
| Re-read full source files | Read function stubs only | 90% fewer tokens |
| Repeat Context7 searches | Cache in research files | 100% elimination |
| Hold research in memory | File-based persistence | Unlimited scale |
git clone https://github.com/Xananthium/claude-code-agents.git
cp claude-code-agents/CLAUDE.md ~/.claude/CLAUDE.md
cp -r claude-code-agents/agents ~/.claude/agents/mkdir -p .claude
cp claude-code-agents/CLAUDE.md .claude/CLAUDE.md
cp -r claude-code-agents/agents .claude/agents/-
Planning Phase
Orchestrator β task-planner: "Plan Stripe integration" task-planner β Creates 8 micro-tasks in Current_tasks.md task-planner β task-context-gatherer for each task task-context-gatherer β Saves Stripe API docs to TASK1_research.md -
Implementation Phase
Orchestrator β task-coder: "Implement TASK1" task-coder β Reads TASK1_research.md (no new research!) task-coder β Implements using saved syntax task-coder β Tests and completes -
Result
- Stripe integrated with zero redundant research
- All agents used the same research files
- Token usage minimal
When a feature is complete OR direction changes:
ARCHIVE_NAME="$(date +%Y-%m-%d)_feature_name"
mkdir -p agent_context/tasks/archived/${ARCHIVE_NAME}/
mv agent_context/tasks/Current_tasks.md agent_context/tasks/archived/${ARCHIVE_NAME}/
mv agent_context/tasks/TASK*_research.md agent_context/tasks/archived/${ARCHIVE_NAME}/This preserves the relationship between tasks and their research for future reference.
- Separation of Concerns - Each agent has one job and does it perfectly
- Write Once, Read Many - Research happens once, gets reused forever
- External Memory - Agents don't hold state, files do
- Progressive Enhancement - Start with planning, research fills in progressively
- Crash Resilient - File-based system survives any interruption
Found a way to make the system even more efficient? PRs welcome!
MIT - Because good orchestration should be free.
Built for Claude Code by developers who believe in never doing the same research twice.