👾 下一代透明智能体架构 | Next-Gen Transparent Agent Architecture 🔍 全行为审计 | 🛡️ 两段式安全调用 | 🧠 双水位记忆 | ⏰ 心跳任务 📊 P0 级事故率降低 80% | 兼容 OpenClaw + Claude Code 技能生态
329
stars
13
commits
Python
primary language
Sep 10, 2026
updated

下一代透明智能体架构 · Next-Gen Transparent Agent Architecture
English Nav: Quick Start · Core Capabilities · Architecture · Examples
🤖 你的 AI 在背着你做什么?CyberClaw 让所有行为无所遁形
💡 灵感来源:受 OpenClaw 的启发,CyberClaw 专注于解决 AI 智能体的透明度和可控性问题。
CyberClaw 是一个企业级透明可控智能体,重新定义 AI 系统的可信边界:
CyberClaw 支持OpenClaw 技能和Claude Code 技能,可直接使用两个生态系统的丰富技能资源,无需重新开发。
| 能力 | 说明 | 优势 |
|---|---|---|
| 🧠 双水位记忆 | 长期画像 + 短期摘要,持续学习用户偏好 | 越用越懂你,避免重复询问 |
| 🔍 全行为审计 | 5 类事件实时审计,JSONL 日志 + Rich 监控终端 | 告别黑箱,所有决策可追溯 |
| 🛡️ 零信任执行 | help → run 两段式调用,先看说明书再执行 | P0 级事故率降低 80%(50% → 10%) |
| ⏰ 心跳任务引擎 | 后台独立进程,自动执行定时任务 | 解放双手,复杂任务自动化 |
| 🖥️ 跨平台支持 | Unix + Windows 双平台自适应,LLM 自主选择命令 | 一套代码,全平台运行 |
双水位记忆系统
user_profile.md):用户偏好、职业、特殊要求两段式技能调用
mode='help':查看完整说明书(SKILL.md)mode='run':执行具体操作透明监控系统
llm_input, tool_call, tool_result, ai_message, system_actiontail -f 实时监控心跳任务系统
跨平台路径拦截
..、绝对路径、用户主目录访问office/ 工位内Shell 命令安全
-y 等参数)/ 和 \ 路径分隔符| 工具 | 功能 | 示例 |
|---|---|---|
get_current_time | 获取当前时间 | "现在几点了?" |
calculator | 数学计算器 | "25 乘以 48 等于多少" |
schedule_task | 定时任务/闹钟 | "每天早上 8 点提醒我喝水" |
list_scheduled_tasks | 查看任务列表 | "我都有哪些任务" |
delete_scheduled_task | 删除任务 | "取消明天的会议提醒" |
modify_scheduled_task | 修改任务 | "把 8 点的会议改成 9 点" |
get_system_model_info | 获取模型信息 | "你是什么模型" |
save_user_profile | 更新用户画像 | "记住我喜欢喝冰美式" |
list_office_files | 列出文件 | "看看 office 里有什么" |
read_office_file | 读取文件 | "读取 readme.txt" |
write_office_file | 写入文件 | "创建 test.py" |
execute_office_shell | 执行 Shell 命令 | "运行 python test.py" |
workspace/office/skills/ 目录skill-creator:用自然语言让 CyberClaw 自己创建技能skill-vetter:检查技能的安全性mcporter:连接外部 MCP (Model Context Protocol) 服务mcp-builder:构建自己的 MCP 服务tavily-search:AI 优化网络搜索weather:天气查询# 克隆项目
git clone https://github.com/ttguy0707/CyberClaw.git
cd CyberClaw
# 安装依赖并注册命令行工具(一步完成)
pip install -e .
💡 推荐使用虚拟环境:
# 创建虚拟环境 python3 -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate # 安装项目(会自动安装 requirements.txt 中的依赖) pip install -e .安装完成后,即可在任意目录使用
cyberclaw命令。
有两种配置方式:自动配置向导(推荐)或 手动配置。
# 启动交互式配置向导
cyberclaw config
配置向导会引导你:

