Skip to content
Ultracite
Esc
↑↓navigate↵open⌘Jpreview

OpenClaw, working from your repo’s AGENTS.md

OpenClaw’s own AGENTS.md lives in its workspace and holds the agent’s operating instructions. When a session runs in your project folder, OpenClaw appends that folder’s AGENTS.md, with Ultracite’s rules, as project context, and the agent runs ultracite fix through its exec tool when the rules tell it to.

OpenClaw by OpenClaw FoundationChecked against OpenClaw 2026.9.9

# Ultracite Code Standards

This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.

## Quick Reference

- **Format code**: `npx ultracite fix`
- **Check for issues**: `npx ultracite check`
- **Diagnose setup**: `npx ultracite doctor`

Oxlint + Oxfmt (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.

…
Ultracite’s rules
Where OpenClaw looks for instructions
  1. 1~/.openclaw/workspace/AGENTS.mdThe agent’s operating instructions, loaded every session. openclaw onboard or openclaw setup creates it.
  2. 2SOUL.md, IDENTITY.md, USER.mdPersona, identity and your preferences, from the same workspace.
  3. 3MEMORY.mdCurated long-term memory, when the workspace has one.
  4. 4your-project/AGENTS.mdThe execution folder’s file, appended after the workspace files as project context.

How OpenClaw reads the rules

OpenClaw has two kinds of AGENTS.md: the workspace one, which shapes the agent itself, and the one in the folder a session runs in. Only AGENTS.md comes from that execution folder; persona and memory files always come from the workspace.

Workspace
~/.openclaw/workspace by default. OPENCLAW_WORKSPACE_DIR or agents.defaults.workspace moves it.
Project folder
A session’s own working directory, then agents.entries.<id>.cwd, then agents.defaults.cwd. A managed worktree pins one too.
Size
20,000 characters per file and 60,000 in total, set by bootstrapMaxChars and bootstrapTotalMaxChars. Longer files are truncated with a notice.
From the project
Only AGENTS.md. OpenClaw never loads SOUL.md, IDENTITY.md, USER.md or MEMORY.md from the execution folder.
Sub-agents
Sub-agent sessions inject AGENTS.md and filter out the other bootstrap files.
Check it
/context list shows each injected file with its raw and injected size.

The agent runs Ultracite through exec

OpenClaw’s plugin hooks can watch tool calls, but after_tool_call is observe-only, so it can’t hand lint results back to the agent. Ultracite doesn’t set up hooks for OpenClaw; the rules in your project’s AGENTS.md tell the agent to run ultracite fix itself.

{
  agents: {
    defaults: { workspace: "~/.openclaw/workspace" },
    entries: { coder: { cwd: "~/path/to/app", sandbox: { mode: "off" } } },
  },
}
  1. 01The agent changes files in the project, for example with apply_patch.
  2. 02Following the project’s AGENTS.md, it runs npx ultracite fix with exec in that folder.
  3. 03The session’s permission mode decides what happens next: full runs it, workspace sends it to an LLM reviewer, guarded asks a person unless the allowlist covers it, and read-only denies it.
  4. 04The output comes back as the tool result, and the agent fixes what’s left before it replies.

Worth knowing about OpenClaw

  • Two AGENTS.md files, two jobs

    The workspace AGENTS.md shapes how the agent behaves everywhere; your project’s AGENTS.md adds project context only when a session runs there. Ultracite’s rules belong in the project, which is where init writes them.

  • Permission modes decide who reviews exec

    Each session runs in read-only, guarded, workspace or full mode. In workspace, an LLM reviewer allows, denies or escalates each exec; a denial goes back to the agent with a reason, and three in a row bring in a person.

  • Codex sessions load AGENTS.md natively

    On the native Codex harness, Codex reads the execution folder’s AGENTS.md through its own project-doc discovery, so OpenClaw doesn’t inject it again. When that folder isn’t the workspace, OpenClaw passes the workspace AGENTS.md as thread-level developer instructions, which Codex sub-agents inherit.

  • The Ultracite skill

    OpenClaw loads skills from its workspace’s skills/ and .agents/skills/, and when a session runs in another folder, from that folder’s skills/ and .agents/skills/ too. The Ultracite skill init installs in your project’s .agents/skills/ reaches sessions that run there.

OpenClaw questions, answered

Does OpenClaw read my project’s AGENTS.md?
Yes, when a session runs in that folder: a working directory set with cwd, a session’s own working directory, or a managed worktree. OpenClaw appends that folder’s AGENTS.md after its workspace files as project context.
What is the AGENTS.md in ~/.openclaw/workspace?
It’s the agent’s own operating instructions, including how it should use memory, and it loads at the start of every session. Onboarding creates it. Keep one project’s lint rules in that project’s AGENTS.md instead.
Can an OpenClaw hook run Ultracite after each edit?
Not in a way the agent sees. The plugin hook after_tool_call is observe-only: handlers run concurrently and their return values are ignored. Ultracite doesn’t configure OpenClaw hooks; the agent runs ultracite fix because the rules say to.
How do I point OpenClaw at my repository?
Set cwd on an agent entry in ~/.openclaw/openclaw.json, as in the example above, or run the task in a managed worktree. A working directory separate from the workspace needs an unsandboxed run.
How do I check OpenClaw loaded the rules?
Send /context list or /context detail. Both show each injected file with its raw and injected size, so you can see whether AGENTS.md loaded and whether it was truncated.

Ship less slop

One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.