OpenClaw Config File: Every Field Explained with Examples
Your OpenClaw agent is sitting idle. You ask it to check your calendar, and it says it can’t find your API key. You tell it to run a daily report, and it doesn’t know where to save the file. This is a config problem.
The openclaw.json file is your agent’s brain. Without it, your Claw is smart but useless. It needs that file to know who it is, what tools it can use, and how to connect to your world. Getting your openclaw config right is the single step between a toy and a working assistant.
Most guides just dump a JSON example on you. This one is different. We explain every field, why it exists, and what happens if you change it. You’ll walk away knowing how to turn a basic setup into a custom powerhouse. You’ll stop guessing and start building.
What You Need Before Starting
Think of this like packing for a trip. You don’t need everything in your house, just the specific tools that make the journey possible. Missing one item means you’re stuck before you begin. Here’s your packing list.
- A Running OpenClaw Agent: You need the Claw software itself. This article is about its brain (the config file). You can’t configure a brain that doesn’t exist. If you don’t have this, the first step is to install it.
- Access to Your Project Directory: The
openclaw.jsonfile lives in your agent’s home folder. You need to be able to navigate there and edit files. This is your agent’s workspace. - A Text Editor You Can Use in a Terminal:
nano,vim, orcodefor VS Code. You will be editing a JSON file directly. A proper editor helps you avoid syntax errors that break everything. - Your API Keys and Service Credentials: This is the whole point. The config file connects your agent to the outside world. Have your OpenAI key, Google service account file, or database URLs handy. If you don’t have them yet, we’ll show you where to get them.
Setting Up Your Environment
This is prep work. You’re clearing the desk so you can focus on the important part: building the config. We’ll do this in two minutes. If your Claw is already running, you can command it to do most of this for you. That’s the point.
Locate Your OpenClaw Directory
Your agent needs to know where its home is. All its memory, tools, and this config file live here. We’re going to find it and move there.
You are my OpenClaw agent. Do the following:
1. Tell me the full path to your current working directory. This is where your `openclaw.json` file should be.
2. List the files in this directory so I can see if `openclaw.json` already exists.
3. If the file doesn't exist, create a basic template for me.
Your agent will print the directory path and a file list. Look for openclaw.json. If it’s not there, the agent will create a starter file. You’re now in the right place.
Manual Fallback: If your agent isn’t running yet, open your terminal and run cd ~/.openclaw (Linux/macOS) or cd %USERPROFILE%\.openclaw (Windows). Then run ls -la or dir to check for the file.
Back Up Any Existing Config
If you’ve been experimenting, you might have an old config. We don’t want to lose your work. This step copies it to a safe place with a timestamp, like taking a snapshot before you start remodeling.
You are my OpenClaw agent. Do the following:
1. Check if `openclaw.json` exists in the current directory.
2. If it exists, create a backup copy. Use this exact command: `cp openclaw.json "openclaw.json.backup.$(date +%Y%m%d_%H%M%S)"`
3. Confirm the backup was created by listing files that start with 'openclaw.json'.
You’ll see a message confirming the backup file was created, like openclaw.json.backup.20260407_1420. Now you can edit freely. If something breaks, you can restore this file.
Manual Fallback: In your terminal, run: cp openclaw.json "openclaw.json.backup.$(date +%Y%m%d_%H%M%S)"
Open the Config File for Editing
Time to look under the hood. We’re opening the file in your terminal’s text editor. This keeps everything in one place. If you hate terminal editors, it’s okay. The next step gives you an alternative.
You are my OpenClaw agent. Open the `openclaw.json` file in the `nano` text editor so I can view and edit it. Wait for my further instructions.
Your terminal will switch to the nano editor showing the JSON content. Don’t panic if you see a lot of text or a mostly empty file. We’ll explain it all next.
Permission-Giving Alternative: If you prefer a graphical editor like VS Code, just tell your agent: “Show me the full path to openclaw.json.” Then open that path in your desktop editor. The goal is to have the file ready to edit in the next section.