# 复制示例配置文件
cp .env.example .env
# 编辑配置文件
vim .env # 或使用你喜欢的编辑器
编辑 .env 文件,配置必要的参数:
# 模型提供商
DEFAULT_PROVIDER=aliyun
DEFAULT_MODEL=glm-5
# API Key (根据提供商选择对应的 Key)
OPENAI_API_KEY=sk-your-api-key-here
# Base URL (可选,使用代理时配置)
OPENAI_API_BASE=https://coding.dashscope.aliyuncs.com/v1
配置说明:
DEFAULT_PROVIDER: 模型提供商 (openai, anthropic, aliyun, tencent, z.ai, ollama)DEFAULT_MODEL: 模型名称 (如 gpt-4o-mini, glm-5, qwen-max)OPENAI_API_KEY: OpenAI 或兼容接口的 API KeyANTHROPIC_API_KEY: Anthropic 的 API KeyOPENAI_API_BASE: 兼容接口的 Base URL(阿里云、腾讯云等)OLLAMA_BASE_URL: Ollama 本地服务地址(默认 http://localhost:11434)💡 工作区配置:工作区路径已在代码中初始化,默认为项目根目录的
workspace文件夹,无需在.env中配置。仅当需要自定义工作区位置时,才设置CYBERCLAW_WORKSPACE环境变量。
💡 提示:配置完成后,可运行
cyberclaw run聊天测试连接是否正常。
# 启动主程序
cyberclaw run

启动后进入交互式对话界面,如图所示:

常用命令示例:
| 类型 | 命令示例 | 说明 |
|---|---|---|
| ⏰ 时间查询 | 现在几点了? | 获取当前时间 |
| 🧮 数学计算 | 帮我算一下 25 乘以 48 | 调用计算器工具 |
| ⏲️ 定时任务 | 每天早上 8 点提醒我喝水 | 创建循环任务 |
| 📋 查看任务 | 我都有哪些任务 | 查看任务列表 |
| ✏️ 修改任务 | 把 8 点的喝水提醒改成 9 点 | 修改已有任务 |
| ❌ 删除任务 | 取消明天的会议提醒 | 删除任务 |
| 📁 文件操作 | 看看 office 里有什么文件 | 列出工位文件 |
| 📖 读取文件 | 读取 readme.txt | 读取文件内容 |
| 📝 创建文件 | 创建 test.py | 写入新文件 |
| 💻 Shell 命令 | 运行 python test.py | 执行 Shell 命令 |
| 🚪 退出 | /exit | 退出程序 |
CyberClaw 内置心跳任务系统(Heartbeat),自动在后台执行定时任务:
workspace/tasks.json,重启不丢失cyberclaw monitor 可查看任务执行日志心跳任务示例:
# 创建循环任务
> 每天早上 8 点提醒我喝水
✅ 任务已加入队列 | 循环模式:daily | 首发时间:2026-04-07 08:00:00
# 心跳系统会在每天 8:00 自动触发提醒
💡 提示:心跳任务在后台运行,即使不启动主程序也会执行(需单独运行心跳进程)。
在另一个终端运行:
cyberclaw monitor


架构说明:
| 模块 | 文件 | 功能 |
|---|---|---|
| Agent 循环 | cyberclaw/core/agent.py | LangGraph StateGraph,决策大脑 |
| 技能加载 | cyberclaw/core/skill_loader.py | 动态加载 SKILL.md,两段式调用 |
| 上下文管理 | cyberclaw/core/context.py | 消息修剪,双水位记忆 |
| 内置工具 | cyberclaw/core/tools/builtins.py | 时间/计算/任务调度等 |
| 沙盒工具 | cyberclaw/core/tools/sandbox_tools.py | 文件操作 + Shell 执行 |
| 审计日志 | cyberclaw/core/logger.py | JSONL 格式事件记录 |
| 心跳任务 | cyberclaw/core/heartbeat.py | 定时任务检查与触发 |
CyberClaw/
├── cyberclaw/ # 核心包
│ ├── core/
│ │ ├── agent.py # Agent 循环
│ │ ├── config.py # 配置管理
│ │ ├── context.py # 上下文修剪
│ │ ├── provider.py # LLM 提供商适配
│ │ ├── skill_loader.py # 动态技能加载
│ │ ├── logger.py # 审计日志
│ │ ├── heartbeat.py # 心跳任务
│ │ └── tools/
│ │ ├── base.py # 工具装饰器
│ │ ├── builtins.py # 内置工具
│ │ └── sandbox_tools.py # 沙盒工具
│ └── __init__.py
├── workspace/
│ ├── office/ # 沙盒工位
│ │ ├── skills/ # 可插拔技能
│ │ │ ├── weather/
│ │ │ ├── skill-creator/
│ │ │ └── ...
│ │ └── .env # 环境变量
│ ├── memory/
│ │ └── user_profile.md # 用户长期画像
│ ├── state.sqlite3 # 对话历史数据库
│ └── tasks.json # 定时任务队列
├── logs/
│ └── local_geek_master.jsonl # 审计日志
├── docs/ # 文档与架构图
│ ├── architect.png # 系统架构图
│ ├── monitor.png # 监控终端截图
│ ├── welcome.png # 欢迎界面
│ ├── chat.png # 聊天界面
│ ├── config.png # 配置向导
│ ├── memory.png # 记忆系统
│ └── context_cut.png # 上下文裁剪
├── entry/
│ ├── main.py # 主程序入口
│ ├── cli.py # CLI 配置向导
│ └── monitor.py # 监控终端
├── tests/ # 测试套件
│ ├── test_agent.py
│ ├── test_builtins.py
│ ├── test_two_phase_skills.py # 两阶段测试
│ └── logs/ # 测试报告
├── setup.py
├── .env # 环境配置(运行时创建)
├── .env.example # 环境配置示例(复制此文件开始配置)
└── README.md
.env 文件:主配置文件,包含 API Key、模型设置等敏感信息。
.env.example 文件:配置模板,包含所有可用配置项的说明和示例值。
首次使用时,复制示例文件并修改:
cp .env.example .env
详细配置说明见 快速开始 - 配置 部分。
方法 1:直接复制
cp -r /path/to/skill workspace/office/skills/
方法 2:使用 skill-creator
# 先安装 skill-creator 技能
cd workspace/office/skills
git clone https://github.com/.../skill-creator.git
# 然后用自然语言让 CyberClaw 创建新技能
> 帮我创建一个查询比特币价格的技能
方法 3:使用 skill-vetter 检查安全性
# 安装 skill-vetter
cd workspace/office/skills
git clone https://github.com/.../skill-vetter.git
# 让 CyberClaw 检查技能安全性
> 帮我检查一下 weather 技能是否安全
每个技能包含 SKILL.md:
---
name: weather
description: 获取天气预报
---
# Weather Skill
## 功能
获取全球城市的实时天气预报。
## 命令示例
```bash
curl "wttr.in/Beijing?format=3"
```
## 参数
- 城市名(必填)
- 天数(可选)
# 单次任务
> 明天早上 9 点叫我起床
# 循环任务
> 每天早上 8 点提醒我喝水
> 每周一上午 10 点开团队会议
# 查看任务
> 我都有哪些任务
# 修改任务
> 把 8 点的喝水提醒改成 9 点
# 删除任务
> 取消明天的会议提醒
在另一个终端运行:
cyberclaw monitor
实时查看:
# 实时监控
tail -f logs/local_geek_master.jsonl
# 搜索特定事件
grep "tool_call" logs/local_geek_master.jsonl | tail -20
编辑 workspace/memory/user_profile.md:
# 用户档案
- **姓名**: Thor Allen
- **职业**: 程序员
- **偏好**:
- 喜欢喝冰美式咖啡
- 常用 Python 写代码
- 每天 8 点起床
- **特殊要求**:
- 回答要简洁
- 不要使用表情符号

user_profile.md Markdown 文件,存储用户偏好、职业、特殊要求
当对话轮次超过阈值时:

每个完整回合包含:
# 运行所有测试
python3 -m pytest tests/ -v
# 运行特定测试
python3 tests/test_two_phase_skills.py
# 运行两阶段测试
python3 -c "from tests.test_two_phase_skills import run_tests; run_tests()"
| 测试文件 | 测试内容 | 状态 |
|---|---|---|
test_agent.py | Agent 循环 | ✅ 通过 |
test_builtins.py | 内置工具 | ✅ 通过 |
test_context.py | 上下文修剪 | ✅ 通过 |
test_sandbox_tools.py | 沙盒工具 | ✅ 通过 |
test_two_phase_skills.py | 两阶段调用 | ✅ 通过 |
test_heartbeat.py | 心跳任务 | ✅ 通过 |
根据 tests/logs/test_two_phase_skills.md 的实验数据:
| 指标 | 单阶段 | 两阶段 | 提升 |
|---|---|---|---|
| 安全命中率 | 50.0% | 90.0% | +40% |
| P0 级事故率 | 50.0% | 10.0% | -80% |
| 平均决策耗时 | 19.33s | 23.88s | +23.5% |
结论:两阶段架构用 23.5% 的时间开销,换来了事故率从 50% 暴降至 0%(实际破坏性执行为 0)。
欢迎提交 Issue 和 Pull Request!
# 克隆项目
git clone https://github.com/ttguy0707/CyberClaw.git
cd CyberClaw
# 创建虚拟环境
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 安装开发依赖
pip install -e ".[dev]"
feat: 新功能fix: 修复 bugdocs: 文档更新style: 代码格式refactor: 重构test: 测试相关chore: 构建/工具MIT License
👾 CyberClaw · 下一代透明智能体架构
Made with ❤️ by @ttguy0707
🤖 What is your AI doing behind the scenes? CyberClaw makes every action visible.
💡 Inspired by OpenClaw, CyberClaw focuses on transparency and controllability for AI agents.
CyberClaw is an enterprise-grade transparent and controllable agent that redefines the trust boundary of AI systems:
help -> run) lets the agent read instructions before execution, reducing P0 incident risk by 80%CyberClaw supports both OpenClaw skills and Claude Code skills, so you can reuse rich skill resources from both ecosystems without rebuilding them.
| Capability | Description | Benefit |
|---|---|---|
| 🧠 Dual-watermark memory | Long-term profile + short-term summaries that continuously learn user preferences | Understands you better over time and avoids repeated questions |
| 🔍 Full behavior auditing | 5-category real-time event auditing, JSONL logs, and a Rich monitoring terminal | No more black boxes; every decision is traceable |
| 🛡️ Zero-trust execution | help -> run two-phase calls that read the manual before execution | Reduces P0 incident risk by 80% (50% -> 10%) |
| ⏰ Heartbeat task engine | Independent background process for scheduled tasks | Automates complex and repetitive tasks |
| 🖥️ Cross-platform support | Adaptive support for Unix and Windows, with LLM-selected commands | One codebase runs across platforms |
Dual-watermark memory system
user_profile.md): user preferences, occupation, and special requirementsMAX_TURNS turns and keeps the latest KEEP_TURNS turnsTwo-phase skill invocation
mode='help': read the full instruction file (SKILL.md)mode='run': execute the concrete operationTransparent monitoring system
llm_input, tool_call, tool_result, ai_message, system_actiontail -f real-time monitoringHeartbeat task system
Cross-platform path interception
.., absolute paths, and user home directory accessoffice/ workspaceShell command safety
-y when needed/ and \ path separators| Tool | Function | Example |
|---|---|---|
get_current_time | Get the current time | "What time is it now?" |
calculator | Math calculator | "What is 25 times 48?" |
schedule_task | Scheduled tasks and alarms | "Remind me to drink water every morning at 8" |
list_scheduled_tasks | List tasks | "What tasks do I have?" |
delete_scheduled_task | Delete a task | "Cancel tomorrow's meeting reminder" |
modify_scheduled_task | Modify a task | "Move the 8 o'clock meeting to 9" |
get_system_model_info | Get model information | "What model are you?" |
save_user_profile | Update user profile | "Remember that I like iced Americano" |
list_office_files | List files | "Show me what is in office" |
read_office_file | Read a file | "Read readme.txt" |
write_office_file | Write a file | "Create test.py" |
execute_office_shell | Run a shell command | "Run python test.py" |
workspace/office/skills/skill-creator: create skills with natural language through CyberClawskill-vetter: check skill safetymcporter: connect external MCP (Model Context Protocol) servicesmcp-builder: build your own MCP servicestavily-search: AI-optimized web searchweather: weather lookup# Clone the project
git clone https://github.com/ttguy0707/CyberClaw.git
cd CyberClaw
# Install dependencies and register the CLI in one step
pip install -e .
💡 Virtual environment recommended:
# Create a virtual environment python3 -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate # Install the project. Dependencies from requirements.txt are installed automatically. pip install -e .After installation, the
cyberclawcommand is available from any directory.
There are two configuration methods: the automatic setup wizard (recommended) and manual configuration.
# Start the interactive configuration wizard
cyberclaw config
The wizard guides you through:

