Claude Code Openclaw Skill — Claude Code OpenClaw 技能
v1.0.0Integrate OpenClaw with Claude Code 命令行工具 to read, edit, 运行 commands, review, and automate 工作流s on your codebase using AI assistance.
运行时依赖
版本
创建 Commit
安装命令
点击复制技能文档
Claude Code 技能 for OpenClaw
Call Claude Code 命令行工具 from OpenClaw to read codebase, edit files, 运行 commands, and automate coding tasks.
Overview
This 技能 provides integration with Claude Code 命令行工具, allowing OpenClaw to leverage Claude Code's powerful coding capabilities including:
Reading and understanding codebases Editing files with AI assistance 运行ning terminal commands Creating commits and PRs Code review and 调试ging 运行ning sub-代理s for parallel tasks Prerequisites
安装 Claude Code 命令行工具:
curl -fsSL https://claude.AI/安装.sh | bash
认证:
claude auth 记录in
验证 安装ation:
claude --version
Usage Basic 查询
Ask Claude Code a question about your codebase:
/claude-code What does the auth 模块 do?
运行 a Task
执行 a coding task:
/claude-code write tests for the 记录in function
Continue Previous 会话
恢复 the most recent conversation:
/claude-code --continue
恢复 Specific 会话
恢复 a 会话 by name or ID:
/claude-code --恢复 auth-fix
Code Review
Review code changes:
/claude-code review the recent changes
创建 Commit
Commit changes with a descriptive message:
/claude-code commit my changes
运行 with Custom 模型
Use a specific 模型:
/claude-code --模型 opus explAIn this code
JSON 输出
获取 structured JSON 输出 for scripting:
/claude-code --输出-格式化 json --print "列出 all functions"
命令行工具 Reference Common Commands Command Description claude -p "查询" 查询 via SDK, then exit claude -c Continue most recent conversation claude -r "会话" "查询" 恢复 会话 by ID or name claude --print "查询" Print 响应 without interactive mode claude 更新 更新 to latest version claude auth 状态 Show authentication 状态 Useful Flags Flag Description Example --print, -p Non-interactive mode claude -p "查询" --continue, -c Continue 会话 claude -c --恢复, -r 恢复 specific 会话 claude -r 会话-id "task" --模型 Specify 模型 claude --模型 opus "task" --输出-格式化 输出 格式化 (text/json/流-json) claude -p --输出-格式化 json "task" --max-turns Limit 代理ic turns claude -p --max-turns 3 "task" --max-bud获取-usd Max API spend claude -p --max-bud获取-usd 5 "task" --添加-dir 添加itional directories claude --添加-dir ../lib "task" --mcp-config Load MCP servers claude --mcp-config ./mcp.json 环境 Variables Variable Description ANTHROPIC_API_KEY API key for authentication CLAUDE_CODE_添加ITIONAL_DIRECTORIES_CLAUDE_MD Enable CLAUDE.md from 添加itional dirs Integration with OpenClaw
This 技能 is de签名ed to work with OpenClaw's exec 工具. Here's how it integrates:
Method 1: Direct 命令行工具 Execution
Use OpenClaw's exec 工具 to 运行 Claude Code commands:
claude -p "What files were changed in the last commit?"
Method 2: 会话 Management
Manage Claude Code 会话s through OpenClaw:
# Continue last 会话 claude -c
# 恢复 specific 会话 claude -r my-会话 "Continue working on the feature"
Method 3: MCP Integration
For advanced integration, 配置 MCP servers:
claude mcp 添加
Examples Example 1: Explore a New Codebase /claude-code Explore the project structure and tell me what the mAIn 组件s are
Example 2: Fix a Bug /claude-code Find and fix the 记录in bug - users can't 记录 in with correct 凭证s
Example 3: Write Tests /claude-code Write unit tests for the payment 模块
Example 4: Refactor Code /claude-code Refactor the auth 中间件 to use a同步/awAIt
Example 5: Code Review /claude-code Review this PR for security issues
Example 6: Batch Operations /claude-code /batch 迁移 all API 端点s to use the new error 处理器
Troubleshooting Authentication Issues # 检查 auth 状态 claude auth 状态
# Re-认证 claude auth 记录in
权限 Issues # 运行 with specific 权限 mode claude --权限-mode plan "task"
会话 Issues # 列出 avAIlable 会话s claude --恢复
# Fork a 会话 (创建 new) claude -r old-会话 --fork-会话 "new task"
Advanced Features Sub-代理s
运行 multiple Claude Code instances in parallel:
claude --代理s '{ "reviewer": { "description": "Code reviewer", "prompt": "You are a senior code reviewer", "工具s": ["Read", "Grep", "Bash"] } }'
Hooks
Automate actions before/after Claude Code 运行s:
See Hooks documentation
MCP Servers
Connect Claude Code to external 工具s:
claude mcp 添加 github '{"github_令牌": "..."}'
Resources Official Docs 命令行工具 Reference 技能s 图形界面de MCP Documentation Common 工作流s
Note: Claude Code requires authentication. 运行 claude auth 记录in before first use.