skip to content

In OpenClaw, how does BOOTSTRAP.md differ from BOOT.md, and when does each one run?

level: middleimportance: should knowfreq 8%

answer

  1. once versus every start
  2. brand-new workspace only
  3. the birth ritual
  4. a hook that ships disabled
  5. message tool, not a reply

basics

~20 s

BOOTSTRAP.md is a one-time first-run ritual for a brand-new workspace, deleted once the workspace looks configured. BOOT.md is an optional startup checklist that the disabled-by-default boot-md hook runs as an agent turn on every Gateway start.

solid answer

~40 s

`BOOTSTRAP.md` is created only for a brand-new workspace. On the first real turn the agent follows it: asks for a name, settles a vibe, can offer avatars, asks about a plugin set, then writes `IDENTITY.md` and `SOUL.md`. Once the workspace looks configured the file is deleted and never recreated; `openclaw onboard --skip-bootstrap` skips it. `BOOT.md` is not injected at all. The bundled `boot-md` hook, enabled with `openclaw hooks enable boot-md`, runs it on `gateway:startup` as an agent run in a temporary session, once per workspace. Final replies are not delivered, so an item that must notify someone calls the message tool with a channel and target and replies `NO_REPLY`. Keep it short and safe to repeat.

code

markdown · 6 lines
markdown
# BOOT.md

- Check whether last night's backup job reported success in the project notes.
- Only if it failed: use the message tool to tell the owner on Telegram, naming the channel and the owner's chat as the target.
- Then reply NO_REPLY.
- Do nothing else; this file runs on every Gateway restart.

go deeper

for a junior

Remember the lifecycles: BOOTSTRAP.md once, for a brand-new workspace, then deleted; BOOT.md on every Gateway start, only after its hook is enabled.

for a middle

Explain how each reaches the model: BOOTSTRAP.md through Project Context while pending, BOOT.md as a separate agent run in a temporary session with delivery switched off.

for a senior

Show you write BOOT.md to be idempotent and cheap, because restarts repeat it, and that notices go through the message tool with an explicit channel and target.

for a principal

Weigh whether startup automation belongs in BOOT.md at all versus a scheduled job, given that every restart triggers model calls and possible outbound side effects.

## Two files with similar names OpenClaw's workspace can hold two files whose names differ by four letters and whose lifecycles have nothing in common. **`BOOTSTRAP.md`** is a one-time ritual for a brand-new workspace. **`BOOT.md`** is an optional checklist that runs every time the Gateway starts. Confusing them leads either to a ritual that seems to repeat or to a startup task that never fires. ## BOOTSTRAP.md: the first-run ritual `BOOTSTRAP.md` is created only for a **brand-new workspace**, meaning no other bootstrap files are present. On the agent's first real turn after onboarding, OpenClaw keeps it in Project Context and adds bootstrap guidance to the system prompt, and the agent walks the owner through a short "birth" sequence: - it asks what the owner wants to call it and offers one short soul or vibe line; - it can generate four avatar options when image generation is available, and continues with an emoji if not; - it asks whether the owner wants the minimal recommended plugin set or maximum convenience; - it persists the agreed identity into `IDENTITY.md` and `SOUL.md` (what the agent reads about itself) and through `openclaw agents set-identity` (what channels and the UI display). The ritual always runs on the Gateway host, because that is where the workspace lives. For embedded or local-model runs, OpenClaw keeps `BOOTSTRAP.md` out of the privileged system context and passes its contents through the user prompt instead, so models that do not reliably call the `read` tool can still finish. ### When the ritual ends OpenClaw treats the workspace as configured once `SOUL.md`, `IDENTITY.md` or `USER.md` has diverged from its starter template, or a `memory/` folder exists. At that point `BOOTSTRAP.md` is deleted, and it is **not recreated** on later restarts. To skip the ritual for a workspace you seed yourself, use `openclaw onboard --skip-bootstrap`, or set `agents.defaults.skipBootstrap: true` so bootstrap files are not created at all. ## BOOT.md: a startup checklist `BOOT.md` is optional and is **not** a bootstrap injection. It is read by the bundled `boot-md` internal hook on the `gateway:startup` event. The hook **ships disabled**; enabling some other hook does not enable it. Turn it on with `openclaw hooks enable boot-md`, and it takes effect on the next Gateway start. How a run works: 1. On startup, the hook looks for a nonempty `BOOT.md` in each configured agent's resolved workspace; missing or empty files are skipped. 2. A workspace shared by several agents runs once, under the first agent selected for it. 3. Each run is an **agent run**, not a shell script, in a fresh temporary `agent:<id>:boot:<run-id>` session that is cleaned up afterwards; existing sessions keep their history. 4. Normal final-response delivery is **disabled**. If an item must notify someone, it calls the message tool naming a channel and a target, then replies with the silent token `NO_REPLY`. 5. Tasks run sequentially, and a failed one is logged without stopping the rest. ## Side by side | | `BOOTSTRAP.md` | `BOOT.md` | |---|---|---| | When | first real turn of a brand-new workspace | every Gateway start, once enabled | | How it reaches the model | Project Context while pending | an agent run started by the `boot-md` hook | | Default | created automatically for new workspaces | absent; hook disabled | | Afterwards | deleted, not recreated | stays; runs again next start | | Output | the conversation with the owner | none unless the message tool sends it | ## Pitfalls worth naming - Because `BOOT.md` runs on **every restart**, its items must be short and safe to repeat; a crash loop repeats them each time. - It can call models and tools, so enabling the hook can cause model spend and outbound messages. - Writing a notice as the final reply sends nothing; delivery is off by design. - Putting startup chores in `BOOTSTRAP.md` does nothing after the first run, because the file is gone. - A config reload does not replay `gateway:startup`, so editing `BOOT.md` or enabling the hook shows its effect only on the next real Gateway start. - When the macOS app talks to a remote Gateway, both files live on that remote host's workspace; editing a copy on the laptop changes nothing. - Hook mechanics in general (a hook folder, its event list, listing and enabling hooks) belong to the internal-hooks subject; here the point is only what the file does and when.

  • How do you stop the first-run ritual on a workspace you have already filled in yourself?
    Run onboarding with `openclaw onboard --skip-bootstrap`, or set `agents.defaults.skipBootstrap: true` so bootstrap files are not created; `openclaw setup --baseline --skip-bootstrap` persists that setting. If files already diverge from the templates, the workspace counts as configured and `BOOTSTRAP.md` is removed anyway.
  • Why does a BOOT.md item that ends with a friendly summary never reach the owner?
    The `boot-md` hook runs each startup task in a fresh temporary `agent:<id>:boot:<run-id>` session with normal final-response delivery disabled. Nothing is sent unless an item explicitly calls the message tool with a channel and a target; the run then ends with `NO_REPLY`.

  • BOOT.md is injected into every session like AGENTS.md.
  • BOOTSTRAP.md runs again after every Gateway restart.
  • BOOT.md is executed as a shell script at startup.
  • Enabling any internal hook also turns on boot-md.
  • BOOT.md's final reply is delivered to the owner's main chat.