claude-code-skill
Control Claude Code via MCP protocol. Execute commands, read/write files, search code, and use all Claude Code tools programmatically with agent team support.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/enderfga/openclaw-claude-codeWhat This Skill Does
The claude-code-skill allows OpenClaw agents to interact deeply with Claude Code, a powerful AI coding assistant, using the Model Context Protocol (MCP). This skill enables programmatic control over Claude Code's capabilities, including executing commands, reading and writing files, searching through codebases, and leveraging all of Claude Code's specialized tools. A key feature is the ability to establish persistent sessions, which maintain context across multiple interactions, making them ideal for complex, multi-step tasks, iterative development cycles, and long-running agent operations where continuous context is crucial. For simpler, one-off tasks, direct MCP tool calls can be made without the overhead of a persistent session. This skill bridges the gap between an AI agent's decision-making and Claude Code's advanced code manipulation and analysis features, offering a robust solution for AI-assisted software development and code management.
Installation
To install the claude-code-skill, use the following command:
clawhub install openclaw/skills/skills/enderfga/openclaw-claude-code
This skill is maintained within the openclaw/skills source repository.
Use Cases
This skill is exceptionally versatile and can be employed in a variety of scenarios:
- Persistent Sessions: Ideal for multi-step coding tasks, refactoring projects, debugging complex issues, writing tests alongside code, and any scenario where an agent needs to maintain context over an extended period. It supports agent teams, allowing multiple agents to collaborate within a single Claude Code session. Features like custom API endpoints, permission modes (e.g.,
planto preview changes,acceptEditsfor automatic application), tool whitelisting, budget limits, and custom system prompts enhance control and safety. - Direct MCP Tools: Useful for quick, single-purpose actions such as executing a single shell command (
bash), reading the content of a specific file (read), finding files matching a pattern (glob), searching for text within files (grep), or writing content to a file (call Write). These are suited for atomic operations where session persistence is unnecessary.
Example Prompts
Here are three example prompts a user might send to OpenClaw:
- "Start a persistent session named 'backend-refactor' in the
~/dev/backenddirectory, allowing only Bash and Write tools, and set the maximum budget to $3.00." - "In the 'backend-refactor' session, find all functions related to user authentication and refactor them to use a new JWT library."
- "Quickly read the contents of the
config.yamlfile located in/etc/app."
Tips & Limitations
- Session Management: Actively manage your persistent sessions. Use
session-statusto monitor progress andsession-stop(though not explicitly listed in the reference, it's a logical counterpart) to end sessions when complete to free up resources. - Permission Modes: Carefully choose the
permission-mode.planoffers a good balance of automation and control, whileacceptEditscan accelerate workflows but requires trust in the agent's actions.bypassPermissionsshould be used with extreme caution. - Tool Whitelisting: Use
--allowed-toolsto restrict the tools Claude Code can access, enhancing security and ensuring the agent only performs intended operations. For example,Bash(git:*)restricts Bash commands to only those starting withgit. - Budgeting: Monitor the
--max-budgetto control costs, especially when using cloud-based Claude Code instances. - Context Window: Be mindful of Claude Code's context window limitations, even with persistent sessions. Extremely long conversations or massive codebases might eventually lead to context degradation.
- Error Handling: While the skill enables programmatic control, robust error handling within your agent's logic is recommended to manage unexpected outputs or tool failures from Claude Code.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-enderfga-openclaw-claude-code": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution, external-api