# Copy the example configuration file
cp .env.example .env
# Edit the configuration file
vim .env # Or use your preferred editor
Edit .env and configure the required parameters:
# Model provider
DEFAULT_PROVIDER=aliyun
DEFAULT_MODEL=glm-5
# API Key. Choose the corresponding key for your provider.
OPENAI_API_KEY=sk-your-api-key-here
# Base URL. Optional; configure it when using a proxy or compatible endpoint.
OPENAI_API_BASE=https://coding.dashscope.aliyuncs.com/v1
Configuration reference:
DEFAULT_PROVIDER: model provider (openai, anthropic, aliyun, tencent, z.ai, ollama)DEFAULT_MODEL: model name, such as gpt-4o-mini, glm-5, or qwen-maxOPENAI_API_KEY: API key for OpenAI or compatible APIsANTHROPIC_API_KEY: Anthropic API keyOPENAI_API_BASE: Base URL for compatible APIs such as Alibaba Cloud or Tencent CloudOLLAMA_BASE_URL: local Ollama service URL, defaulting to http://localhost:11434💡 Workspace configuration: the workspace path is initialized in code and defaults to the
workspacefolder in the project root. You do not need to configure it in.env. Set theCYBERCLAW_WORKSPACEenvironment variable only when you need a custom workspace path.
💡 Tip: after configuration, run
cyberclaw runto test whether chat connectivity works.
# Start the main program
cyberclaw run

After startup, CyberClaw enters the interactive chat interface:

Common command examples:
| Type | Example Command | Description |
|---|---|---|
| ⏰ Time query | What time is it now? | Get the current time |
| 🧮 Math | Calculate 25 times 48 | Use the calculator tool |
| ⏲️ Scheduled task | Remind me to drink water every morning at 8 | Create a recurring task |
| 📋 List tasks | What tasks do I have? | View the task list |
| ✏️ Modify task | Move the 8 o'clock water reminder to 9 | Modify an existing task |
| ❌ Delete task | Cancel tomorrow's meeting reminder | Delete a task |
| 📁 File operations | Show me the files in office | List workspace files |
| 📖 Read file | Read readme.txt | Read file content |
| 📝 Create file | Create test.py | Write a new file |
| 💻 Shell command | Run python test.py | Execute a shell command |
| 🚪 Exit | /exit | Exit the program |
CyberClaw includes a heartbeat task system that automatically executes scheduled tasks in the background:
workspace/tasks.json and survive restartscyberclaw monitor to view task execution logsHeartbeat task example:
# Create a recurring task
> Remind me to drink water every morning at 8
✅ Task added to queue | Recurrence: daily | First run: 2026-04-07 08:00:00
# The heartbeat system triggers the reminder at 8:00 every day
💡 Tip: heartbeat tasks run in the background and can execute even when the main program is not running, as long as the heartbeat process is started separately.
Run this in another terminal:
cyberclaw monitor


