OpenClaw configuration directory
OpenClaw configuration directory
All configurations, state data, workspaces, and skills for OpenClaw (also known as Clawdbot) are centralized in the core directory ~/.openclaw/ (Linux/macOS) or %USERPROFILE%.openclaw\ (Windows) under the user's home directory.
~/.openclaw/ is the root configuration directory for the entire system and is automatically created when openclaw onboard or openclaw onboard --install-daemon is installed/run for the first time.
Original prompt (Chinese, left untranslated)
~/.openclaw/
├── openclaw.json # 主配置文件(JSON/JSON5)
├── workspace/ # 你的 AI “灵魂”文件夹(推荐 git 版本控制)
│ ├── SOUL.md # 人格设定(语气、风格)
│ ├── USER.md # 你的个人信息(让 AI 更懂你)
│ ├── MEMORY.md # 长期记忆(手动可编辑)
│ ├── IDENTITY.md # Agent 名称、形象
│ ├── AGENTS.md # 多 Agent 路由规则
│ ├── BOOT.md # 启动提示词
│ ├── HEARTBEAT.md # 每日检查清单
│ └── skills/ # 已安装技能(每个技能一个子文件夹)
├── agents/<cid>/ # 每个 Agent 的独立状态
├── memory/<cid>.sqlite # 向量记忆库
├── credentials/ # API Key、OAuth(旧版)
├── skills/ # 全局技能包
└── secrets.json # 加密凭证(可选)
Most important files:
openclaw.json: Global settings (models, channels, ports, security policies)workspace/All under.mdFile:It takes effect in real-time by editing directly in VS Code!
View/modify configuration command:
Original prompt (Chinese, left untranslated)
openclaw configure # 交互式配置向导
openclaw config file # 显示完整路径
openclaw config get agent.model
openclaw config set agent.model "anthropic/claude-3-5-sonnet"
openclaw config validate # 校验合法性
| Path | Description of use |
|---|---|
~/.openclaw/openclaw.json |
Main configuration file(Most important!) |
Original prompt (Chinese, left untranslated)
存储全局设置(模型、Gateway 模式、绑定地址、Agents 默认值、插件等)。
Available commands to view/modify:
• `openclaw config file`(显示完整路径)
• `openclaw config get <json路径>`
• `openclaw config set <json路径> <值>` |
|~/.openclaw/workspace/|Default Workspace(The location of the Agent's "soul")
Stores the following Markdown files (editable for immediate effect):
•SOUL.md: AI personality/tone settings
•USER.mdYour personal preferences and background
•MEMORY.mdLong-term memory records
•AGENTS.mdInstruction description
•IDENTITY.mdName/Topic
•BOOT.mdStartup Configuration
•HEARTBEAT.mdPeriodic Check List | |~/.openclaw/agents/<cid>/| Agent Status Directory (<cid>By Instance ID) | |~/.openclaw/agents/<agentId>/agent/auth-profiles.json|API Key & OAuth Credentials(Recommended location for new versions)
The old version may be in~/.openclaw/credentials/| |~/.openclaw/memory/<cid>.sqlite| Vector index storage (for memory search) | |~/.openclaw/skills/|Global skill directory
Skills throughopenclaw skills installorclawhub installinstalled skill packages are placed here (each skill is a subfolder containing SKILL.md) | |~/.openclaw/memory/| Long-term memory related files (SQLite + vector embeddings) |/tmp/openclaw/*.log| Gateway service logs (for debugging) |
1. Main configuration file
Path: ~/.openclaw/openclaw.json
Description:OpenClaw's core configuration file, containing all system-level settings.
Main configuration items:
- gatewayGateway service configuration
modeGateway mode (e.g., "local")portGateway port number (default 18789)bindBind address (default 127.0.0.1)tokenAccess token, used for Web UI authentication
- modelsAI model configuration
- Default model settings
- API authentication information
- messages- Message processing configuration
- TTS (Text-to-Speech) settings
- Message format configuration
Example configuration snippet:
{
"gateway": {
"mode": "local",
"port": 18789,
"bind": "127.0.0.1",
"token": "c9917c5a066beeb26266d09baed99495e7563b33c771e89a"
}
}
Operational suggestions:
- After the first installation, it is generated automatically by
openclaw onboardThe wizard - Restart the gateway service to take effect after modifying the configuration
- The token value is used for Web UI access, please keep it safe
2. Workspace directory
Path: ~/.openclaw/workspace/
Description:The default working directory for OpenClaw, where all AI-generated files, temporary files, and user-requested output files are stored.
Main uses:
- Default location for AI agent file reading and writing
- Code execution output storage
- Document generation and editing
- Temporary data storage
Permission description:
- By default, AI can only access this directory and its subdirectories
- To access other paths, configuration is required
filesystem-mcpof skills and granting additional permissions - Windows users may need to copy files from the workspace to another location
Usage suggestions:
- Regularly clean up unnecessary temporary files
- Important outputs should be backed up outside the workspace
- You can create project subdirectories here for organization and management
3. Agent State Directory
Path: ~/.openclaw/agents/<cid>/
Description:Storage directory for the agent's state and configuration for each conversation.<cid>Is the conversation ID; each conversation has an independent configuration space.
Directory structure:
Original prompt (Chinese, left untranslated)
~/.openclaw/agents/<cid>/
├── agent/
│ ├── auth-profiles.json # 该会话的 OAuth 和 API 密钥
│ └── ...
└── ...
auth-profiles.json Description:
- Stores the API authentication information used by the agent
- OAuth token for various services
- The new version uses this path, the old version is stored in
~/.openclaw/credentials/
Data isolation:
- Authentication information for each session is independent
- Different API keys can be configured for different sessions
- Supports parallel execution of multiple agents
4. Authentication Credential Directory (Old Version)
Path: ~/.openclaw/credentials/
Description:Credential storage location of the old version of OpenClaw.
Migration instructions:
- The new version has been migrated to
~/.openclaw/agents/<agentId>/agent/auth-profiles.json - After upgrading from the old version, credentials may need to be reconfigured.
- It is recommended to use
openclaw models auth setupReset
5. Memory storage directory
Path: ~/.openclaw/memory/
Description:Storage location for OpenClaw's persistent memory system, including vector indexes and conversation history.
Main files:
-
<cid>.sqlite- Vector index database - Stores semantic vectors of conversations
- Supports semantic search functionality
- Used for long-term memory retrieval
-
YYYY-MM-DD.md- Daily conversation logs - Markdown file named by date
- Records all conversation content of the day
- Convenient for manual viewing and archiving
Memory function:
- Vector search:Usage
memory search "关键词"Search history conversations - Context association:Supports cross-session context understanding
- Long-term memory:The agent will "remember" user preferences and habits
Maintenance suggestions:
- Regularly back up the memory directory
- Large databases may affect performance; consider regular archiving.
- Log files can be used for auditing and troubleshooting.
6. Skill Directory
Path: ~/.openclaw/skills/
Description:Installation location for globally shared Skills. Skills are plugins that extend OpenClaw functionality.
Skill Management:
- Install Skills:
npx clawhub install <skill-name> - List skills:
openclaw skills list - Search skills:
npx clawhub search <关键词>
Common skill examples:
filesystem-mcp- File system operationsgithub- GitHub integrationnano-pdf- PDF editingnotion/obsidian- Note synchronizationweather- Weather Querysummarize- Content Summary Generation
Skill Ecosystem:
- The community skill library ClawHub provides 500+ skills
- Supports custom skill development
- Skills can access external APIs and system resources
Configuration Instructions:
- Each skill may require separate API Key configuration
- Some skills depend on system tools (such as GitHub CLI)
- macOS-specific skills are unavailable on Windows/Linux
7. Gateway log directory
Path: /tmp/openclaw/*.log
Description:Runtime logs for the gateway service, stored in the system temporary directory.
Log types:
- Gateway startup/shutdown logs
- API Request/Response Logs
- Error and Exception Logs
- Performance Monitoring Information
Log Management:
- Logs in temporary directories may be cleared after system restart
- Usage
openclaw gateway --verboseDetailed logs can be viewed - When troubleshooting, you should first check the log files
Gateway Service Management:
Original prompt (Chinese, left untranslated)
openclaw gateway start # 启动网关
openclaw gateway status # 查看状态
openclaw gateway stop # 停止网关
Other Important Files
USER.md
Path:Usually located in the workspace or a user-defined location
Description:User information file, containing personalized information about the user to help the AI better understand user needs.
Content Example:
- User Preferences
- Common Workflows
- Project Background Information
- Custom Instructions
Configuration File Management Best Practices
1. Backup Strategy
Key Directory Backup:
Original prompt (Chinese, left untranslated)
# 备份整个配置目录
tar -czf openclaw-backup-$(date +%Y%m%d).tar.gz ~/.openclaw/
# Only backup core configurations
cp ~/.openclaw/openclaw.json ~/backups/
cp -r ~/.openclaw/memory/ ~/backups/memory/
Suggested Backup Frequency:
- Main configuration file: after each modification
- Memory database: once a week
- Skill configuration: after installing a new skill
2. Security recommendations
Sensitive information protection:
openclaw.jsonContains gateway token, should not be publicauth-profiles.jsonContains API keys, requires encrypted protection- Periodically change API keys
- Do not commit configuration files to version control systems
Permission settings:
Original prompt (Chinese, left untranslated)
# 确保配置目录仅用户可访问
chmod 700 ~/.openclaw/
chmod 600 ~/.openclaw/openclaw.json
chmod 600 ~/.openclaw/agents/*/agent/auth-profiles.json
3. Migration and upgrade
Version upgrade notes:
- Back up the entire
~/.openclaw/directory - Check release notes to understand configuration changes
- Old version credentials may need to be migrated
Cross-device synchronization:
- Configuration files can be synchronized to achieve consistency across multiple devices
- Note path differences (Windows vs Unix)
- Sensitive information is recommended to be configured separately
4. Troubleshooting
Diagnosing configuration issues:
Original prompt (Chinese, left untranslated)
# 检查配置文件语法
cat ~/.openclaw/openclaw.json | json_pp
# Deep check
openclaw doctor --deep
# Check gateway status
openclaw gateway status
Common issues:
- Authentication failure:Run
openclaw models auth setupReconfigure - Gateway failed to start:Check port occupation, view log files
- Skill cannot be used:Confirm skill dependencies are installed, check API keys
Environment variable configuration
OpenClaw support can be configured via environment variables:
Original prompt (Chinese, left untranslated)
# API 密钥环境变量
export ANTHROPIC_API_KEY="your-key-here"
export OPENAI_API_KEY="your-key-here"
export DEEPSEEK_API_KEY="your-key-here"
# Custom configuration directory
export OPENCLAW_HOME="~/custom-path/.openclaw"
Environment variable priority:
- API Keys in environment variables will be automatically detected by the onboard guide
- Can override default values in configuration files
- Suitable for CI/CD environments and containerized deployments
Network and deployment configuration
Local deployment
Default configuration:
- Binding address: 127.0.0.1 (local access only)
- Gateway port: 18789
Access method:
http://127.0.0.1:18789/#token=<your-token>
Cloud deployment
OpenClaw supports deployment on cloud servers:
Supported platforms:
- Alibaba Cloud:https://www.aliyun.com/activity/ecs/clawdbot
- Tencent Cloud:https://cloud.tencent.com/developer/article/2624973
- 1Panel
- Docker Containers
Cloud configuration features:
- Requires public network access configuration
- Firewall rules may need to be configured
- Supports domain binding and SSL certificates
Platform integration configuration
OpenClaw supports multiple instant messaging platforms:
Supported platforms
- Overseas:WhatsApp, Telegram, Discord, Slack, iMessage
- Domestic:Feishu, DingTalk
Configuration location
Chat channel configurations are stored inopenclaw.json, including:
- Channel type (Slack/Feishu, etc.)
- Authentication Token
- Channel Whitelist/Blacklist
- Response Mode (DM/Group Chat)
Configuration Management
Original prompt (Chinese, left untranslated)
# 添加新渠道
openclaw channels add
# List configured channels
openclaw channels list
# Pairing Management
openclaw pairing list
openclaw pairing approve <platform> <code>