Claude Code CLI for Openclaw

A native integration that allows OpenClaw agents to use the official Anthropic Claude Code CLI for precise, token-efficient, and cost-effective development.

asif2bd
v1.0.2
Mar 14, 2026
0
1.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install claude-code-cli-openclaw

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install claude-code-cli-openclaw using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Claude Code CLI?

Claude Code CLI for OpenClaw is a specialized skill designed to bridge the gap between AI agents and professional development environments. By utilizing the official Anthropic command-line interface, this skill enables agents to perform file-based context exploration and precise code edits without the massive token overhead typical of raw API calls. It is an essential addition to the Openclaw Skills ecosystem for developers seeking to maintain high code quality while taking advantage of Claude Max flat-rate billing.

The skill provides a standardized way for agents to install, authenticate via OAuth, and manage project-specific context through a CLAUDE.md file. This ensures that every coding session is grounded in the project's specific architecture and coding standards, making the agent a more effective and reliable collaborator in complex software projects.

Claude Code CLI Use Cases

  • Reducing operational costs by switching from per-token API billing to flat-rate Claude Max subscriptions
  • Performing large-scale refactoring across multiple files with minimal context window usage
  • Scaffolding new modules or features while adhering to existing project standards defined in the project brain
  • Automating code reviews and bug fixes using native codebase exploration tools

How Claude Code CLI Works

  1. The OpenClaw agent initializes the skill to verify the global installation of the @anthropic-ai/claude-code package.
  2. Authentication is handled via a secure OAuth flow, storing a long-lived token in the agent's environment.
  3. When a task is assigned, the agent navigates to the project root and reads the CLAUDE.md file to synchronize with project rules.
  4. The agent executes specific coding tasks using the cli-backend, allowing Claude to read and edit files locally using precise diffs.
  5. All changes are validated through local build or test commands before being committed to the version control system.

Claude Code CLI Setup

Install the CLI

Begin by installing the official Anthropic Claude Code package globally via npm:

npm install -g @anthropic-ai/claude-code

Authentication

Run the setup command to link your Claude Max subscription. This requires a TTY-enabled terminal for the browser-based OAuth flow:

claude setup-token

OpenClaw Integration

Add the following configuration to your config.patch to enable the CLI as a backend for Openclaw Skills agents:

{
  "agents": {
    "defaults": {
      "cliBackends": {
        "claude-cli": {
          "command": "/usr/bin/claude",
          "env": { "CLAUDE_CODE_OAUTH_TOKEN": "YOUR_TOKEN_HERE" }
        }
      }
    }
  }
}

Claude Code CLI Data Schema & Taxonomy

Resource Type Description
CLAUDE.md Markdown File The persistent project brain containing tech stack details and coding standards.
CLAUDE_CODE_OAUTH_TOKEN Env Var The long-lived sk-ant-oat01 token used for authenticated CLI access.
claude-cli/sonnet-4.6 Model Alias High-speed model configuration for general coding tasks.
claude-cli/opus-4.6 Model Alias High-reasoning model configuration for architectural changes.

Claude Code CLI Advanced Features

  • Automated project context synchronization via the CLAUDE.md project brain template
  • Support for non-interactive --print mode for seamless agent-to-CLI communication
  • Multi-model flexibility allowing agents to switch between Sonnet and Opus based on task complexity
  • Integration with MissionDeck.ai for centralized tracking of all Claude Code sessions and edits

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*