Agentic Workflows & Orchestration
Understanding how AI agents work together to tackle complex tasks
What Are Agentic Workflows?
When you use AI for coding today, you're typically the orchestrator. You decide what to do, ask the AI to do it, review the output, then figure out the next step yourself. Whether that's one prompt or ten chained together, you're driving — deciding what to do and when, managing each step manually.
In an agentic workflow, the AI drives. Given a goal like "add a caching layer," the agent formulates its own plan, uses tools to read files and run commands, checks its work, adjusts course, and loops until the job is done. The shift isn't just automation — it's a change in who's orchestrating. You describe what you want; the agent figures out how.
Every task runs as a quest — a multi-step workflow where Claude researches the codebase, creates a plan, implements with tests, and reviews its own work. Each stage has a clear purpose and a checkpoint before the next one begins.
Why Structure Matters
Giving an AI agent free rein sounds appealing, but in practice it leads to problems. Without structure, agents tend to drift off scope, skip verification steps, and lose track of what they've already done as the conversation grows. The longer an unstructured session runs, the more likely it is to produce sloppy or incomplete work.
The core issue is context window degradation. As a conversation fills up, the AI's ability to reason about earlier content declines. Important instructions from the beginning get buried under thousands of lines of tool output. Structure — phases, checkpoints, compression — counteracts this by keeping the agent focused and the context clean.
Structure is enforced via gates — hard checkpoints between phases that require approval before the agent can proceed. This isn't just a prompt telling the agent to pause; tools are actually blocked at the plugin level until the gate is approved.
Agent Orchestration
When a project has multiple independent tasks, you could run them one at a time. But that's slow. Orchestration is the pattern of having a coordinator agent that manages multiple worker agents in parallel. The coordinator doesn't do the hands-on work itself — it delegates tasks, tracks progress, and routes information between agents.
Think of it like a project manager working with a team of developers. The PM breaks down the project, assigns tasks, checks in on progress, and handles blockers. The developers focus on their individual tasks without needing to coordinate with each other directly.
The coordinator is called Gandalf. It analyzes your task list, spawns quest runners for code tasks and scouts for research questions, routes gate approvals, and tracks progress across all agents — but never writes code itself.
Isolation & Parallel Execution
Running multiple agents in parallel only works if they can't step on each other's work. If two agents edit the same file at the same time, you get conflicts and corruption. Isolation means giving each agent its own workspace so they can operate independently.
Common approaches include separate git branches (but those still share a working directory), containers or VMs (heavyweight), or separate directory copies. The key property is that one agent's file writes never interfere with another's.
Each quest runs in its own git worktree — a full working copy of the repo on its own branch. Multiple quests can modify code simultaneously without merge conflicts, and each produces a clean PR when it's done.
Context Engineering
AI models have a fixed context window — a limit on how much text they can consider at once. As that window fills with conversation history, tool outputs, and file contents, the model's reasoning quality degrades. It starts missing instructions, repeating itself, and making mistakes it wouldn't make with a fresh context.
Context engineering is the practice of managing what goes into the context window and when. Smart workflows compress intermediate results, discard noise (like verbose command output), and carry forward only the essential information between stages. This keeps the AI operating in its "smart zone" throughout a long task.
Between every phase, Fellowship compresses the conversation into a structured checkpoint. This keeps context utilization low and also provides crash recovery — if a session dies mid-task, the checkpoint survives on disk and the next session can resume from where it left off.
Human in the Loop
There's a spectrum of autonomy for AI agents. On one end, fully supervised: the human approves every action. On the other, fully autonomous: the agent runs to completion without any input. Both extremes have problems — full supervision is exhausting, and full autonomy is risky.
The sweet spot is human-on-the-loop. The agent works autonomously through routine steps but surfaces key decisions for human review. You stay in control of the important choices without micromanaging every file edit. The human sets the direction and reviews the plan; the agent handles the execution.
All gates surface to you for approval by default. You can auto-approve specific gates (like Research and Plan) via configuration, so you only review the high-stakes transitions — like the jump from planning to writing code, or from implementation to creating a PR.
Put It Into Practice
These aren't abstract ideas — they're the mechanics behind every Fellowship quest. If you want to see them in action, get started with your first task.