Architecture overview:
| Module | File | Function |
|---|---|---|
| Agent loop | cyberclaw/core/agent.py | LangGraph StateGraph and decision engine |
| Skill loading | cyberclaw/core/skill_loader.py | Dynamically loads SKILL.md with two-phase invocation |
| Context management | cyberclaw/core/context.py | Message trimming and dual-watermark memory |
| Built-in tools | cyberclaw/core/tools/builtins.py | Time, calculation, task scheduling, and more |
| Sandbox tools | cyberclaw/core/tools/sandbox_tools.py | File operations and shell execution |
| Audit logging | cyberclaw/core/logger.py | JSONL event logging |
| Heartbeat tasks | cyberclaw/core/heartbeat.py | Scheduled task checking and triggering |
CyberClaw/
├── cyberclaw/ # Core package
│ ├── core/
│ │ ├── agent.py # Agent loop
│ │ ├── config.py # Configuration management
│ │ ├── context.py # Context trimming
│ │ ├── provider.py # LLM provider adapters
│ │ ├── skill_loader.py # Dynamic skill loading
│ │ ├── logger.py # Audit logging
│ │ ├── heartbeat.py # Heartbeat tasks
│ │ └── tools/
│ │ ├── base.py # Tool decorator
│ │ ├── builtins.py # Built-in tools
│ │ └── sandbox_tools.py # Sandbox tools
│ └── __init__.py
├── workspace/
│ ├── office/ # Sandbox workspace
│ │ ├── skills/ # Pluggable skills
│ │ │ ├── weather/
│ │ │ ├── skill-creator/
│ │ │ └── ...
│ │ └── .env # Environment variables
│ ├── memory/
│ │ └── user_profile.md # Long-term user profile
│ ├── state.sqlite3 # Conversation history database
│ └── tasks.json # Scheduled task queue
├── logs/
│ └── local_geek_master.jsonl # Audit logs
├── docs/ # Documentation and diagrams
│ ├── architect.png # System architecture diagram
│ ├── monitor.png # Monitoring terminal screenshot
│ ├── welcome.png # Welcome screen
│ ├── chat.png # Chat interface
│ ├── config.png # Configuration wizard
│ ├── memory.png # Memory system
│ └── context_cut.png # Context trimming
├── entry/
│ ├── main.py # Main program entry
│ ├── cli.py # CLI configuration wizard
│ └── monitor.py # Monitoring terminal
├── tests/ # Test suite
│ ├── test_agent.py
│ ├── test_builtins.py
│ ├── test_two_phase_skills.py # Two-phase tests
│ └── logs/ # Test reports
├── setup.py
├── .env # Runtime environment configuration
├── .env.example # Example environment configuration
└── README.md
.env file: the main configuration file that contains sensitive information such as API keys and model settings.
.env.example file: configuration template with descriptions and example values for all available options.
For first-time setup, copy the example file and modify it:
cp .env.example .env
See Quick Start - Configuration for detailed configuration instructions.
Method 1: Direct copy
cp -r /path/to/skill workspace/office/skills/
Method 2: Use skill-creator
# Install the skill-creator skill first
cd workspace/office/skills
git clone https://github.com/.../skill-creator.git
# Then ask CyberClaw to create a new skill with natural language
> Create a skill for querying Bitcoin prices
Method 3: Use skill-vetter for safety checks
# Install skill-vetter
cd workspace/office/skills
git clone https://github.com/.../skill-vetter.git
# Ask CyberClaw to check skill safety
> Check whether the weather skill is safe
Each skill contains a SKILL.md file:
---
name: weather
description: Get weather forecasts
---
# Weather Skill
## Function
Get real-time weather forecasts for cities worldwide.
## Command Example
```bash
curl "wttr.in/Beijing?format=3"
```
## Parameters
- City name (required)
- Number of days (optional)
# One-time task
> Wake me up tomorrow morning at 9
# Recurring tasks
> Remind me to drink water every morning at 8
> Hold a team meeting every Monday at 10 AM
# View tasks
> What tasks do I have?
# Modify a task
> Move the 8 o'clock water reminder to 9
# Delete a task
> Cancel tomorrow's meeting reminder
Run this in another terminal:
cyberclaw monitor
View in real time:
# Real-time monitoring
tail -f logs/local_geek_master.jsonl
# Search for specific events
grep "tool_call" logs/local_geek_master.jsonl | tail -20
Edit workspace/memory/user_profile.md:
# User Profile
- **Name**: Thor Allen
- **Occupation**: Programmer
- **Preferences**:
- Likes iced Americano
- Often writes code in Python
- Gets up at 8 every day
- **Special requirements**:
- Keep answers concise
- Do not use emojis

user_profile.md, a Markdown file that stores user preferences, occupation, and special requirements
When the number of conversation turns exceeds the threshold:

Each complete turn contains:
HumanMessage)AIMessage)ToolMessage)# Run all tests
python3 -m pytest tests/ -v
# Run a specific test
python3 tests/test_two_phase_skills.py
# Run two-phase tests
python3 -c "from tests.test_two_phase_skills import run_tests; run_tests()"
| Test File | Coverage | Status |
|---|---|---|
test_agent.py | Agent loop | ✅ Passing |
test_builtins.py | Built-in tools | ✅ Passing |
test_context.py | Context trimming | ✅ Passing |
test_sandbox_tools.py | Sandbox tools | ✅ Passing |
test_two_phase_skills.py | Two-phase invocation | ✅ Passing |
test_heartbeat.py | Heartbeat tasks | ✅ Passing |
Based on the experimental data in tests/logs/test_two_phase_skills.md:
| Metric | Single-phase | Two-phase | Improvement |
|---|---|---|---|
| Safety hit rate | 50.0% | 90.0% | +40% |
| P0 incident rate | 50.0% | 10.0% | -80% |
| Average decision latency | 19.33s | 23.88s | +23.5% |
Conclusion: the two-phase architecture trades 23.5% more time for an incident-rate drop from 50% to 0% in actual destructive execution.
Issues and pull requests are welcome.
# Clone the project
git clone https://github.com/ttguy0707/CyberClaw.git
cd CyberClaw
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
feat: new featurefix: bug fixdocs: documentation updatestyle: code stylerefactor: refactoringtest: test-related changeschore: build or tooling changesMIT License
👾 CyberClaw · Next-Gen Transparent Agent Architecture
Made with ❤️ by @ttguy0707
Python
100.0%
👾 下一代透明智能体架构 | Next-Gen Transparent Agent Architecture 🔍 全行为审计 | 🛡️ 两段式安全调用 | 🧠 双水位记忆 | ⏰ 心跳任务 📊 P0 级事故率降低 80% | 兼容 OpenClaw + Claude Code 技能生态
329
stars
13
commits
Python
primary language
Sep 10, 2026
updated

