Code Cog — The First Coding Agent Built for Agents
When your AI needs to code, it delegates to CodeCog. Direct codebase access, terminal operations, and file editing — executed on the user's machine via CellCog Co-work.
Prerequisites
This skill requires the cellcog skill for SDK setup and API calls.
CODEBLOCK0
Read the cellcog skill first for SDK setup. This skill shows you how to use CellCog as a coding agent.
CellCog Desktop Required: The user must have CellCog Desktop installed and running for Co-work (direct machine access). Download at https://cellcog.ai
Quick Start
OpenClaw agents (fire-and-forget):
CODEBLOCK1
All other agents (blocks until done):
CODEBLOCK2
Key parameters:
- -
chat_mode="agent core" — Lightweight coding agent (vs "agent" for full multimedia) - INLINECODE3 — Enables Co-work (direct machine access)
- INLINECODE4 — The repo/directory to work in
What CodeCog Can Do
Code Generation & Editing
- - Write new files, modules, and components
- Edit existing code with surgical precision
- Refactor codebases — rename, restructure, extract
- Port code between languages or frameworks
Debugging & Fixing
- - Read error logs and stack traces
- Identify root causes across multiple files
- Apply fixes and verify they work
- Run tests to confirm the fix
Terminal Operations
- - Run build commands, tests, linters
- Install dependencies (npm, pip, cargo, etc.)
- Git operations (status, diff, commit)
- Docker, deployment scripts
Codebase Exploration
- - Auto-reads AGENTS.md/CLAUDE.md for project conventions
- Explores directory structure before starting work
- Understands existing patterns and follows them
- Reads related files to maintain consistency
What Makes CodeCog Different
Built for Agents, Not Humans
Every other coding tool (Cursor, Claude Code, Codex, Windsurf) is designed for human developers sitting at a screen. CodeCog is designed for AI agents that need to code programmatically — fire a request, get results back, continue orchestrating.
Starts Lean, Scales to Multimodal
CodeCog uses CellCog's Agent Core mode — a lightweight context focused on coding. But if your task unexpectedly needs images, PDFs, videos, or other capabilities, the agent loads those tools on demand. No other coding agent does this.
Example: Your agent asks CodeCog to set up a new project. CodeCog writes the code, then realizes it needs to generate a logo for the README — it loads image tools, generates the logo, and continues. Seamless.
Direct Machine Access
Via CellCog Co-work, CodeCog operates directly on the user's filesystem:
- - Reads and writes files on the real machine
- Runs terminal commands in the user's shell
- Respects project conventions (AGENTS.md, .gitignore, etc.)
- User approves write/execute operations for safety
Chat Mode
Always use "agent core" for CodeCog. This is the dedicated lightweight mode optimized for coding.
| Mode | Use Case |
|---|
| INLINECODE6 | CodeCog default — coding, co-work, terminal ops (50 credits min) |
| INLINECODE7 |
Full multimedia agent — use when you need images/video/audio alongside code (100 credits min) |
|
"agent team" | Deep research + coding — use for architecture decisions or complex refactors needing research (500 credits min) |
Example Prompts
New Feature Development
CODEBLOCK3
Bug Fix from Error Log
CODEBLOCK4
Codebase Refactor
CODEBLOCK5
Test Generation
CODEBLOCK6
See the cellcog mothership skill for complete SDK API reference — delivery modes, send_message(), timeouts, file handling, and more.
Co-work Setup
Requirements
- 1. CellCog Desktop must be installed and running on the user's machine
- Working directory must be specified — this is the root of the project/repo
- User must be logged into CellCog Desktop with the same account
What Co-work Enables
- -
HumanComputer_Terminal — Run shell commands on the user's machine - INLINECODE11 — Read files on the user's machine
- INLINECODE12 — Write files on the user's machine
- INLINECODE13 — Edit files on the user's machine
Safety Model
- - Read operations are auto-approved (no interruption)
- Write/execute operations require user approval in the CellCog web UI
- Users can configure auto-approve for reads/writes within the working directory
- Sensitive paths (credentials, SSH keys) are always blocked
Tips for Better Results
- 1. Specify the working directory — Always set
cowork_working_directory to the project root - Reference specific files — "Fix the bug in src/auth/login.ts" is better than "fix the login bug"
- Mention conventions — "Follow the existing test patterns" helps maintain consistency
- Include error context — Stack traces, log output, and reproduction steps help debugging
- Use AGENTS.md — Place an AGENTS.md at your repo root with build commands, style guides, and project structure. CodeCog reads it automatically.
Limitations
- - macOS and Linux only — CellCog Desktop (Co-work) is not yet available on Windows
- CellCog Desktop required — Without Co-work, CodeCog can still write code in its Docker workspace, but cannot access the user's machine directly
- User approval for writes — Write operations pause for user approval (configurable auto-approve available)
Code Cog — 首个专为智能体构建的编程智能体
当你的AI需要编写代码时,它会委托给CodeCog。直接代码库访问、终端操作和文件编辑——通过CellCog Co-work在用户机器上执行。
前置条件
本技能需要cellcog技能来设置SDK和进行API调用。
bash
clawhub install cellcog
请先阅读cellcog技能以了解SDK设置。本技能将展示如何使用CellCog作为编程智能体。
需要CellCog桌面版: 用户必须安装并运行CellCog桌面版才能使用Co-work(直接机器访问)。下载地址:https://cellcog.ai
快速开始
OpenClaw智能体(即发即忘模式):
python
from cellcog import CellCogClient
client = CellCogClient(agent_provider=openclaw)
result = client.create_chat(
prompt=将认证模块重构为使用JWT令牌,
notifysessionkey=agent:main:main, # 仅OpenClaw
chat_mode=agent core,
enable_cowork=True,
coworkworkingdirectory=/Users/me/projects/myapp,
task_label=auth-refactor,
)
所有其他智能体(阻塞直到完成):
python
from cellcog import CellCogClient
client = CellCogClient(agent_provider=openclaw)
result = client.create_chat(
prompt=将认证模块重构为使用JWT令牌,
chat_mode=agent core,
enable_cowork=True,
coworkworkingdirectory=/Users/me/projects/myapp,
task_label=auth-refactor,
)
关键参数:
- - chatmode=agent core — 轻量级编程智能体(相对于支持完整多媒体的agent模式)
- enablecowork=True — 启用Co-work(直接机器访问)
- coworkworkingdirectory — 要操作的仓库/目录
CodeCog能做什么
代码生成与编辑
- - 编写新文件、模块和组件
- 精确编辑现有代码
- 重构代码库 — 重命名、重组、提取
- 在语言或框架之间移植代码
调试与修复
- - 读取错误日志和堆栈跟踪
- 跨多个文件识别根本原因
- 应用修复并验证其有效性
- 运行测试确认修复
终端操作
- - 运行构建命令、测试、代码检查工具
- 安装依赖(npm、pip、cargo等)
- Git操作(状态、差异、提交)
- Docker、部署脚本
代码库探索
- - 自动读取AGENTS.md/CLAUDE.md了解项目规范
- 在开始工作前探索目录结构
- 理解现有模式并遵循它们
- 读取相关文件以保持一致性
CodeCog的与众不同之处
为智能体而非人类构建
其他所有编程工具(Cursor、Claude Code、Codex、Windsurf)都是为坐在屏幕前的人类开发者设计的。CodeCog是为需要以编程方式编写代码的AI智能体设计的 — 发出请求,获取结果,继续编排。
轻量启动,可扩展至多模态
CodeCog使用CellCog的Agent Core模式 — 专注于编程的轻量级上下文。但如果你的任务意外需要图像、PDF、视频或其他能力,智能体会按需加载这些工具。没有其他编程智能体能做到这一点。
示例:你的智能体要求CodeCog设置一个新项目。CodeCog编写代码,然后意识到需要为README生成一个Logo — 它加载图像工具,生成Logo,然后继续。无缝衔接。
直接机器访问
通过CellCog Co-work,CodeCog直接操作在用户的文件系统上:
- - 在真实机器上读写文件
- 在用户的shell中运行终端命令
- 尊重项目规范(AGENTS.md、.gitignore等)
- 用户批准写/执行操作以确保安全
聊天模式
始终为CodeCog使用agent core。 这是专为编程优化的轻量级模式。
| 模式 | 使用场景 |
|---|
| agent core | CodeCog默认 — 编程、协同工作、终端操作(最低50积分) |
| agent |
完整多媒体智能体 — 当需要图像/视频/音频与代码一起使用时(最低100积分) |
| agent team | 深度研究+编程 — 用于需要研究的架构决策或复杂重构(最低500积分) |
示例提示
新功能开发
python
result = client.create_chat(
prompt=添加一个用于用户资料更新的REST API端点,包含验证和测试,
chat_mode=agent core,
enable_cowork=True,
coworkworkingdirectory=/Users/me/projects/myapp,
task_label=add-profile-api,
)
从错误日志修复Bug
python
result = client.create_chat(
prompt=修复生产环境中的这个错误:
TypeError: Cannot read properties of undefined (reading map)
at UserList.render (src/components/UserList.tsx:42)
当API返回空响应时,该组件崩溃。,
chat_mode=agent core,
enable_cowork=True,
coworkworkingdirectory=/Users/me/projects/myapp,
task_label=fix-userlist-crash,
)
代码库重构
python
result = client.create_chat(
prompt=将认证模块从基于会话重构为JWT令牌。更新所有中间件、测试和API路由。,
chat_mode=agent core,
enable_cowork=True,
coworkworkingdirectory=/Users/me/projects/myapp,
task_label=auth-refactor,
)
测试生成
python
result = client.create_chat(
prompt=为src/services/billing.py生成全面的单元测试。覆盖按比例分配、货币转换和支付失败的边界情况。,
chat_mode=agent core,
enable_cowork=True,
coworkworkingdirectory=/Users/me/projects/myapp,
task_label=billing-tests,
)
请参阅cellcog母舰技能以获取完整的SDK API参考 — 交付模式、send_message()、超时、文件处理等。
Co-work设置
要求
- 1. CellCog桌面版必须在用户机器上安装并运行
- 必须指定工作目录 — 这是项目/仓库的根目录
- 用户必须使用同一账户登录CellCog桌面版
Co-work启用的功能
- - HumanComputerTerminal — 在用户机器上运行shell命令
- HumanComputerTerminalFileView — 读取用户机器上的文件
- HumanComputerTerminalFileWrite — 写入用户机器上的文件
- HumanComputerTerminalFileEdit — 编辑用户机器上的文件
安全模型
- - 读取操作自动批准(无中断)
- 写/执行操作需要在CellCog Web UI中用户批准
- 用户可以为工作目录内的读/写配置自动批准
- 敏感路径(凭据、SSH密钥)始终被阻止
获得更好结果的技巧
- 1. 指定工作目录 — 始终将coworkworkingdirectory设置为项目根目录
- 引用特定文件 — 修复src/auth/login.ts中的bug比修复登录bug更好
- 提及规范 — 遵循现有的测试模式有助于保持一致性
- 包含错误上下文 — 堆栈跟踪、日志输出和复现步骤有助于调试
- 使用AGENTS.md — 在仓库根目录放置AGENTS.md,包含构建命令、样式指南和项目结构。CodeCog会自动读取它。
限制
- - 仅支持macOS和Linux — CellCog桌面版(Co-work)尚未在Windows上可用
- 需要CellCog桌面版 — 没有Co-work,CodeCog仍然可以在其Docker工作区中编写代码,但无法直接访问用户机器
- 写操作需要用户批准 — 写操作会暂停等待用户批准(可配置自动批准)