Project commands
A repository's scripts are invisible to an agent unless it knows to look, and the manifests that exist say what runs, not when to run it. npm test could take a second or ten minutes. npm run deploy could be a dry run or production.
The commands file fixes both. It's a Markdown runbook in the repository: one bullet per command, with trailing decorators that say what the command does. clip sync copies it into the AGENTS.md block, so agents see it without looking. Launchers such as Saggar read the same file to turn it into buttons.
clip commands init # write .clip/commands.md
clip commands # list what it describes
clip commands check # validate it; exits 1 on errors
clip commands check --strict # also fail on manifest drift and missing effects
clip sync # list the commands in AGENTS.md
clip commands init reads task declarations from package.json, Makefile, justfile, Taskfile.yml, and mise.toml when they exist. It only reads those files. It never starts npm, make, just, task, or mise, and it doesn't inspect a task body to guess its effects.
The generated commands are grouped by source. Package scripts and task names become their runner invocations. Documented Make targets keep their ## note, just recipes keep a preceding comment, and Taskfile desc and mise description fields become notes. Make's special, pattern, and undocumented targets are skipped.
For package scripts, init uses pnpm run <name> when packageManager declares pnpm, such as pnpm@11.22.0. Otherwise it uses npm run <name>. It doesn't run or install either package manager.
Every seeded entry is undecorated, including one whose description happens to contain a decorator-looking word. Review the commands, then add decorators yourself. An undecorated command means its effect is unknown.
Keeping commands current
When one of the supported manifests exists, clip commands check compares its declared tasks with the commands file. It warns when a task has no matching bullet, or when a bullet names a task the manifest no longer declares. It only matches runner invocations (npm run <name>, pnpm run <name>, make <target>, just <recipe>, task <name>, and mise run <name>), with optional task arguments. Other shell commands stay outside this check.
For Make, only targets with ## notes are seeded or required in the catalog. Undocumented literal rules are accepted when their targets are listed explicitly, including multi-target, double-colon, and grouped rules. Variable and pattern expansion aren't evaluated.
Package script checks also recognize npm test, npm t, npm tst, and pnpm run-script <name>. npm and pnpm explicit forms match the same script declaration and exclusion comments. Use the explicit pnpm forms for drift checking; pnpm shorthand and options before the script name aren't matched.
Use --strict in CI. It turns manifest drift into errors and requires every shell command to declare one effect: #safe, #writes, or #destructive. Launcher shorthand such as @claude review this doesn't need an effect.
To intentionally keep a manifest task out of agent guidance, add its exact runner invocation in an HTML comment. The comment is ignored by the commands parser and never reaches the generated AGENTS.md block. Multiline comments work too. Exclusions shown inside fenced examples do not affect manifest drift.
<!-- clip:ignore npm run private-release -->
Example
# Commands
- Dev server: `npm run dev` — the one you leave running #long-running
- Check: `npm run check` — types, lint, and tests #safe #slow #ci
- Format: `npm run format` #writes
- Deploy: `npm run deploy` — production #destructive
- Sign in: `vercel login` #interactive
clip sync writes this into the AGENTS.md block:
Project commands from `.clip/commands.md`. Run them from the project root. Tags: `safe` runs without asking; `writes` edits tracked files, so expect a diff; `destructive` can't be undone, so ask the user first; `long-running` never exits, so run it in the background; `slow` takes minutes; `interactive` needs a person, so ask the user to run it; `ci` is what CI checks, so run it before calling work done.
- Dev server: `npm run dev` [long-running] — the one you leave running.
- Check: `npm run check` [safe, slow, ci] — types, lint, and tests.
- Format: `npm run format` [writes]
- Deploy: `npm run deploy` [destructive] — production.
- Sign in: `vercel login` [interactive]
The legend only explains tags the file uses.
Location
The file lives at .clip/commands.md in the project root, which is the nearest directory with .git. Commit it.
Automatic discovery selects the first regular file at .clip/commands.md, then .saggar/commands.md, Saggar's original location. Links to regular files count; directories, links to directories, and dangling links are skipped.
An explicit --file selects that exact path and reports read failures. clip commands init creates .clip/commands.md and refuses existing paths, including dangling links. To move an existing file, run git mv .saggar/commands.md .clip/commands.md.
Grammar
The file is Markdown. Readers find commands in it and treat everything else as prose.
- Lines. CRLF and CR endings read as LF. Lines inside fenced examples are skipped.
- Fences. At least three consecutive backticks or tildes open a block. A closing fence uses the same character, is at least as long as the opener, and has no trailing text beyond whitespace. A backtick fence's info string cannot contain backticks. An unclosed fence hides the rest of the file. Fences and command bullets may be indented.
- Commands. A command is a list item (
-,*, or+, at any indent) containing a code span. The first code span is the command. The text before it is the name, and the text after it is the note. - Not commands. A list item with no code span is prose. A list item with an unclosed or empty code span is not a command, and
clip commands checkwarns about it. - Names. Trailing
:,-,–, and—are removed, as is surrounding*or_emphasis. With no name, the command is its own name. Names are case-insensitive keys within a section. A layout can repeat a name from outside it. - Notes. A leading
:,-,–,—, or//is removed. Only a doubled slash introduces a note, so a note that opens with a path keeps it. - Decorators. A decorator is a
#followed by a letter, then letters, digits,_, or-, with an optional:value. Decorators are read from the end of the item and must be preceded by whitespace. Reading stops at the first token that doesn't match, socovers #42stays in the note. Keywords are case-insensitive, and values keep their case. - Commands are opaque. The command is shell text for the project root. A command starting with
@(@claude review this) is launcher shorthand for starting an agent with a prompt, not a shell command. Agents don't run these, andclip syncleaves them out.
Decorators
Every decorator is optional. An undecorated command means the author said nothing, not that the command is safe.
For agents
| Decorator | Meaning | What an agent does |
|---|---|---|
#safe | Changes nothing outside build output and caches. | Runs it without asking. |
#writes | Edits tracked files, such as a formatter or code generator. | Runs it, expecting a diff to review. |
#destructive | Can't be undone, or reaches beyond this machine: deploys, publishes, and database resets. | Asks the user first. |
#long-running | Never exits on its own, such as a dev server or watcher. | Runs it in the background, and never waits for it. |
#slow | Exits, but takes minutes. | Prefers a narrower command while iterating. |
#interactive | Needs a person at the terminal, such as a login or prompt. | Asks the user to run it. |
#ci | The local equivalent of CI's required checks. | Runs it before calling work done. |
Choose at most one effect (#safe, #writes, or #destructive) and at most one lifetime (#long-running or #slow). If a file declares more than one, readers use the most cautious reading, and clip commands check reports an error.
For launchers
These are reserved so every reader agrees on where a note ends. CLIP reads them and leaves their meaning to launchers.
| Decorator | Meaning |
|---|---|
#primary #companion #monitor #background #quick | Where the command's terminal opens: the main pane, beside the current one, the dock, the menu without taking focus, or a panel that folds away on success. Choose one. |
#browser #simulator | The live surface a remote client reveals after starting the command. Choose one. |
#dashboard | Shown as a dashboard rather than a task. |
#icon:<name> | The icon a launcher shows. The value belongs to the launcher. |
Unknown decorators
Readers ignore decorators they don't know, and clip commands check warns about them. So a new decorator never spills into another reader's note, and older readers keep working.
The layout section
The commands under a level-2 ## Layout heading are the ones a launcher opens together when the project opens. They're ordinary commands otherwise. The section ends at the next heading.
Add #auto to the heading (## Layout #auto) to open the layout automatically. Without a role decorator, a layout command opens in the launcher's menu rather than its main pane. A layout can't place a #quick command.
Retired forms
Readers accept these older spellings, and writers never produce them:
## Startupas the layout heading.[auto]in place of#autoon the layout heading.- A trailing
[role], such as[monitor], in place of a role decorator on an item with no decorators.
Checks
clip commands check reads the file and reports each issue with its line number when it has one.
Errors, which exit 1:
- More than one effect, lifetime, role, surface, or icon.
#ciwith#long-running, since a check has to exit.
Warnings:
- Unknown decorators.
- A name repeated within a section.
- A list item with an unclosed or empty code span.
#quickin the layout section, or#quickwith#long-running.- A task in a supported manifest missing from the file, or a matching runner invocation whose manifest task no longer exists.
Add strict mode to CI to keep the file current and fully classified:
- run: clip commands check --strict