下一代透明智能体架构 · Next-Gen Transparent Agent Architecture
English Nav: Quick Start · Core Capabilities · Architecture · Examples
🤖 你的 AI 在背着你做什么?CyberClaw 让所有行为无所遁形
💡 灵感来源:受 OpenClaw 的启发,CyberClaw 专注于解决 AI 智能体的透明度和可控性问题。
CyberClaw 是一个企业级透明可控智能体,重新定义 AI 系统的可信边界:
CyberClaw 支持OpenClaw 技能和Claude Code 技能,可直接使用两个生态系统的丰富技能资源,无需重新开发。
| 能力 | 说明 | 优势 |
|---|---|---|
| 🧠 双水位记忆 | 长期画像 + 短期摘要,持续学习用户偏好 | 越用越懂你,避免重复询问 |
| 🔍 全行为审计 | 5 类事件实时审计,JSONL 日志 + Rich 监控终端 | 告别黑箱,所有决策可追溯 |
| 🛡️ 零信任执行 | help → run 两段式调用,先看说明书再执行 | P0 级事故率降低 80%(50% → 10%) |
| ⏰ 心跳任务引擎 | 后台独立进程,自动执行定时任务 | 解放双手,复杂任务自动化 |
| 🖥️ 跨平台支持 | Unix + Windows 双平台自适应,LLM 自主选择命令 | 一套代码,全平台运行 |
双水位记忆系统
user_profile.md):用户偏好、职业、特殊要求两段式技能调用
mode='help':查看完整说明书(SKILL.md)mode='run':执行具体操作透明监控系统
llm_input, tool_call, tool_result, ai_message, system_actiontail -f 实时监控心跳任务系统
跨平台路径拦截
..、绝对路径、用户主目录访问office/ 工位内Shell 命令安全
-y 等参数)/ 和 \ 路径分隔符| 工具 | 功能 | 示例 |
|---|---|---|
get_current_time | 获取当前时间 | "现在几点了?" |
calculator | 数学计算器 | "25 乘以 48 等于多少" |
schedule_task | 定时任务/闹钟 | "每天早上 8 点提醒我喝水" |
list_scheduled_tasks | 查看任务列表 | "我都有哪些任务" |
delete_scheduled_task | 删除任务 | "取消明天的会议提醒" |
modify_scheduled_task | 修改任务 | "把 8 点的会议改成 9 点" |
get_system_model_info | 获取模型信息 | "你是什么模型" |
save_user_profile | 更新用户画像 | "记住我喜欢喝冰美式" |
list_office_files | 列出文件 | "看看 office 里有什么" |
read_office_file | 读取文件 | "读取 readme.txt" |
write_office_file | 写入文件 | "创建 test.py" |
execute_office_shell | 执行 Shell 命令 | "运行 python test.py" |
workspace/office/skills/ 目录skill-creator:用自然语言让 CyberClaw 自己创建技能skill-vetter:检查技能的安全性mcporter:连接外部 MCP (Model Context Protocol) 服务mcp-builder:构建自己的 MCP 服务tavily-search:AI 优化网络搜索weather:天气查询# 克隆项目
git clone https://github.com/ttguy0707/CyberClaw.git
cd CyberClaw
# 安装依赖并注册命令行工具(一步完成)
pip install -e .
💡 推荐使用虚拟环境:
# 创建虚拟环境 python3 -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate # 安装项目(会自动安装 requirements.txt 中的依赖) pip install -e .安装完成后,即可在任意目录使用
cyberclaw命令。
有两种配置方式:自动配置向导(推荐)或 手动配置。
# 启动交互式配置向导
cyberclaw config
配置向导会引导你:

