> ## Documentation Index
> Fetch the complete documentation index at: https://docs.basemode.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Star commands

> Behaviour switches you type straight into a prompt: how matching works, what ships with base, how to stack them, how to write your own, and the one thing they switch off that surprises everyone.

A star command is a `*word` you drop into a normal prompt to turn on a named mode for that turn. Typing `*audit review this migration` activates whatever rules you have filed under `audit` and hands them to the agent alongside your request.

There is no separate command line and no slash. It is a word in the prompt, and base notices it.

## How to type one

Put it anywhere in the sentence. All of these do the same thing:

```
*audit review this migration plan
review this migration plan *audit
*Audit, review this migration plan
```

Matching is case-insensitive, and trailing punctuation is stripped before the match, so `*AUDIT.` and `*audit,` both land.

**Why it works.** base splits your prompt on whitespace, takes any token starting with `*`, trims trailing non-alphanumeric characters off the end, and compares what is left against your configured command names without regard to case. That is the entire matcher. It is not looking at position, grammar or intent.

**The gotcha.** `*audit-this` matches `audit-this`, not `audit`, because only *trailing* punctuation is trimmed. Keep the star word on its own.

## Stacking

```
*audit *steelman review this migration plan
```

Both activate. They are injected in the order they first appear, and repeating one does not inject it twice.

**Why it works.** The matcher walks every token in the prompt and collects each distinct command it finds, rather than stopping at the first. Stacking is the intended use, not a side effect.

## What ships, and what does not

base ships four star commands, offered during install: `*handoff`, `*fork`, `*base` and `*end`. A fresh install has no others.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base commands list
base commands show handoff
```

`base commands list` prints every command currently loaded with its description and rule count, and the total at the bottom. `base commands show <name>` prints the full rule text exactly as it would be injected, which is worth reading before you trigger a multi-step one.

**The gotcha.** Drop the asterisk when you use `show`. It is `base commands show audit`, never `base commands show *audit`.

<Note>
  If you have seen a list of thirty-odd commands with names like `*blunt`, `*mentor` or `*vet`, those came from somebody's own `commands.toml`, not from base. Star commands are a mechanism, and the interesting ones are the ones you write. Yours load exactly the same way.
</Note>

## The four that ship

They are the four that pay off immediately, and everything else is depth you add once these are habit.

| Command    | What it does                                                                                                            |
| ---------- | ----------------------------------------------------------------------------------------------------------------------- |
| `*handoff` | Writes a resume document for this project and registers it, so the next session picks up from it.                       |
| `*fork`    | Writes a forward build specification for side-work that surfaced, registers it, and returns you to what you were doing. |
| `*base`    | Re-reads the session and routes what is durable into the graph: decisions, learnings, standing rules, task state.       |
| `*end`     | All three in order, as a one-shot close-out.                                                                            |

**Why they work.** Each one is a set of written instructions, not code, and each ends by verifying its own work. `*handoff` finishes by running `base handoff list` and confirming exactly one open handoff points at the document it just wrote, because writing the document is the half that looks finished and registering it is the half that matters.

**The gotcha.** `*base` deduplicates before it writes. It searches the graph first, so running it twice does not double-log, and an honest "nothing new to record" is a valid outcome rather than a failure.

**Next rung.** After `*end`, clear your session yourself. base never does it for you: it is your command, not the product's, and the handoff `*end` just registered is what brings you back.

They are plain TOML. Read them with `base commands show handoff`, edit them, delete the ones you do not want, and add your own beside them.

## The one that catches everyone

<Warning>
  **A matched star command switches off domain matching for that prompt.** Your rules, prior decisions and notes do not arrive that turn. base prints the bracket rules and the command's own rules, then returns without loading the graph at all.

  Established from source at `4866996`, the commit the shipped 0.13.2 binary was built from: the star-command branch in the prompt hook returns early, before the graph load and before domain matching run.
</Warning>

This matters most if you have settled into a mode. Someone who opens every prompt with `*blunt` has effectively turned their domain rules off and will conclude that base stopped working.

Bracket rules are the exception. They are assembled before the star-command check specifically so a mode cannot suspend them, which is the right call: a mode changes how the agent answers, not which standing rules it is held to.

If you want both, send the mode prompt and the domain-matching prompt separately.

## Writing your own

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base commands add --name audit --description "Find problems before acknowledging what works" --rule "Assume something is wrong until shown otherwise" --rule "Tag every finding critical, moderate or minor" --rule "Withdraw a finding only against evidence, never against disagreement"
```

`--rule` repeats, once per line you want the command to carry. It writes into `commands.toml`.

**Why it works.** A command is three fields: a name, a description, and a list of rules. When it matches, base prints `[*NAME ACTIVATED]`, the description, then the numbered rules. There is no engine behind it beyond that, which is why a good command is really a well-written set of instructions rather than a clever configuration.

That also explains "composite" commands, if you have seen them. A command whose rules say *read these two other commands and follow both* works purely because the text says so. It is a convention, not a feature.

**Next rung.** Rules that survive pushback are worth the extra sentence. "Withdraw a finding only against evidence, never against disagreement" holds up under argument in a way that "be thorough" does not.

## Removing one

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base commands remove audit
```

Case-insensitive on the name, no preview, and it edits `commands.toml` in place.

## Importing a pack

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base commands import ~/Downloads/operator-modes.toml
```

Append-only. Names already present are skipped rather than overwritten, and nothing above the appended block is touched, so importing the same file twice is safe.

<Note>
  Older guidance said to avoid this command because its writer corrupted `commands.toml` on any rule containing a newline, tab or backslash, and the loader then swallowed the parse error. Both halves are fixed as of the shipped release. The writer round-trips control characters (there is a regression test named for the issue), and `base doctor` now reports a `commands.toml` it cannot parse instead of leaving every star command in that tier quietly inactive. Verified from source at `4866996`.
</Note>

## Global and workspace

Global commands live in `~/.base-gbl/commands.toml` and load first. A workspace's own `.base/commands.toml` overlays them by name, case-insensitively: a workspace command with the same name replaces the global one, and new names are simply added.

**The gotcha.** If a whole tier's commands stop responding at once, the file did not load. `base doctor` will name it.

## Next

<CardGroup cols={2}>
  <Card title="Handoffs and forks" icon="arrows-left-right" href="/guides/handoffs-and-forks">
    What `*handoff`, `*fork` and `*end` are actually doing underneath.
  </Card>

  <Card title="Context reference" icon="sliders" href="/reference/context">
    Every `base commands` verb and its flags.
  </Card>
</CardGroup>
