Slash Commands

May 18, 2026 · View on GitHub

Inside the TUI, type / to open the command palette. Caveman Code ships 10 built-in commands and reads user-authored markdown commands from ~/.cave/commands/ and project-local .cave/commands/.

Built-in commands

CommandWhat it does
/login /logoutOAuth flow for any provider
/modelSwitch model mid-session, transcript reformatted in place
/providerList/switch active provider
/settingsEdit ~/.cave/settings.json in your $EDITOR
/new /resume /tree /forkSession lifecycle and branching
/compactManual context compaction (auto on overflow)
/copy /export /shareCopy transcript / export JSON / share link
/plan /actSwitch between plan and edit modes
/tokensLive token / cost breakdown
/repomapShow the current repo map (PageRank-ranked symbols)
/architectArchitect/editor split mode
/checkpoint /rollback NShadow-git snapshots
/memorycavemem queries: search, save, consolidate, sync
/help /hotkeys /changelogSelf-explanatory

Default user commands shipped with Caveman Code

These ship in ~/.cave/commands/ after first run. You can edit or delete any of them.

CommandWhat it does
/commitStage changes, propose a conventional-commit message, commit
/testRun the test suite, summarize failures
/reviewRead the diff vs main and produce a code-review summary
/explainExplain the file/symbol under cursor
/fix-typesWalk type errors and propose fixes
/perfProfile the cwd app and suggest optimizations
/sec-reviewRun a security audit pass on the diff
/cleanDelete dead imports, unused vars
/logAppend a session note to CHANGELOG.md
/migrateRun a recipe from .cave/recipes/

Authoring a slash command

Create ~/.cave/commands/my-cmd.md:

---
description: "Run prettier on the staged files and re-stage"
argument-hint: "[--all]"
allowed-tools: [Bash, Edit]
model: claude-haiku-4
---

You are a code-formatter. Run prettier on every file in `$ARGUMENTS` (default
to staged files: `!`git diff --cached --name-only``). Re-stage the changes.

Frontmatter keys (full list — superset of Claude Code):

KeyPurpose
descriptionAuto-loaded into the command palette
argument-hintShown next to the command name
argumentsTyped arg schema (validated before run)
allowed-toolsTool allowlist for this command
disallowed-toolsTool denylist
disable-model-invocationHide from auto-suggestion
user-invocableDefault true
modelOverride session model for this command
effortlow/medium/high thinking
context: forkFork into a sub-session
agentDispatch to a named subagent
hooksInline hook overrides
pathsLimit the command to certain glob paths
shellInline shell preprocessing language

Substitutions

  • $ARGUMENTS — full argv after the command
  • $0, $1, ... — positional args
  • ${CAVE_SESSION_ID}, ${CAVE_SKILL_DIR}, ${CAVE_EFFORT} — session vars
  • !`cmd` — runs cmd at command-load time, substitutes stdout

Hot reload

Caveman Code watches ~/.cave/commands/ and .cave/commands/ for changes. Save the file, the new version is live on the next /.

Project vs user vs plugin scope

ScopePathWhen to use
Project.cave/commands/*.mdLives in repo; team shares it
User~/.cave/commands/*.mdPersonal preferences
Pluginnode_modules/<plugin>/commands/*.mdInstalled via caveman plugin install

User overrides project overrides plugin. Conflicts surface in caveman doctor.

Importing from Claude Code

cp ~/.claude/commands/*.md ~/.cave/commands/

The frontmatter formats are identical. Paste-and-go.