# 复制示例配置文件
cp .env.example .env
# 编辑配置文件
vim .env # 或使用你喜欢的编辑器
编辑 .env 文件,配置必要的参数:
# 模型提供商
DEFAULT_PROVIDER=aliyun
DEFAULT_MODEL=glm-5
# API Key (根据提供商选择对应的 Key)
OPENAI_API_KEY=sk-your-api-key-here
# Base URL (可选,使用代理时配置)
OPENAI_API_BASE=https://coding.dashscope.aliyuncs.com/v1
配置说明:
DEFAULT_PROVIDER: 模型提供商 (openai, anthropic, aliyun, tencent, z.ai, ollama)DEFAULT_MODEL: 模型名称 (如 gpt-4o-mini, glm-5, qwen-max)OPENAI_API_KEY: OpenAI 或兼容接口的 API KeyANTHROPIC_API_KEY: Anthropic 的 API KeyOPENAI_API_BASE: 兼容接口的 Base URL(阿里云、腾讯云等)OLLAMA_BASE_URL: Ollama 本地服务地址(默认 http://localhost:11434)💡 工作区配置:工作区路径已在代码中初始化,默认为项目根目录的
workspace文件夹,无需在.env中配置。仅当需要自定义工作区位置时,才设置CYBERCLAW_WORKSPACE环境变量。
💡 提示:配置完成后,可运行
cyberclaw run聊天测试连接是否正常。
# 启动主程序
cyberclaw run

启动后进入交互式对话界面,如图所示:

常用命令示例:
| 类型 | 命令示例 | 说明 |
|---|---|---|
| ⏰ 时间查询 | 现在几点了? | 获取当前时间 |
| 🧮 数学计算 | 帮我算一下 25 乘以 48 | 调用计算器工具 |
| ⏲️ 定时任务 | 每天早上 8 点提醒我喝水 | 创建循环任务 |
| 📋 查看任务 | 我都有哪些任务 | 查看任务列表 |
| ✏️ 修改任务 | 把 8 点的喝水提醒改成 9 点 | 修改已有任务 |
| ❌ 删除任务 | 取消明天的会议提醒 | 删除任务 |
| 📁 文件操作 | 看看 office 里有什么文件 | 列出工位文件 |
| 📖 读取文件 | 读取 readme.txt | 读取文件内容 |
| 📝 创建文件 | 创建 test.py | 写入新文件 |
| 💻 Shell 命令 | 运行 python test.py | 执行 Shell 命令 |
| 🚪 退出 | /exit | 退出程序 |
CyberClaw 内置心跳任务系统(Heartbeat),自动在后台执行定时任务:
workspace/tasks.json,重启不丢失cyberclaw monitor 可查看任务执行日志心跳任务示例:
# 创建循环任务
> 每天早上 8 点提醒我喝水
✅ 任务已加入队列 | 循环模式:daily | 首发时间:2026-04-07 08:00:00
# 心跳系统会在每天 8:00 自动触发提醒
💡 提示:心跳任务在后台运行,即使不启动主程序也会执行(需单独运行心跳进程)。
在另一个终端运行:
cyberclaw monitor


架构说明:
| 模块 | 文件 | 功能 |
|---|---|---|
| Agent 循环 | cyberclaw/core/agent.py | LangGraph StateGraph,决策大脑 |
| 技能加载 | cyberclaw/core/skill_loader.py | 动态加载 SKILL.md,两段式调用 |
| 上下文管理 | cyberclaw/core/context.py | 消息修剪,双水位记忆 |
| 内置工具 | cyberclaw/core/tools/builtins.py | 时间/计算/任务调度等 |
| 沙盒工具 | cyberclaw/core/tools/sandbox_tools.py | 文件操作 + Shell 执行 |
| 审计日志 | cyberclaw/core/logger.py | JSONL 格式事件记录 |
| 心跳任务 | cyberclaw/core/heartbeat.py | 定时任务检查与触发 |
CyberClaw/
├── cyberclaw/ # 核心包
│ ├── core/
│ │ ├── agent.py # Agent 循环
│ │ ├── config.py # 配置管理
│ │ ├── context.py # 上下文修剪
│ │ ├── provider.py # LLM 提供商适配
│ │ ├── skill_loader.py # 动态技能加载
│ │ ├── logger.py # 审计日志
│ │ ├── heartbeat.py # 心跳任务
│ │ └── tools/
│ │ ├── base.py # 工具装饰器
│ │ ├── builtins.py # 内置工具
│ │ └── sandbox_tools.py # 沙盒工具
│ └── __init__.py
├── workspace/
│ ├── office/ # 沙盒工位
│ │ ├── skills/ # 可插拔技能
│ │ │ ├── weather/
│ │ │ ├── skill-creator/
│ │ │ └── ...
│ │ └── .env # 环境变量
│ ├── memory/
│ │ └── user_profile.md # 用户长期画像
│ ├── state.sqlite3 # 对话历史数据库
│ └── tasks.json # 定时任务队列
├── logs/
│ └── local_geek_master.jsonl # 审计日志
├── docs/ # 文档与架构图
│ ├── architect.png # 系统架构图
│ ├── monitor.png # 监控终端截图
│ ├── welcome.png # 欢迎界面
│ ├── chat.png # 聊天界面
│ ├── config.png # 配置向导
│ ├── memory.png # 记忆系统
│ └── context_cut.png # 上下文裁剪
├── entry/
│ ├── main.py # 主程序入口
│ ├── cli.py # CLI 配置向导
│ └── monitor.py # 监控终端
├── tests/ # 测试套件
│ ├── test_agent.py
│ ├── test_builtins.py
│ ├── test_two_phase_skills.py # 两阶段测试
│ └── logs/ # 测试报告
├── setup.py
├── .env # 环境配置(运行时创建)
├── .env.example # 环境配置示例(复制此文件开始配置)
└── README.md
.env 文件:主配置文件,包含 API Key、模型设置等敏感信息。
.env.example 文件:配置模板,包含所有可用配置项的说明和示例值。
首次使用时,复制示例文件并修改:
cp .env.example .env
详细配置说明见 快速开始 - 配置 部分。
方法 1:直接复制
cp -r /path/to/skill workspace/office/skills/
方法 2:使用 skill-creator
# 先安装 skill-creator 技能
cd workspace/office/skills
git clone https://github.com/.../skill-creator.git
# 然后用自然语言让 CyberClaw 创建新技能
> 帮我创建一个查询比特币价格的技能
方法 3:使用 skill-vetter 检查安全性
# 安装 skill-vetter
cd workspace/office/skills
git clone https://github.com/.../skill-vetter.git
# 让 CyberClaw 检查技能安全性
> 帮我检查一下 weather 技能是否安全
每个技能包含 SKILL.md:
---
name: weather
description: 获取天气预报
---
# Weather Skill
## 功能
获取全球城市的实时天气预报。
## 命令示例
```bash
curl "wttr.in/Beijing?format=3"
```
## 参数
- 城市名(必填)
- 天数(可选)
# 单次任务
> 明天早上 9 点叫我起床
# 循环任务
> 每天早上 8 点提醒我喝水
> 每周一上午 10 点开团队会议
# 查看任务
> 我都有哪些任务
# 修改任务
> 把 8 点的喝水提醒改成 9 点
# 删除任务
> 取消明天的会议提醒
在另一个终端运行:
cyberclaw monitor
实时查看:
# 实时监控
tail -f logs/local_geek_master.jsonl
# 搜索特定事件
grep "tool_call" logs/local_geek_master.jsonl | tail -20
编辑 workspace/memory/user_profile.md:
# 用户档案
- **姓名**: Thor Allen
- **职业**: 程序员
- **偏好**:
- 喜欢喝冰美式咖啡
- 常用 Python 写代码
- 每天 8 点起床
- **特殊要求**:
- 回答要简洁
- 不要使用表情符号

user_profile.md Markdown 文件,存储用户偏好、职业、特殊要求
当对话轮次超过阈值时:

每个完整回合包含:
# 运行所有测试
python3 -m pytest tests/ -v
# 运行特定测试
python3 tests/test_two_phase_skills.py
# 运行两阶段测试
python3 -c "from tests.test_two_phase_skills import run_tests; run_tests()"
| 测试文件 | 测试内容 | 状态 |
|---|---|---|
test_agent.py | Agent 循环 | ✅ 通过 |
test_builtins.py | 内置工具 | ✅ 通过 |
test_context.py | 上下文修剪 | ✅ 通过 |
test_sandbox_tools.py | 沙盒工具 | ✅ 通过 |
test_two_phase_skills.py | 两阶段调用 | ✅ 通过 |
test_heartbeat.py | 心跳任务 | ✅ 通过 |
根据 tests/logs/test_two_phase_skills.md 的实验数据:
| 指标 | 单阶段 | 两阶段 | 提升 |
|---|---|---|---|
| 安全命中率 | 50.0% | 90.0% | +40% |
| P0 级事故率 | 50.0% | 10.0% | -80% |
| 平均决策耗时 | 19.33s | 23.88s | +23.5% |
结论:两阶段架构用 23.5% 的时间开销,换来了事故率从 50% 暴降至 0%(实际破坏性执行为 0)。
欢迎提交 Issue 和 Pull Request!
# 克隆项目
git clone https://github.com/ttguy0707/CyberClaw.git
cd CyberClaw
# 创建虚拟环境
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 安装开发依赖
pip install -e ".[dev]"
feat: 新功能fix: 修复 bugdocs: 文档更新style: 代码格式refactor: 重构test: 测试相关chore: 构建/工具MIT License
👾 CyberClaw · 下一代透明智能体架构
Made with ❤️ by @ttguy0707
🤖 What is your AI doing behind the scenes? CyberClaw makes every action visible.
💡 Inspired by OpenClaw, CyberClaw focuses on transparency and controllability for AI agents.
CyberClaw is an enterprise-grade transparent and controllable agent that redefines the trust boundary of AI systems:
help -> run) lets the agent read instructions before execution, reducing P0 incident risk by 80%CyberClaw supports both OpenClaw skills and Claude Code skills, so you can reuse rich skill resources from both ecosystems without rebuilding them.
| Capability | Description | Benefit |
|---|---|---|
| 🧠 Dual-watermark memory | Long-term profile + short-term summaries that continuously learn user preferences | Understands you better over time and avoids repeated questions |
| 🔍 Full behavior auditing | 5-category real-time event auditing, JSONL logs, and a Rich monitoring terminal | No more black boxes; every decision is traceable |
| 🛡️ Zero-trust execution | help -> run two-phase calls that read the manual before execution | Reduces P0 incident risk by 80% (50% -> 10%) |
| ⏰ Heartbeat task engine | Independent background process for scheduled tasks | Automates complex and repetitive tasks |
| 🖥️ Cross-platform support | Adaptive support for Unix and Windows, with LLM-selected commands | One codebase runs across platforms |
Dual-watermark memory system
user_profile.md): user preferences, occupation, and special requirementsMAX_TURNS turns and keeps the latest KEEP_TURNS turnsTwo-phase skill invocation
mode='help': read the full instruction file (SKILL.md)mode='run': execute the concrete operationTransparent monitoring system
llm_input, tool_call, tool_result, ai_message, system_actiontail -f real-time monitoringHeartbeat task system
Cross-platform path interception
.., absolute paths, and user home directory accessoffice/ workspaceShell command safety
-y when needed/ and \ path separators| Tool | Function | Example |
|---|---|---|
get_current_time | Get the current time | "What time is it now?" |
calculator | Math calculator | "What is 25 times 48?" |
schedule_task | Scheduled tasks and alarms | "Remind me to drink water every morning at 8" |
list_scheduled_tasks | List tasks | "What tasks do I have?" |
delete_scheduled_task | Delete a task | "Cancel tomorrow's meeting reminder" |
modify_scheduled_task | Modify a task | "Move the 8 o'clock meeting to 9" |
get_system_model_info | Get model information | "What model are you?" |
save_user_profile | Update user profile | "Remember that I like iced Americano" |
list_office_files | List files | "Show me what is in office" |
read_office_file | Read a file | "Read readme.txt" |
write_office_file | Write a file | "Create test.py" |
execute_office_shell | Run a shell command | "Run python test.py" |
workspace/office/skills/skill-creator: create skills with natural language through CyberClawskill-vetter: check skill safetymcporter: connect external MCP (Model Context Protocol) servicesmcp-builder: build your own MCP servicestavily-search: AI-optimized web searchweather: weather lookup# Clone the project
git clone https://github.com/ttguy0707/CyberClaw.git
cd CyberClaw
# Install dependencies and register the CLI in one step
pip install -e .
💡 Virtual environment recommended:
# Create a virtual environment python3 -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate # Install the project. Dependencies from requirements.txt are installed automatically. pip install -e .After installation, the
cyberclawcommand is available from any directory.
There are two configuration methods: the automatic setup wizard (recommended) and manual configuration.
# Start the interactive configuration wizard
cyberclaw config
The wizard guides you through:

