← Back to Practice

Complete Guide: OpenClaw with Claude Code & Lark Bot

From architecture to command-line practice — a comprehensive breakdown of how OpenClaw, Claude Code, and Lark Bot work together

Complete Guide: OpenClaw with Claude Code and Lark Bot

This guide explains how OpenClaw, Claude Code, and a Lark bot can work together as one operating loop.

The goal is not to make one tool do everything. The goal is to let each tool handle the layer it is good at.

Roles

ComponentRoleCore capability
Claude CodeLocal coding agentReads and edits code, runs shell commands, uses Git, and handles engineering tasks
OpenClawLocal AI gateway and channel hubConnects Telegram, Lark, Discord, and other channels; dispatches models and tools
Lark botCollaboration interfaceSends and receives team messages, docs, and operational updates

Collaboration mode

The practical workflow is:

  1. Send an instruction from Telegram or Lark.
  2. OpenClaw receives the message.
  3. OpenClaw can spawn Claude Code as a local subprocess through ACP.
  4. Claude Code performs the engineering task on the machine.
  5. OpenClaw sends the result back to the chat.

The important point is that Claude Code remains local and capable, while OpenClaw handles channel access and routing.

Binding a chat to Claude Code

To bind the current chat to Claude Code:

/acp spawn claude --bind here

This creates a Claude ACP session in the current chat. Messages sent after that can be forwarded directly to Claude Code, and Claude works in the configured local workspace.

Persistent threads

For larger tasks, use a persistent thread:

/acp spawn claude --mode persistent --thread auto

This keeps intermediate progress, results, and follow-up context in a dedicated topic instead of polluting the main chat.

One-shot execution

For short tasks:

/acp spawn claude --mode oneshot

This is useful for one-off work such as reviewing a pull request, generating a short report, or checking a repository state.

Common ACP commands

CommandPurpose
/acp statusCheck the current ACP binding
/acp cancelCancel the running task
/acp closeClose the session and unbind
/acp doctorCheck ACP health

Using Claude with Lark operations

Claude Code does not directly need to own Lark tools. A clean split is:

  1. OpenClaw handles Lark messages, documents, and bot identity.
  2. Claude Code handles coding, debugging, and local file work.
  3. OpenClaw takes Claude’s output and sends it into Lark.

This avoids mixing channel permissions into the coding agent.

Example: engineering daily report

  1. Bind Claude in Telegram:
/acp spawn claude --bind here
  1. Ask Claude to draft the report:
Write a daily engineering update:
- Done: fixed the login bug
- In progress: refactoring the order module
- Blocked: waiting for design
  1. Ask OpenClaw to send the result to the target Lark group.

OpenClaw uses the configured bot identity to send the message.

Bot identity

Using a bot identity is operationally stable:

  • no personal login session expiration
  • predictable permission scope
  • suitable for scheduled or background workflows
  • easier to audit than user-level automation

Use Claude Code as the local engineering worker.

Use OpenClaw as the gateway and dispatcher.

Use Lark as the collaboration surface.

That split keeps the system composable without forcing one agent to own every integration.

Share