Skip to main content

What slash commands do

Slash commands are shortcuts. Instead of explaining what you want, you type /command and the AI knows the workflow. Trellis ships with commands for common tasks. You can add your own.

Built-in commands

Session management

CommandWhat it does
/trellis:startStart a work session. Loads context, shows current task.
/trellis:finish-workEnd a session. Run checks, update journal.
/trellis:record-sessionSave what happened to the workspace journal.

Development workflow

CommandWhat it does
/trellis:before-backend-devLoad backend specs before coding.
/trellis:before-frontend-devLoad frontend specs before coding.
/trellis:check-backendReview code against backend specs.
/trellis:check-frontendReview code against frontend specs.
/trellis:commitPrepare a commit with conventional format.

Multi-agent

CommandWhat it does
/trellis:parallelStart multiple agents working in parallel.

Maintenance

CommandWhat it does
/trellis:update-specCapture learnings into specs.
/trellis:break-loopDebug when stuck in a loop.
/trellis:onboardExplain the project to a new team member.

Using commands

Type the command in Claude Code:
/trellis:start
The command expands into a full prompt that tells the AI what to do. You don’t see this prompt, but the AI follows it.

Creating custom commands

Commands are markdown files in .claude/commands/. Create a new command:
mkdir -p .claude/commands/my-project
Create .claude/commands/my-project/deploy-check.md:
Before deploying, check:

1. All tests pass: `npm test`
2. No TypeScript errors: `npm run typecheck`
3. Lint clean: `npm run lint`
4. Build succeeds: `npm run build`

Run each check and report results. If any fail, explain what's wrong.
Now /my-project:deploy-check is available.

Command structure

A command file is just a prompt. When you invoke the command, the file contents become instructions for the AI. Good commands:
  • Have clear steps
  • Include actual commands to run
  • Specify what output to expect
  • Tell the AI what to do if something fails
Bad commands:
  • Are vague (“check the code”)
  • Don’t specify how to check
  • Leave the AI guessing

Namespacing

Commands use the folder name as a namespace:
.claude/commands/
├── trellis/           # /trellis:* commands
│   ├── start.md
│   └── commit.md
└── my-project/        # /my-project:* commands
    └── deploy-check.md
Keep your project commands in a separate folder from Trellis commands. This avoids conflicts when Trellis updates.

Arguments

Commands can accept arguments. Reference them with $ARGUMENTS in the command file:
Review the file at $ARGUMENTS.

Check for:

- Type safety
- Error handling
- Test coverage
Usage: /my-project:review src/api/users.ts The AI receives the prompt with $ARGUMENTS replaced by src/api/users.ts.