# Copy the example configuration file
cp .env.example .env
# Edit the configuration file
vim .env # Or use your preferred editor
Edit .env and configure the required parameters:
# Model provider
DEFAULT_PROVIDER=aliyun
DEFAULT_MODEL=glm-5
# API Key. Choose the corresponding key for your provider.
OPENAI_API_KEY=sk-your-api-key-here
# Base URL. Optional; configure it when using a proxy or compatible endpoint.
OPENAI_API_BASE=https://coding.dashscope.aliyuncs.com/v1
Configuration reference:
DEFAULT_PROVIDER: model provider (openai, anthropic, aliyun, tencent, z.ai, ollama)DEFAULT_MODEL: model name, such as gpt-4o-mini, glm-5, or qwen-maxOPENAI_API_KEY: API key for OpenAI or compatible APIsANTHROPIC_API_KEY: Anthropic API keyOPENAI_API_BASE: Base URL for compatible APIs such as Alibaba Cloud or Tencent CloudOLLAMA_BASE_URL: local Ollama service URL, defaulting to http://localhost:11434💡 Workspace configuration: the workspace path is initialized in code and defaults to the
workspacefolder in the project root. You do not need to configure it in.env. Set theCYBERCLAW_WORKSPACEenvironment variable only when you need a custom workspace path.
💡 Tip: after configuration, run
cyberclaw runto test whether chat connectivity works.
# Start the main program
cyberclaw run

After startup, CyberClaw enters the interactive chat interface:

Common command examples:
| Type | Example Command | Description |
|---|---|---|
| ⏰ Time query | What time is it now? | Get the current time |
| 🧮 Math | Calculate 25 times 48 | Use the calculator tool |
| ⏲️ Scheduled task | Remind me to drink water every morning at 8 | Create a recurring task |
| 📋 List tasks | What tasks do I have? | View the task list |
| ✏️ Modify task | Move the 8 o'clock water reminder to 9 | Modify an existing task |
| ❌ Delete task | Cancel tomorrow's meeting reminder | Delete a task |
| 📁 File operations | Show me the files in office | List workspace files |
| 📖 Read file | Read readme.txt | Read file content |
| 📝 Create file | Create test.py | Write a new file |
| 💻 Shell command | Run python test.py | Execute a shell command |
| 🚪 Exit | /exit | Exit the program |
CyberClaw includes a heartbeat task system that automatically executes scheduled tasks in the background:
workspace/tasks.json and survive restartscyberclaw monitor to view task execution logsHeartbeat task example:
# Create a recurring task
> Remind me to drink water every morning at 8
✅ Task added to queue | Recurrence: daily | First run: 2026-04-07 08:00:00
# The heartbeat system triggers the reminder at 8:00 every day
💡 Tip: heartbeat tasks run in the background and can execute even when the main program is not running, as long as the heartbeat process is started separately.
Run this in another terminal:
cyberclaw monitor


