Install
openclaw skills install claude-code-openclaw-skillIntegrate OpenClaw with Claude Code CLI to read, edit, run commands, review, and automate workflows on your codebase using AI assistance.
openclaw skills install claude-code-openclaw-skillCall Claude Code CLI from OpenClaw to read codebase, edit files, run commands, and automate coding tasks.
This skill provides integration with Claude Code CLI, allowing OpenClaw to leverage Claude Code's powerful coding capabilities including:
Install Claude Code CLI:
curl -fsSL https://claude.ai/install.sh | bash
Authenticate:
claude auth login
Verify installation:
claude --version
Ask Claude Code a question about your codebase:
/claude-code What does the auth module do?
Execute a coding task:
/claude-code write tests for the login function
Resume the most recent conversation:
/claude-code --continue
Resume a session by name or ID:
/claude-code --resume auth-fix
Review code changes:
/claude-code review the recent changes
Commit changes with a descriptive message:
/claude-code commit my changes
Use a specific model:
/claude-code --model opus explain this code
Get structured JSON output for scripting:
/claude-code --output-format json --print "list all functions"
| Command | Description |
|---|---|
claude -p "query" | Query via SDK, then exit |
claude -c | Continue most recent conversation |
claude -r "session" "query" | Resume session by ID or name |
claude --print "query" | Print response without interactive mode |
claude update | Update to latest version |
claude auth status | Show authentication status |
| Flag | Description | Example |
|---|---|---|
--print, -p | Non-interactive mode | claude -p "query" |
--continue, -c | Continue session | claude -c |
--resume, -r | Resume specific session | claude -r session-id "task" |
--model | Specify model | claude --model opus "task" |
--output-format | Output format (text/json/stream-json) | claude -p --output-format json "task" |
--max-turns | Limit agentic turns | claude -p --max-turns 3 "task" |
--max-budget-usd | Max API spend | claude -p --max-budget-usd 5 "task" |
--add-dir | Additional directories | claude --add-dir ../lib "task" |
--mcp-config | Load MCP servers | claude --mcp-config ./mcp.json |
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY | API key for authentication |
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD | Enable CLAUDE.md from additional dirs |
This skill is designed to work with OpenClaw's exec tool. Here's how it integrates:
Use OpenClaw's exec tool to run Claude Code commands:
claude -p "What files were changed in the last commit?"
Manage Claude Code sessions through OpenClaw:
# Continue last session
claude -c
# Resume specific session
claude -r my-session "Continue working on the feature"
For advanced integration, configure MCP servers:
claude mcp add <server-name> <config>
/claude-code Explore the project structure and tell me what the main components are
/claude-code Find and fix the login bug - users can't log in with correct credentials
/claude-code Write unit tests for the payment module
/claude-code Refactor the auth middleware to use async/await
/claude-code Review this PR for security issues
/claude-code /batch migrate all API endpoints to use the new error handler
# Check auth status
claude auth status
# Re-authenticate
claude auth login
# Run with specific permission mode
claude --permission-mode plan "task"
# List available sessions
claude --resume
# Fork a session (create new)
claude -r old-session --fork-session "new task"
Run multiple Claude Code instances in parallel:
claude --agents '{
"reviewer": {
"description": "Code reviewer",
"prompt": "You are a senior code reviewer",
"tools": ["Read", "Grep", "Bash"]
}
}'
Automate actions before/after Claude Code runs:
Connect Claude Code to external tools:
claude mcp add github '{"github_token": "..."}'
Note: Claude Code requires authentication. Run claude auth login before first use.