OpenClaw Patterns

Architectural and design patterns used throughout the OpenClaw codebase.

Available Patterns

Markdown-as-Config

Use markdown files for configuration with embedded metadata and validation schemas.

Append-Only JSONL

Crash-safe, git-friendly, streamable persistence for sessions and cron logs using append-only JSONL files.

Ed25519 Device Authentication

Public-key cryptography for device authentication across Gateway, Control UI, and Native Apps using Ed25519 keypairs and challenge-response signing.

Cascading Configuration Resolution

5-layer cascading configuration system with runtime overrides, environment variables, agent-specific, session-level, and global defaults.

Context Overflow 3-Tier Recovery

Sophisticated error recovery pattern for handling context overflow: detection, auto-compaction, tool result truncation, and user-facing fallback.

Cross-References