Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Slash Commands

Writ generates slash commands for Claude Code during writ init. These are markdown files in .claude/commands/ that expose writ’s full CLI as discoverable commands in the agent’s palette. Agents see them alongside other project commands and can invoke them without remembering exact CLI syntax.

How They Work

Each slash command is a .md file that tells the agent what command to run and what flags are available. They’re generated once during writ init and regenerated on writ init --reconfigure. Each file includes a <!-- Generated by writ init. Do not edit. --> header so writ can identify and manage its own files.

Slash commands are thin wrappers. They don’t contain business logic. They document the CLI command and let the agent invoke it. The CLI is the source of truth.

Full Command List

Core Workflow

CommandWhat It Does
/writ-contextGet structured project state. Run this FIRST at the start of every task.
/writ-sealCheckpoint current work with a summary and spec linkage.
/writ-spec-addCreate a new task/spec with an ID and title.
/writ-spec-doneMark a spec complete. Creates a final seal.

Status and Review

CommandWhat It Does
/writ-statusFleet overview: agents, specs, progress, commit readiness.
/writ-diffView file changes. Supports --spec, --agent, --stat, --name-only.
/writ-logSeal history. --all includes diverged branches.
/writ-showInspect a specific seal. --diff shows file changes.

Spec Management

CommandWhat It Does
/writ-spec-statusList specs, optionally filtered by lifecycle state.
/writ-spec-showDetailed view of a single spec.
/writ-spec-reopenReopen a completed spec for continued work.

Round Trip

CommandWhat It Does
/writ-finishPromote completed specs to git commits. Supports --strategy, --dry-run.
/writ-summaryGenerate commit messages (--format commit) or PR descriptions (--format pr).

Recovery and Convergence

CommandWhat It Does
/writ-restoreRestore working directory to any seal’s state.
/writ-convergeMerge diverged branches. Strategies: escalate, three-way-merge, most-recent, orchestrator.

Diagnostics

CommandWhat It Does
/writ-verifyVerify cryptographic integrity of the seal chain.
/writ-doctorRun diagnostic checks on repo health.

Generation and Cleanup

During Init

writ init
# ✓ Generated 20 slash commands in .claude/commands/

Slash commands are only generated when Claude Code is detected (presence of CLAUDE.md or .claude/ directory). Other frameworks get the CLI and instruction templates appropriate to their environment.

Regeneration

writ init --reconfigure

This overwrites all existing writ-*.md files in .claude/commands/ with fresh copies. Non-writ files are preserved.

Cleanup

writ uninit

Removes only writ-*.md files from .claude/commands/. Any slash commands you’ve created yourself are left untouched.

Slash Commands vs MCP Tools

Both provide the same capabilities. The difference is how the agent discovers and invokes them:

Slash CommandsMCP Tools
How agent finds themCommand palette, / prefixTool palette, native MCP discovery
How agent invokes themRuns the CLI command in a shellCalls the MCP tool function
OutputCLI stdout (text or TOON)MCP tool result (text)
Works without MCPYes, just files on diskNo, requires MCP connection
Works without Claude CodeNo, Claude Code specificYes, any MCP client

In a Claude Code environment with both enabled (the default after writ init), the agent has two paths to every writ command. The MCP path is typically preferred by agents because it’s a native tool call rather than a shell command, but both work identically.

Relationship to Instruction Templates

Slash commands are Layer 2 in writ’s adoption stack. They complement, not replace, the instruction templates (Layer 1) in CLAUDE.md:

  • Instructions tell agents the workflow: run context first, seal after work, mark specs complete.
  • Slash commands make the workflow easy to execute: the exact commands are discoverable in the palette.
  • MCP tools (Layer 3) make it native: no shell involved, direct tool calls.

All three are generated by writ init. All three are cleaned up by writ uninit.