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.
…- 1
~/.openclaw/workspace/AGENTS.mdThe agent’s operating instructions, loaded every session.openclaw onboardoropenclaw setupcreates it. - 2
SOUL.md, IDENTITY.md, USER.mdPersona, identity and your preferences, from the same workspace. - 3
MEMORY.mdCurated long-term memory, when the workspace has one. - 4
your-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/workspaceby default.OPENCLAW_WORKSPACE_DIRoragents.defaults.workspacemoves it.- Project folder
- A session’s own working directory, then
agents.entries.<id>.cwd, thenagents.defaults.cwd. A managed worktree pins one too. - Size
- 20,000 characters per file and 60,000 in total, set by
bootstrapMaxCharsandbootstrapTotalMaxChars. Longer files are truncated with a notice. - From the project
- Only
AGENTS.md. OpenClaw never loadsSOUL.md,IDENTITY.md,USER.mdorMEMORY.mdfrom the execution folder. - Sub-agents
- Sub-agent sessions inject
AGENTS.mdand filter out the other bootstrap files. - Check it
/context listshows 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" } } },
},
}- 01The agent changes files in the project, for example with
apply_patch. - 02Following the project’s
AGENTS.md, it runsnpx ultracite fixwithexecin that folder. - 03The session’s permission mode decides what happens next:
fullruns it,workspacesends it to an LLM reviewer,guardedasks a person unless the allowlist covers it, andread-onlydenies it. - 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.mdshapes how the agent behaves everywhere; your project’sAGENTS.mdadds project context only when a session runs there. Ultracite’s rules belong in the project, which is whereinitwrites them.Permission modes decide who reviews exec
Each session runs in
read-only,guarded,workspaceorfullmode. Inworkspace, 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.mdthrough its own project-doc discovery, so OpenClaw doesn’t inject it again. When that folder isn’t the workspace, OpenClaw passes the workspaceAGENTS.mdas 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’sskills/and.agents/skills/too. The Ultracite skillinitinstalls 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’sAGENTS.mdafter 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.mdinstead. - Can an OpenClaw hook run Ultracite after each edit?
- Not in a way the agent sees. The plugin hook
after_tool_callis observe-only: handlers run concurrently and their return values are ignored. Ultracite doesn’t configure OpenClaw hooks; the agent runsultracite fixbecause the rules say to. - How do I point OpenClaw at my repository?
- Set
cwdon 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 listor/context detail. Both show each injected file with its raw and injected size, so you can see whetherAGENTS.mdloaded and whether it was truncated.
Keep going
- AgentgooseOpen-source local agent with a desktop app and a CLI, created by Block.
- AgentPiMinimal open-source terminal agent you extend with TypeScript extensions and skills.
- AgentDeep AgentsLangChain’s open-source agent harness on LangGraph, with the dcode terminal coding agent.
- DocsAgent rulesWhat
initwrites for every agent, and how to keep it current.
Ship less slop
One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.