Explaining OpenClaw Folder Structure


Introduction

Most beginners starts learning OpenClaw by directly building AI agents. Honestly which is not a good way.  Before writing a single line of code you should understand how OpenClaw is actually organized first. Every folder inside OpenClaw has its own responsibility. If you understand what each folder does, then later you can easily understand not only OpenClaw but almost any modern AI Agent framework.

OpenClaw follows a structured architecture where every component has a fixed purpose.

OpenClaw
│
├── Gateway
├── Dashboard
├── Workspace
├── Config
├── Sessions
├── Models
├── Skills
└── Logs

Lets understand this by example of a software company, Every department has a different job and together they make the whole system work.

1. .openclaw/

The .openclaw folder is probably the most important directory in the entire OpenClaw ecosystem.  You can think of it as the brain, memory, and personal storage of your AI.

On Windows it is usually saved at:

C:\Users\<username>\.openclaw

Inside this folder you will generally find something like this:

.openclaw
│
├── workspace/
├── logs/
├── skills/
├── openclaw.json
├── sessions/
├── cache/
└── ...

Don't delete this folder unless you know what you're doing.  If this folder gets deleted OpenClaw will behave almost like a fresh installation. Previous sessions, configuration, history, cached information, and a lot of runtime state may disappear.  This directory stores configuration files as well as runtime data that OpenClaw continuously maintains while it is running.

Understand by examples of:

Technology Important Folder
Windows C:\Windows
Linux /etc
Python venv
OpenClaw .openclaw

2. Gateway

Many people simply call Gateway a server but that's only partially correct Gateway is actually the heart of OpenClaw Every request which is prompted by User Interface is passes through it.

Imagine this flow:

WhatsApp
      ↓
 Gateway
      ↓
  AI Model
      ↓
   Tools
      ↓
  Memory
      ↓
 Response

Gateway decides:

  • Which model should be used
  • Which tool should execute
  • Where the session should be stored
  • What data should be sent to the Dashboard
  • Where logs should be written

It also reads and validates the configuration before the system starts.  The complete flow looks something like this:

User
   ↓
Gateway
   ↓
 Model
   ↓
 Tool
   ↓
Workspace
   ↓
 Memory
   ↓
Gateway
   ↓
Dashboard
   ↓
 User

Without Gateway, OpenClaw simply cannot function.

3. Dashboard

Dashboard is only the user interface which does not think, does not make decisions but It simply displays information.  Dashboard usually shows:

  • Logs
  • Sessions
  • Models
  • Configuration
  • Workspace
  • Memory
  • Tools

4. Workspace

Workspace is basically the AI's office.  Imagine a software company.

Company
    ↓
 Office
    ↓
Projects
    ↓
 Files
    ↓
Documents

OpenClaw follows a similar idea.

Workspace
     ↓
 Projects
     ↓
   Files
     ↓
Knowledge
     ↓
Temporary Data

Whenever the AI creates files, builds projects, generates reports, or reads documents, most of that work happens inside the Workspace.  The default Workspace location can also be configured through the configuration file.

5. Config

Configuration is the soul of OpenClaw.  Almost every important setting is controlled from here.  Usually you'll find a file like:

openclaw.json

This file tells OpenClaw:

  • Which model to use
  • Which provider to connect
  • Which Workspace should be used
  • Which port to run
  • Memory settings
  • Runtime options

If the configuration is invalid, OpenClaw may refuse to start.  Gateway performs strict schema validation before booting.  A simple configuration decides whether you're using:

  • Gemin
  • Ollama
  • Claude
  • or another supported provider

6. Modeles

OpenClaw is NOT an AI model, OpenClaw simply manages AI models.

Think like this:

OpenClaw
      ↓
 Uses
      ↓
Gemini
Claude
OpenAI
Ollama
Qwen
Llama

Imagine a company.  The manager assigns work.  Employees complete the work.  Similarly OpenClaw is the manager and the AI models are the workers.

7. Sessions

A Session is basically the memory of one conversation.

Example:

You
 ↓
Hello
 ↓
AI
 ↓
Hi
 ↓
You
 ↓
Build a website
 ↓
AI

Everything above belongs to one session.  If a session is deleted, the conversation history is usually lost.

8. Logs

Most beginners ignore logs.  Experienced developers almost always check them first Logs are basically the diary of the Gateway everything important gets recorded.

example:

  • Gateway Started
  • Model Loaded
  • Skill Loaded
  • Tool Executed
  • Error Messages
  • Memory Saved

Commands like:

openclaw logs

or log-following commands are commonly used during debugging.

9. Skills Folder

Don't try to build Skills yet firstly understand how they work.

A typical Skills folder looks something like this:

skills/
│
├── Browser
├── Github
├── Gmail
└── Search

Inside each Skill folder, you'll usually find a file called SKILL.md.  This is not a source code. Instead, it's a Markdown file that contains instructions telling OpenClaw what the Skill does, when it should be used, and which tool it can call. You can think of it as a job description for the AI.

OpenClaw loads Skills in a fixed priority order:

Workspace
      ↓
Personal
      ↓
Managed
      ↓
Bundled
      ↓
Extra Directories

This loading order is important because if two Skills have the same name, OpenClaw will use the one with the higher priority. For example, a Skill inside your Workspace can override the default bundled version.

0 Comments Report