Skip to content

Instantly share code, notes, and snippets.

@genewoo
Created March 22, 2026 03:25
Show Gist options
  • Select an option

  • Save genewoo/b6c7383dffacbfcd960cacf24a3ebc63 to your computer and use it in GitHub Desktop.

Select an option

Save genewoo/b6c7383dffacbfcd960cacf24a3ebc63 to your computer and use it in GitHub Desktop.
CLAUDE for OpenClaw Editing

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

OpenClaw Configuration Directory

This is the OpenClaw configuration directory (~/.openclaw). The main configuration file is openclaw.json.

Editing Configuration

The openclaw.json file controls:

  • Agents: Defined in agents.list - each agent has its own workspace and skills
  • Channels: Telegram, iMessage, Feishu - with multi-account support
  • Bindings: Route agents to specific channel accounts
  • Models: Zai (GLM-5, GLM-4.7) provider configuration
  • Gateway: Port, auth, control UI settings

Important: Always validate JSON syntax after editing. OpenClaw creates backups automatically (.bak files).

Directory Structure

  • openclaw.json - Main configuration file
  • agents/ - Agent-specific directories (main, coding)
  • workspace/ - SKIP - Default agent workspace (contains skills, memory, identity docs)
  • workspace-coding/ - SKIP - Coding agent workspace
  • logs/ - Gateway and agent logs
  • telegram/ - Telegram runtime data (sticker cache, etc.)

Common Commands

# Start the gateway (runs all configured channels)
openclaw gateway

# Check channel status
openclaw channels status

# View logs
openclaw logs --follow

# Edit configuration (opens in $EDITOR)
openclaw config edit

# Validate configuration
openclaw doctor

Agent Workspaces

Each agent has its own workspace with isolated sessions:

  • main$HOME/.openclaw/workspace/

Configuration Reload

Most configuration changes require gateway restart:

  1. Stop the gateway (Ctrl+C or kill process)
  2. Edit openclaw.json
  3. Restart with openclaw gateway

Some channel settings support hot-reload via openclaw channels reload.

Verification

Always validate configuration changes before starting the gateway:

# Check configuration syntax and validate settings
openclaw doctor

# Check specific channel status
openclaw channels status

# View logs for validation errors
openclaw logs --follow

Run openclaw doctor after editing openclaw.json to catch schema errors, invalid bindings, or misconfigured channels before restart.

Model Provider

Uses Zai provider with GLM models:

  • Primary: zai/glm-5 (alias: "GLM")
  • Fallback: zai/glm-4.7, zai/glm-4.7-flash

Model configuration is in models.providers.zai.

References

OpenClaw documentation is installed with the package. Use these general paths to find authoritative information:

  • Channel Documentation: /opt/homebrew/lib/node_modules/openclaw/docs/channels/
    • Individual channel guides (telegram.md, imessage.md, feishu.md, etc.)
    • Channel-specific configuration examples and troubleshooting
  • Configuration Reference: /opt/homebrew/lib/node_modules/openclaw/docs/gateway/
    • Full schema reference for gateway and channel settings
    • Multi-agent routing and binding patterns
  • Type Definitions: /opt/homebrew/lib/node_modules/openclaw/dist/plugin-sdk/config/
    • TypeScript definitions for all configuration schemas

When updating configuration patterns, search these directories for current examples and syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment