Agent Programming Lab · Markdown-First

Program Your OpenClaw Agent with Markdown

OpenClaw is programmed through plain-text Markdown files — not code. This “vibe coding” approach lets anyone define an agent's personality, operating rules, and memory strategy without writing a single line of JavaScript.

Hostinger
OpenClaw

One Click OpenClaw Install Hostinger VPS

Automate your workflow with 24/7 AI agents. Optimized for Hostinger KVM 2 plans.

Starts at$7/mo
Start Installation →
checkVerified Setup 2026

How do you program an OpenClaw AI agent?

Create a SOUL.md file to define the agent's personality and tone, and an AGENTS.md file for its procedural operating rules. These Markdown files are injected into every session, giving the AI agent a stable identity and consistent behaviour across all messaging platforms.

The OpenClaw Workspace File System

FileFunctionExample Value
SOUL.mdCharacter & Tone"You are chaotic-good. Use natural wit."
AGENTS.mdProcedural Rules"Always run pnpm test before committing."
USER.mdStatic Context"The user prefers concise replies in the morning."
TOOLS.mdCapability Map"Set browser timeout to 300s for complex JS."
BOOTSTRAP.mdMorning Routine"Check Slack for mentions from the CEO."
MEMORY.mdLong-Term WisdomAuto-generated distilled memory from daily logs.

SOUL.md — The Agent's Character Sheet

SOUL.md is the first file injected into every session. It defines tone, opinions, formatting preferences, and hard limits. Effective SOUL.md files avoid "corporate drone" defaults of base LLMs while minimising API token spend.

🎭

Tone & Opinions

Give the agent a specific personality — wit level, humour style, directness. Avoids generic responses.

Brevity Rules

"If an answer fits in one sentence, use one sentence." Reduces API spend significantly.

🚫

Hard Limits

"Never send half-baked replies." "Never discuss competitor pricing." Consistent guardrails.

📱

Platform Formatting

"Use bullet points for WhatsApp, not tables." Context-specific formatting rules.

SOUL.md Templates by Use Case

Personal Assistant
Focused, concise, context-aware. Morning brevity enforced.

You are a focused personal assistant. Be direct and concise — if an answer fits in one sentence, use one sentence. In the morning, skip pleasantries entirely. Never send half-baked replies.

Research Agent
Thorough, cite sources, web-search-first methodology.

You are a research agent. Always search the web before answering factual questions. Cite your sources inline. Prefer depth over speed. Never speculate — say "I don't know" instead.

Sales Bot
Warm, persuasive, brand-consistent. Hard limits on competitor mentions.

You are a sales assistant for [Company]. Be warm, confident, and solution-focused. Never discuss competitor pricing. Always end with a clear next action for the prospect.

AGENTS.md — The Procedural Operating Manual

AGENTS.md defines what the agent does — Standard Operating Procedures (SOPs) for every workflow. Think of it as a always-on instruction set that governs tool usage, safety, and multi-agent coordination.

CategoryRule
Session ChecklistRead USER.md and BOOTSTRAP.md before taking any action in a new session.
Tool ProtocolAlways search the web before answering a technical question older than 30 days.
Safety Red LineNever execute system commands without human approval via exec_approval.
Safety Red LineNever access files outside the /workspace directory.
Multi-AgentHand off web research tasks to the Scout sub-agent; code review to the Coder agent.
BrevityTarget ≤3 sentences for status updates. Only expand if explicitly asked.

Memory Management: Raw Logs vs Distilled Wisdom

memory/YYYY-MM-DD.md

Daily Raw Logs

Every interaction captured in granular detail. Every tool call, search query, user message, and decision path. These logs are complete but unstructured.

Retention: Indefinite · Auto-generated
MEMORY.md

Distilled Long-Term Wisdom

Periodically, the agent reviews all daily logs and distills significant lessons, project statuses, and user preferences into this curated file. This keeps the context window clean while preserving critical facts across months.

Retention: Permanent · Agent-curated
Why dual-track? The AI model's context window has a hard limit. Injecting months of raw logs would overflow it. MEMORY.md ensures the most critical facts are always available without exceeding the model's input capacity.

Build Your Agent Identity

Start with a SOUL.md template, install on Hostinger VPS, and connect your first messaging channel.