Edge-Cloud Collaborative AI Agent
EdgeClaw: Bringing the Claude Code Experience to OpenClaw
γδΈζ | Englishγ
π Join our community for discussion and support!
What's New π₯
- [2026.04.03] π Three Claude Code-liked features released: π§ ClawXTool launches an 8-in-1 tool suite (including security analysis, secret scanning, git worktrees, etc.), π ClawXSkill releases an intelligent discovery engine (supporting skill search and model judge), and π§ ClawXContext introduces smooth context compaction and dynamic reinjection for long sessions.
- [2026.04.02] π Released three Claude Code-liked features optimized for OpenClaw β π€ ClawXKairos (Self-Driven Agent Loop), π‘οΈ ClawXGovernor (Tool Governance), and π¦ ClawXSandbox (Claude Code-Style Sandbox)
- [2026.04.01] π EdgeClaw 2.0 is officially open-sourced, featuring a brand-new memory engine and cost-saving router β bringing the Claude Code experience to OpenClaw!
- [2026.04.01] π ClawXMemory released β inspired by Claude Code's memory mechanism, it delivers a smoother experience for OpenClaw scenarios with multi-layered structured long-term memory and proactive reasoning!
- [2026.03.25] π ClawXRouter released β 5-tier cost-saving routing + three-tier privacy collaboration + visual Dashboard
- [2026.03.13] π EdgeClaw adds Cost-Aware Collaboration: automatically determines task complexity and matches the most economical cloud model
- [2026.02.12] π EdgeClaw is officially open-sourced β an Edge-Cloud Collaborative AI Agent
EdgeClaw is an Edge-Cloud Collaborative AI Agent jointly developed by THUNLP (Tsinghua University), Renmin University of China, AI9Stars, ModelBest, and OpenBMB, built on top of OpenClaw.
| OpenClaw | Claude Code | EdgeClaw | |
|---|---|---|---|
| Cross-session project knowledge | β | β | β |
| Persistent user preference | β | β | β |
| Multi-layered structured memory | β | β | β |
| Memory integration strategy | Recall | On-demand read | Proactive reasoning |
| Continuous memory consolidation | β | Auto-Dream (backend) | Auto-consolidation on idle & topic switch |
| Cost-aware routing | β | β | 58% cost savings |
| Three-tier privacy collaboration | β | β | S1/S2/S3 |
| Context working set management | β | β | β |
| Tool risk governance & audit | β | β | β |
| Self-driven agent loop | β | β | β |
| Sandboxed execution | β | β | β |
| Intelligent skill discovery | β | β | β |
| Built-in security tool suite | β | β³ | β |
| Virtual pet companion | β | β | β |
| Visual Dashboard | β | β | β |
π Claude Code-Liked Features
- π€ Self-Driven Loop β ClawXKairos: Tick scheduling + Sleep tool + background command automation + async sub-agents, enabling the agent to work autonomously and continuously
- π‘οΈ Tool Governance β ClawXGovernor: Three hook middlewares β context tail-window trimming, tool call risk interception & audit, session note incremental append. Deeply optimized for OpenClaw scenarios, saving 85% tokens over 30 rounds of calls
- π¦ Sandbox Execution β ClawXSandbox: Fully isolated local execution environment based on system-level sandboxing (bwrap / sandbox-exec). Focused on being lightweight, fast, and zero-dependency, completely eliminating all Docker overhead.
- π§ Unified Tool Suite β ClawXTool: 8-in-1 plugin providing 13 tools, covering security audit (bash security analysis, secret scanning), workflow (git worktree management, structured task tracking), development assistance (cron parsing, notebook editing), and agent interaction (memory age annotations, interactive user questions).
- π Skill Discovery β ClawXSkill: Automatically discovers and indexes agent skills across the workspace using BM25 keyword search, optional embedding-based semantic search, and LLM model judge for intelligent skill matching.
- π§ Memory Engine β ClawXMemory: A structured long-term memory engine built for OpenClaw. Building on the ideas behind Claude Code's memory mechanism, it further introduces multi-layered structured memory and model-driven memory retrieval. (v0.1.5)
- π Context Engine β ClawXContext: OpenClaw context engine focused on long-session stability, smooth context compaction, and dynamic reinjection.
- πΎ Virtual Pet Companion β ClawXBuddy: An adorable ASCII virtual pet companion with idle animations, rarity traits, and interactive commands to keep you company.
π₯ Other Core Features
- π° Cost-Saving Router β ClawXRouter: LLM-as-Judge automatically determines complexity, routing 60β80% of requests to cheaper models. Real-world PinchBench testing shows 58% cost savings with scores 6.3% higher.
- π Three-Tier Privacy β S1 direct cloud / S2 desensitized forwarding / S3 fully local processing β sensitive data never leaves the device.
- π Zero Configuration β
pnpm build && node openclaw.mjs gateway run, auto-generates config on first launch, just fill in your API Key. - π Dual Dashboard β ClawXRouter routing config hot-reload + ClawXMemory memory canvas visualization.
EdgeClaw2_ZH_Demo.mp4
git clone https://github.com/openbmb/edgeclaw.git
cd edgeclaw
pnpm install
pnpm buildnode openclaw.mjs gateway runEdgeClaw uses
~/.edgeclaw/as the data directory by default, completely isolated from OpenClaw (~/.openclaw/). To customize the path, set theOPENCLAW_STATE_DIRenvironment variable.
On first launch, a complete configuration skeleton is auto-generated (~/.edgeclaw/openclaw.json + clawxrouter.json), with ClawXRouter and ClawXMemory as bundled extensions β no manual plugin installation required.
The generated config has empty API Keys. Fill them in to get started:
- Edit the config file: Modify the
apiKeyfor each provider undermodels.providersin~/.edgeclaw/openclaw.json - Dashboard hot-reload: Visit
http://127.0.0.1:18790/plugins/clawxrouter/statsand modify directly in the UI β changes take effect immediately
Tip: Setting the
EDGECLAW_API_KEYenvironment variable before launch will auto-fill it.
node openclaw.mjs agent --local --agent main -m "Hello"When you see [ClawXrouter] token-saver: S1 redirect β and an agent reply, the deployment is successful.
| Panel | URL |
|---|---|
| ClawXRouter (routing config & stats) | http://127.0.0.1:18790/plugins/clawxrouter/stats |
| ClawXMemory (memory visualization) | http://127.0.0.1:39394/clawxmemory/ |
Having issues? Check the Troubleshooting Guide
Developers who have used Claude Code know: what truly makes it indispensable isn't how good any single answer is, but that it remembers you β your coding style, project architecture, last week's discussion, even your preferred naming conventions.
ClawXMemory is the first plugin to bring Claude Code-like memory capabilities to the OpenClaw ecosystem.
| Core Memory Capability | Standard OpenClaw | Claude Code | ClawXMemory |
|---|---|---|---|
| Cross-session project knowledge | β | β | β |
| Persistent user preference | β | β | β |
| Multi-layered structured memory | β | β | β |
| Memory integration strategy | Recall | On-demand read | Proactive reasoning |
| Continuous memory consolidation | β | Auto-Dream | Auto-consolidation on idle & topic switch |
The system automatically distills information during conversations, building structured memory layer by layer:
| Memory Layer | Type | Description |
|---|---|---|
| L2 | Project memory / Timeline memory | High-level long-term memory aggregated around specific topics or timelines |
| L1 | Memory fragments | Structured core summaries distilled from concluded topics |
| L0 | Raw conversations | The lowest-level raw message records |
| Global | User profile | A continuously updated global user preference singleton |
When the model needs to recall, it proactively navigates along the "memory tree" through reasoning β first evaluating relevance from high-level memory (project/timeline/profile), drilling down into finer-grained fragments only when needed, and tracing back to specific conversations when necessary. This is closer to how a human expert reasons layer by layer than traditional vector retrieval.
- Automatic memory construction: No manual maintenance needed β automatically distills, aggregates, and updates during conversation
- Model-driven retrieval: Uses reasoning instead of matching, truly understanding vague questions like "How is this project progressing?"
- Memory visualization Dashboard: Canvas view and list view, with memory layers and relationships at a glance
- Local storage, privacy-safe: SQLite by default, data never leaves the device, supports one-click import/export
For detailed documentation, see ClawXMemory README.
ClawXRouter is EdgeClaw's routing brain β the edge perceives data attributes (sensitivity, complexity) while the cloud handles reasoning and generation. Through its Hook mechanism, it automatically intercepts and routes without any changes to business code, serving as a seamless drop-in replacement for OpenClaw.
Most requests involve browsing files, reading code, and simple Q&A β using the most expensive model for these tasks is pure waste. Token-Saver uses LLM-as-Judge to classify requests by complexity, automatically routing them to the most economical model:
| Complexity | Task Examples | Default Target Model |
|---|---|---|
| SIMPLE | Queries, translation, formatting, greetings | gpt-4o-mini |
| MEDIUM | Code generation, single-file editing, email drafting | gpt-4o |
| COMPLEX | System design, multi-file refactoring, cross-doc analysis | claude-sonnet-4.6 |
| REASONING | Mathematical proofs, formal logic, experiment design | o4-mini |
| Approach | Pros | Cons |
|---|---|---|
| Keyword Rules | Fast | No semantic understanding, high false-positive rate |
| LLM-as-Judge | Semantic understanding, multilingual | One additional local model call (~1β2s) |
The Judge runs on a local small model (MiniCPM-4.1 / Qwen3.5), with prompt hash caching (SHA-256, TTL 5 min) to avoid re-judging identical requests. In typical workflows, 60β80% of requests are forwarded to cheaper models.
Every message, tool call, and tool result is inspected in real time and automatically classified into three levels:
| Level | Meaning | Routing Strategy | Example |
|---|---|---|---|
| S1 | Safe | Send directly to cloud model | "Write a poem about spring" |
| S2 | Sensitive | Desensitize then forward to cloud | Addresses, phone numbers, emails |
| S3 | Private | Process locally only | Pay slips, passwords, SSH keys |
Dual Detection Engines: Rule detector (keywords + regex, ~0ms) + Local LLM detector (semantic understanding, ~1β2s) β the two can be combined and stacked.
S2 Desensitized Forwarding:
User Message (containing PII) β Local LLM Detection β S2 β Extract PII β Replace with [REDACTED:*]
β Privacy Proxy β Strip markers β Forward to cloud β Pass through SSE response
S3 Fully Local: Forwarded to the local Guard Agent (Ollama / vLLM); cloud-side history only receives a placeholder.
Dual-Track Memory & Dual-Track Sessions:
~/.edgeclaw/workspace/
βββ MEMORY.md β What the cloud model sees (auto-desensitized)
βββ MEMORY-FULL.md β What the local model sees (complete data)
β
agents/{id}/sessions/
βββ full/ β Complete history (including Guard Agent interactions)
βββ clean/ β Clean history (for cloud model consumption)
The cloud model never sees MEMORY-FULL.md or sessions/full/ β the Hook system intercepts at the file access layer.
The security router and cost-aware router run in the same pipeline, working together via weights and a two-phase short-circuit strategy:
User Message
β
βΌ
RouterPipeline.run()
β
βββ Phase 1: Fast routers (weight β₯ 50) run in parallel
β βββ privacy router β three-tier sensitivity detection
β
βββ Short-circuit: If Phase 1 detects sensitive data β skip Phase 2
β
βββ Phase 2: Slow routers (weight < 50) run on demand
βββ token-saver β LLM Judge complexity classification
Security first β the security router runs first with high weight. If sensitive data is found, it short-circuits immediately. Cost-aware routing kicks in only after the security check passes (S1).
| Hook | Trigger Point | Core Responsibility |
|---|---|---|
before_model_resolve |
Before model selection | Run pipeline β routing decision |
before_prompt_build |
Before prompt construction | Inject Guard Prompt / S2 markers |
before_tool_call |
Before tool invocation | File access guard + sub-agent guard |
after_tool_call |
After tool invocation | Tool result detection |
tool_result_persist |
Result persistence | Dual-track session write |
before_message_write |
Before message write | S3 β placeholder, S2 β desensitized version |
session_end |
Session ends | Memory synchronization |
message_sending |
Outbound message | Detect and desensitize/cancel |
before_agent_start |
Before sub-agent starts | Task content guard |
message_received |
Message received | Observability logging |
For detailed documentation, see ClawXRouter README.
{
"privacy": {
"rules": {
"keywords": {
"S2": ["password", "api_key", "token"],
"S3": ["ssh", "id_rsa", "private_key", ".pem"]
},
"patterns": {
"S2": ["(?:mysql|postgres|mongodb)://[^\\s]+"],
"S3": ["-----BEGIN (?:RSA |EC )?PRIVATE KEY-----"]
},
"tools": {
"S2": { "tools": ["exec", "shell"], "paths": ["~/secrets"] },
"S3": { "tools": ["sudo"], "paths": ["~/.ssh", "~/.aws"] }
}
}
}
}{
"privacy": {
"checkpoints": {
"onUserMessage": ["ruleDetector", "localModelDetector"],
"onToolCallProposed": ["ruleDetector"],
"onToolCallExecuted": ["ruleDetector"]
}
}
}The ClawXRouter pipeline is fully extensible β implement the GuardClawRouter interface to inject custom routing logic:
const myRouter: GuardClawRouter = {
id: "content-filter",
async detect(context, pluginConfig): Promise<RouterDecision> {
if (context.message && context.message.length > 10000) {
return {
level: "S1",
action: "redirect",
target: { provider: "anthropic", model: "claude-sonnet-4.6" },
reason: "Message too long, using larger context model",
};
}
return { level: "S1", action: "passthrough" };
},
};{
"privacy": {
"routers": {
"content-filter": {
"enabled": true,
"type": "custom",
"module": "./my-routers/content-filter.js",
"weight": 40
}
},
"pipeline": {
"onUserMessage": ["privacy", "token-saver", "content-filter"]
}
}
}Edit the Markdown files under extensions/clawxrouter/prompts/ to adjust behavior β no code changes needed:
| File | Purpose |
|---|---|
detection-system.md |
S1/S2/S3 classification rules |
guard-agent-system.md |
Guard Agent behavior |
token-saver-judge.md |
Task complexity classification |
Built-in presets allow one-click switching between local model + cloud model combinations:
| Preset | Local Model | Cloud Model | Use Case |
|---|---|---|---|
vllm-qwen35 |
vLLM / Qwen 3.5-35B | Same (fully local) | Full local deployment, maximum privacy |
minimax-cloud |
vLLM / Qwen 3.5-35B | MiniMax M2.5 | Local privacy detection + cloud primary model |
Custom presets for Ollama, LMStudio, SGLang, and other backends are also supported.
EdgeClaw/
βββ openclaw.mjs # CLI entry point
βββ src/config/
β βββ edgeclaw-defaults.ts # EdgeClaw default config template (auto-seed)
β βββ paths.ts # State directory / port resolution (18790)
β βββ io.ts # Config loading (with auto-seed logic)
βββ scripts/
β βββ deploy-edgeclaw.sh # One-click deployment script
β βββ lib/optional-bundled-clusters.mjs # Build exclusion list (guardclaw)
β
βββ extensions/
β βββ clawxrouter/ # [Built-in] ClawXRouter cost-saving router
β β βββ index.ts # Plugin entry point
β β βββ src/
β β β βββ router-pipeline.ts # Router pipeline (two-phase + weighted merge)
β β β βββ hooks.ts # 13 Hooks
β β β βββ privacy-proxy.ts # HTTP privacy proxy
β β β βββ config-schema.ts # Default config schema
β β β βββ live-config.ts # Config hot-reload
β β β βββ stats-dashboard.ts # Visual Dashboard
β β β βββ routers/
β β β βββ privacy.ts # Privacy router (security)
β β β βββ token-saver.ts # Cost-aware router (cost savings)
β β βββ prompts/ # Customizable prompt templates
β β
β βββ openbmb-clawxmemory/ # [Built-in] ClawXMemory long-term memory
β β βββ src/
β β β βββ index.ts # Plugin entry point
β β β βββ core/ # L0/L1/L2 three-layer memory engine
β β β βββ tools.ts # memory_overview / memory_list / memory_flush
β β βββ ui-source/ # Dashboard frontend
β β
β βββ clawxkairos/ # [Built-in] ClawXKairos self-driven loop
β β βββ index.ts # Plugin entry point
β β βββ src/
β β βββ tick-scheduler.ts # Tick scheduling (agent_end β requestHeartbeatNow)
β β βββ sleep-tool.ts # Sleep tool (controlled hibernation)
β β βββ background-commands.ts # Long command auto-backgrounding
β β βββ async-subagent.ts # Async sub-agents
β β βββ kairos-prompt.ts # Autonomous mode system prompt injection
β β βββ heartbeat-ack-guard.ts # HEARTBEAT_OK interception β forced Sleep
β β
β βββ ClawXSandbox/ # [Built-in] ClawXSandbox system-level sandbox
β β βββ src/
β β β βββ index.ts # Plugin entry point
β β β βββ bwrap-backend.ts # bwrap/sandbox-exec sandbox backend
β β β βββ fs-bridge.ts # File system bridge
β β β βββ config.ts # Sandbox configuration
β β βββ tests/ # Unit tests
β β
# Plugin entry point
β β βββ src/
β β βββ backend.ts # SSH sandbox backend
β β βββ mirror.ts # Local-remote workspace mirroring
β β βββ fs-bridge.ts # File system bridge
β β βββ config.ts # Sandbox configuration
β β
β βββ clawxtool/ # [Built-in] ClawXTool unified tool suite (8-in-1)
β β βββ index.ts # Unified entry (13 tools + hooks)
β β βββ src/ # Tool logic modules
β β βββ cron-parser.ts # Cron expression parsing
β β βββ classifier.ts # Bash command security classification
β β βββ secret-patterns.ts # Secret/key detection patterns
β β βββ notebook.ts # Jupyter notebook read/edit
β β βββ worktree.ts # Git worktree management
β β βββ store.ts # Task persistence store
β β βββ annotate.ts # Memory age freshness labels
β β βββ question-tool.ts # Structured multi-choice questions
β β
β βββ clawxskill/ # [Built-in] ClawXSkill intelligent skill discovery
β β βββ index.ts # Plugin entry point
β β βββ engines/
β β β βββ inverted-index.ts # BM25 keyword search engine
β β β βββ embedding-search.ts # Semantic embedding search
β β β βββ model-judge.ts # LLM-based skill relevance judge
β β βββ watcher.ts # File system skill watcher
β β βββ skill-backup.ts # Skill index backup/restore
β β
β βββ clawxbuddy/ # [Built-in] ClawXBuddy virtual pet companion
β β βββ index.ts # Plugin entry point (ASCII sprites, idle animations)
β β
β βββ guardclaw/ # [Optional] Privacy guard (excluded from build by default)
β β
β βββ clawxgovernor/ # [Built-in] ClawXGovernor tool governance
β βββ index.ts # Unified entry (3 hook middlewares)
β βββ src/
β β βββ assembler.ts # Context trimmer (tail-window / compact / reinjection)
β β βββ tool-governor.ts # Tool call interceptor (risk classification / block / loop detection / audit)
β β βββ session-memory.ts # Session note appender (delta note / lightweight hint injection)
β βββ mcp-server/ # State query interfaces (9 debug tools)
β βββ skills/ # 4 Agent Skills
β
βββ ~/.edgeclaw/ # Runtime state directory (auto-generated)
βββ openclaw.json # Main config (auto-seeded on first launch)
βββ clawxrouter.json # ClawXRouter config (auto-generated)
βββ clawxrouter-stats.json # Token statistics
βββ clawxmemory/ # ClawXMemory SQLite data
βββ clawxgovernor/
β βββ context-state.json # Context engine state
β βββ audit.jsonl # Tool audit logs
β βββ notes/ # Session notes
βββ workspace-main/ # Agent workspace
Thanks to all contributors for their code submissions and testing. We welcome new members to join us in building the edge-cloud collaborative Agent ecosystem!
Contributing workflow: Fork this repo β Submit Issues β Create Pull Requests (PRs)
If this project is helpful to your research or work, please give us a β!
- For technical questions and feature requests, please use GitHub Issues
- OpenClaw β Base AI assistant framework
- MiniCPM β Recommended local detection model
- Ollama β Recommended local inference backend
- ClawXRouter β Edge-Cloud collaborative routing plugin (privacy routing + cost-aware routing + Dashboard)
- ClawXMemory β Multi-layered memory system for long-term context
- ClawXContext β Context engine focused on long-session stability and smoother compaction
- ClawXGovernor β Tool governance (context trimming + tool call interception & audit + session notes), EdgeClaw built-in extension
- ClawXKairos β Self-driven agent loop (tick scheduling + sleep + background commands + async sub-agents)
- ClawXSandbox β Lightweight, zero-dependency isolated execution environment based on system-level sandboxing (bwrap / sandbox-exec)
- ClawXTool β Unified 8-in-1 tool suite (cron, bash security, secret scanning, notebooks, git worktrees, tasks, memory age, user questions)
- ClawXSkill β Intelligent skill discovery with BM25 keyword search, embedding-based semantic search, and LLM model judge
- ClawXBuddy β Virtual pet companion with ASCII sprites, idle animations, and rarity traits
MIT