当前位置: 首页 > Skill >

Code Cog

Code Cog

Code Cog

AI coding agent powered by CellCog Co-work. Code generation, debugging, refactoring, codebase exploration, terminal operations — executed directly on your ma...

1.0.10 2026.11.26 598
获取Skill文件查看使用说明
作 者:叶辰 许可证: 更新时间:2026.11.26
本文目录展开

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.

How to Use

For your first CellCog task in a session, read the cellcog skill for the full SDK reference — file handling, chat modes, timeouts, and more.

OpenClaw (fire-and-forget):

result = client.create_chat(
    prompt="[your task prompt]",
    notify_session_key="agent:main:main",
    task_label="my-task",
    chat_mode="agent core",
    enable_cowork=True,
    cowork_working_directory="/path/to/project",
)

All agents except OpenClaw (blocks until done):

from cellcog import CellCogClient
client = CellCogClient(agent_provider="openclaw|cursor|claude-code|codex|...")
result = client.create_chat(
    prompt="[your task prompt]",
    task_label="my-task",
    chat_mode="agent core",
    enable_cowork=True,
    cowork_working_directory="/path/to/project",
)
print(result["message"])

Prerequisites

This skill requires the cellcog skill for SDK setup and API calls.

clawhub install cellcog

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):

from cellcog import CellCogClient
client = CellCogClient(agent_provider="openclaw")

result = client.create_chat(
    prompt="Refactor the authentication module to use JWT tokens",
    notify_session_key="agent:main:main",  # OpenClaw only
    chat_mode="agent core",
    enable_cowork=True,
    cowork_working_directory="/Users/me/projects/myapp",
    task_label="auth-refactor",
)

All other agents (blocks until done):

from cellcog import CellCogClient
client = CellCogClient(agent_provider="openclaw")

result = client.create_chat(
    prompt="Refactor the authentication module to use JWT tokens",
    chat_mode="agent core",
    enable_cowork=True,
    cowork_working_directory="/Users/me/projects/myapp",
    task_label="auth-refactor",
)

Key parameters:

  • chat_mode="agent core" — Lightweight coding agent (vs "agent" for full multimedia)
  • enable_cowork=True — Enables Co-work (direct machine access)
  • cowork_working_directory — 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
"agent core" CodeCog default — coding, co-work, terminal ops (50 credits min)
"agent" 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

result = client.create_chat(
    prompt="Add a REST API endpoint for user profile updates with validation and tests",
    chat_mode="agent core",
    enable_cowork=True,
    cowork_working_directory="/Users/me/projects/myapp",
    task_label="add-profile-api",
)

Bug Fix from Error Log

result = client.create_chat(
    prompt="""Fix this error in production:
TypeError: Cannot read properties of undefined (reading 'map')
at UserList.render (src/components/UserList.tsx:42)

The component crashes when the API returns an empty response.""",
    chat_mode="agent core",
    enable_cowork=True,
    cowork_working_directory="/Users/me/projects/myapp",
    task_label="fix-userlist-crash",
)

Codebase Refactor

result = client.create_chat(
    prompt="Refactor the authentication module from session-based to JWT tokens. Update all middleware, tests, and API routes.",
    chat_mode="agent core",
    enable_cowork=True,
    cowork_working_directory="/Users/me/projects/myapp",
    task_label="auth-refactor",
)

Test Generation

result = client.create_chat(
    prompt="Generate comprehensive unit tests for src/services/billing.py. Cover edge cases for proration, currency conversion, and failed payments.",
    chat_mode="agent core",
    enable_cowork=True,
    cowork_working_directory="/Users/me/projects/myapp",
    task_label="billing-tests",
)

See https://cellcog.ai 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
  2. Working directory must be specified — this is the root of the project/repo
  3. 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
  • HumanComputer_Terminal_File_View — Read files on the user's machine
  • HumanComputer_Terminal_File_Write — Write files on the user's machine
  • HumanComputer_Terminal_File_Edit — 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
  2. Reference specific files — "Fix the bug in src/auth/login.ts" is better than "fix the login bug"
  3. Mention conventions — "Follow the existing test patterns" helps maintain consistency
  4. Include error context — Stack traces, log output, and reproduction steps help debugging
  5. 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)

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
Skill 文件
  • SKILL.md
    • Code Cog — The First Coding Agent Built for Agents
    • How to Use
    • Prerequisites
    • Quick Start
    • What CodeCog Can Do
      • Code Generation & Editing
      • Debugging & Fixing
      • Terminal Operations
      • Codebase Exploration
    • What Makes CodeCog Different
      • Built for Agents, Not Humans
      • Starts Lean, Scales to Multimodal
      • Direct Machine Access
    • Chat Mode
    • Example Prompts
      • New Feature Development
      • Bug Fix from Error Log
      • Codebase Refactor
      • Test Generation
    • Co-work Setup
      • Requirements
      • What Co-work Enables
      • Safety Model
    • Tips for Better Results
    • Limitations
  • 项目或源文件

相关 Skill

更多
Coding Agent (Claude Print + PTY Rules) Coding Agent (Claude Print + PTY Rules) 通过后台进程将编码任务委托给 Codex、Claude Code 或 Pi 代理。适用场景:(1) 构建/创建新功能或应用,(2) 审查 PR(原文不完整)
project-lifecycle-navigator project-lifecycle-navigator Bilingual EN/ZH project lifecycle navigator for non-technical users and AI Coding Agent workflows. Use when a user is starting a new software/AI project, feels a project is drifting mid-development, or has code ready for review. Routes into New Project Intake, Mid-Project Realignment, or Code Review & Upgrade Planning with structured questions, MVP control, stop-loss decisions, and executable handoff plans.
dev-guardrails dev-guardrails Universal AI agent development guardrails with five defense layers: instruction gate, project monitoring, delivery reliability, code quality audit, and scope fidelity enforcement. Prevents blind compliance, hallucination, scope creep, unrealistic promises, code quality degradation, and over-engineering. Designed for Claude Code, Codex, Gemini CLI, and any AI coding agent.
Codex Sub Agents 1 Codex Sub Agents 1 使用 OpenAI Codex CLI 处理编码任务。触发词:codex、code review、fix CI、refactor code、implement feature、coding agent、gpt-5-codex。Clawdbot 可将编码工作委托给 Codex CLI 作为子代理或直接工具。
aoe aoe Manage AI coding agent sessions via Agent of Empires (aoe)