Architecture overview:
| Module | File | Function |
|---|---|---|
| Agent loop | cyberclaw/core/agent.py | LangGraph StateGraph and decision engine |
| Skill loading | cyberclaw/core/skill_loader.py | Dynamically loads SKILL.md with two-phase invocation |
| Context management | cyberclaw/core/context.py | Message trimming and dual-watermark memory |
| Built-in tools | cyberclaw/core/tools/builtins.py | Time, calculation, task scheduling, and more |
| Sandbox tools | cyberclaw/core/tools/sandbox_tools.py | File operations and shell execution |
| Audit logging | cyberclaw/core/logger.py | JSONL event logging |
| Heartbeat tasks | cyberclaw/core/heartbeat.py | Scheduled task checking and triggering |
CyberClaw/
├── cyberclaw/ # Core package
│ ├── core/
│ │ ├── agent.py # Agent loop
│ │ ├── config.py # Configuration management
│ │ ├── context.py # Context trimming
│ │ ├── provider.py # LLM provider adapters
│ │ ├── skill_loader.py # Dynamic skill loading
│ │ ├── logger.py # Audit logging
│ │ ├── heartbeat.py # Heartbeat tasks
│ │ └── tools/
│ │ ├── base.py # Tool decorator
│ │ ├── builtins.py # Built-in tools
│ │ └── sandbox_tools.py # Sandbox tools
│ └── __init__.py
├── workspace/
│ ├── office/ # Sandbox workspace
│ │ ├── skills/ # Pluggable skills
│ │ │ ├── weather/
│ │ │ ├── skill-creator/
│ │ │ └── ...
│ │ └── .env # Environment variables
│ ├── memory/
│ │ └── user_profile.md # Long-term user profile
│ ├── state.sqlite3 # Conversation history database
│ └── tasks.json # Scheduled task queue
├── logs/
│ └── local_geek_master.jsonl # Audit logs
├── docs/ # Documentation and diagrams
│ ├── architect.png # System architecture diagram
│ ├── monitor.png # Monitoring terminal screenshot
│ ├── welcome.png # Welcome screen
│ ├── chat.png # Chat interface
│ ├── config.png # Configuration wizard
│ ├── memory.png # Memory system
│ └── context_cut.png # Context trimming
├── entry/
│ ├── main.py # Main program entry
│ ├── cli.py # CLI configuration wizard
│ └── monitor.py # Monitoring terminal
├── tests/ # Test suite
│ ├── test_agent.py
│ ├── test_builtins.py
│ ├── test_two_phase_skills.py # Two-phase tests
│ └── logs/ # Test reports
├── setup.py
├── .env # Runtime environment configuration
├── .env.example # Example environment configuration
└── README.md
.env file: the main configuration file that contains sensitive information such as API keys and model settings.
.env.example file: configuration template with descriptions and example values for all available options.
For first-time setup, copy the example file and modify it:
cp .env.example .env
See Quick Start - Configuration for detailed configuration instructions.
Method 1: Direct copy
cp -r /path/to/skill workspace/office/skills/
Method 2: Use skill-creator
# Install the skill-creator skill first
cd workspace/office/skills
git clone https://github.com/.../skill-creator.git
# Then ask CyberClaw to create a new skill with natural language
> Create a skill for querying Bitcoin prices
Method 3: Use skill-vetter for safety checks
# Install skill-vetter
cd workspace/office/skills
git clone https://github.com/.../skill-vetter.git
# Ask CyberClaw to check skill safety
> Check whether the weather skill is safe
Each skill contains a SKILL.md file:
---
name: weather
description: Get weather forecasts
---
# Weather Skill
## Function
Get real-time weather forecasts for cities worldwide.
## Command Example
```bash
curl "wttr.in/Beijing?format=3"
```
## Parameters
- City name (required)
- Number of days (optional)
# One-time task
> Wake me up tomorrow morning at 9
# Recurring tasks
> Remind me to drink water every morning at 8
> Hold a team meeting every Monday at 10 AM
# View tasks
> What tasks do I have?
# Modify a task
> Move the 8 o'clock water reminder to 9
# Delete a task
> Cancel tomorrow's meeting reminder
Run this in another terminal:
cyberclaw monitor
View in real time:
# Real-time monitoring
tail -f logs/local_geek_master.jsonl
# Search for specific events
grep "tool_call" logs/local_geek_master.jsonl | tail -20
Edit workspace/memory/user_profile.md:
# User Profile
- **Name**: Thor Allen
- **Occupation**: Programmer
- **Preferences**:
- Likes iced Americano
- Often writes code in Python
- Gets up at 8 every day
- **Special requirements**:
- Keep answers concise
- Do not use emojis

user_profile.md, a Markdown file that stores user preferences, occupation, and special requirements
When the number of conversation turns exceeds the threshold:

Each complete turn contains:
HumanMessage)AIMessage)ToolMessage)# Run all tests
python3 -m pytest tests/ -v
# Run a specific test
python3 tests/test_two_phase_skills.py
# Run two-phase tests
python3 -c "from tests.test_two_phase_skills import run_tests; run_tests()"
| Test File | Coverage | Status |
|---|---|---|
test_agent.py | Agent loop | ✅ Passing |
test_builtins.py | Built-in tools | ✅ Passing |
test_context.py | Context trimming | ✅ Passing |
test_sandbox_tools.py | Sandbox tools | ✅ Passing |
test_two_phase_skills.py | Two-phase invocation | ✅ Passing |
test_heartbeat.py | Heartbeat tasks | ✅ Passing |
Based on the experimental data in tests/logs/test_two_phase_skills.md:
| Metric | Single-phase | Two-phase | Improvement |
|---|---|---|---|
| Safety hit rate | 50.0% | 90.0% | +40% |
| P0 incident rate | 50.0% | 10.0% | -80% |
| Average decision latency | 19.33s | 23.88s | +23.5% |
Conclusion: the two-phase architecture trades 23.5% more time for an incident-rate drop from 50% to 0% in actual destructive execution.
Issues and pull requests are welcome.
# Clone the project
git clone https://github.com/ttguy0707/CyberClaw.git
cd CyberClaw
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
feat: new featurefix: bug fixdocs: documentation updatestyle: code stylerefactor: refactoringtest: test-related changeschore: build or tooling changesMIT License
👾 CyberClaw · Next-Gen Transparent Agent Architecture
Made with ❤️ by @ttguy0707
Python
100.0%