Three-Layer Agent Collaboration Framework: Hermes → OpenClaw → Claude Code Architecture Explained
What Is a Three-Layer Agent Framework?
When AI Agent tasks become complex, a single Agent often cannot handle them. The three-layer Agent framework vertically layers tasks, with each layer focusing on a different level of abstraction:
┌─────────────────────────────────────────┐
│ Layer 1: Hermes Agent (Communication Layer)│
│ ─ Manage all external communication channels │
│ ─ Feishu/Lark, WhatsApp, WeChat, etc. │
│ ─ Receive instructions, distribute tasks, return results │
├─────────────────────────────────────────┤
│ Layer 2: OpenClaw (Orchestration Layer) │
│ ─ Task understanding, decomposition, scheduling │
│ ─ Manage Claude Code Bridge skills │
│ ─ Skills and tool invocation │
├─────────────────────────────────────────┤
│ Layer 3: Claude Code (Execution Layer) │
│ ─ Code generation, file editing, Shell execution │
│ ─ Git operations, project management │
│ ─ Powered by ModelStudio / DeepSeek │
└─────────────────────────────────────────┘
Layer 1: Hermes Agent (Communication Layer)
Responsibility: Acts as the system's "ears and mouth," managing all external communication.
- Integrate with Feishu/Lark Bot to receive users' natural language instructions
- Support multiple channels: WhatsApp, WeChat, Telegram, etc.
- Parse user intent and pass it to OpenClaw
- Format execution results and return them to the user
Why is a separate layer needed?
Communication logic (message formats, Webhooks, event push) and business logic (task execution) are two entirely different concerns. After separation:
- Changing communication platforms does not affect the core business
- Hermes can connect to multiple channels simultaneously
- The user experience is unified: regardless of which entry point a command is sent from, behavior remains consistent
Layer 2: OpenClaw (Orchestration Layer)
Responsibility: The "brain" of the system, responsible for understanding tasks, breaking down steps, and coordinating resources.
- Receive user intent from Hermes
- Break complex tasks into executable subtasks
- Manage Skills (reusable capability modules)
- Call Claude Code via Claude Code Bridge to execute specific operations
- Maintain contextual memory and cross-task associations
Key Skill: Claude Code Bridge
This is an OpenClaw plugin/Skill that enables OpenClaw to directly operate Claude Code:
User → Hermes → OpenClaw → [Claude Code Bridge] → Claude Code → Execute
The bridge encapsulates Claude Code's CLI interface, enabling OpenClaw to:
- Start Claude Code sessions
- Pass task descriptions
- Read execution results
- Manage multiple parallel Claude Code instances
Layer 3: Claude Code (Execution Layer)
Responsibilities: The system's "hands", actually operating the file system and executing code.
- Read and edit codebases
- Execute shell commands
- Git operations (commit, branch, diff)
- Driven by an LLM (ModelStudio / DeepSeek)
Dual-model configuration strategy:
| Scenario | Model | Reason |
|---|---|---|
| Daily coding | DeepSeek V3 | High cost-effectiveness, strong reasoning |
| Complex refactoring | DeepSeek R1 | Deep reasoning |
| Long context | ModelStudio (Qwen) | Alibaba ecosystem integration |
| Fallback | The two serve as mutual backups | Automatic switching on API failure |
Communication Flow
A complete user request flow:
- The user sends a message in Feishu: "Help me check the latest commit in the OpenClaw project and see if there are any bugs"
- Hermes Agent receives the message and parses the intent → "code review request for OpenClaw"
- Hermes passes the task to OpenClaw.
- OpenClaw breaks it down into:
- Step 1: Start Claude Code through Claude Code Bridge
- Step 2: Use
git logto view recent commits - Step 3: Use
git diffto inspect changes - Step 4: Claude Code analyzes the code
- Step 5: Generate a review report
- OpenClaw aggregates the results and passes them to Hermes.
- Hermes formats them into a Feishu message and returns it to the user.
Design Principles
- Single Responsibility: Each layer does only one thing, and does it well.
- Loose Coupling: Layers communicate through clearly defined interfaces and can be upgraded or replaced independently.
- Fault Tolerance and Isolation: A failure in one layer does not affect other layers. For example, when the Claude Code API is rate-limited, OpenClaw can queue and retry.
- Observability: Each layer has log output, making troubleshooting easier.
Applicable Scenarios
- Personal development assistant (automating daily development tasks)
- Team collaboration (multiple people interact with the Agent through Feishu groups)
- CI/CD enhancement (the Agent participates in code review and deployment decisions)
- Knowledge management (the Agent automatically organizes documents and generates reports)
More in Learn
- Complete LangChain Tutorial 2026: Building Enterprise-Grade LLM Applications from Scratch
- MemoryHub v2.0 System Architecture In-Depth Analysis: From Capture Daemon to MCP Real-Time Memory Capture
- May 2026 LLM API Pricing Landscape: Complete Comparison of DeepSeek, Qwen, GLM, Kimi, MiniMax, and Doubao
- Cross-Channel Memory Hub: A Full Record of the Memory System Architecture Design for OpenClaw Agent