LatentCodeCustomize
Custom commands
Turn a prompt you type often into a slash command, with arguments, file contents and live shell output filled in.
Create a command
Add a Markdown file to .latentcode/commands/ in your project, or to ~/.config/latentcode/commands/ for every project. The file name is the command name.
---
description: Run the tests for a package and fix what fails
agent: build
---
Run the test suite for the $1 package.
Recent changes on this branch:
!`git log --oneline main..HEAD`
Fix every failing test. Don't change a test's assertions unless the test is wrong,
and explain why if you do. Focus on: $2Type /test-fix and it appears in the command list with its description. Run it with arguments:
/test-fix billing the proration edge casesCommands in subfolders get the path as their name: commands/db/reset.md is /db/reset. From the shell, run one with latentcode run --command test-fix billing.
What you can put in a template
| Write | Becomes |
|---|---|
| $ARGUMENTS | Everything typed after the command name, as typed. |
| $1, $2, … | Individual arguments, split on spaces. Quote an argument to keep spaces in it: /cmd "two words" next. The highest-numbered placeholder takes all the remaining arguments. |
| !`command` | The output of the shell command, run in your project directory when you use the slash command. |
| @path/to/file | The file, attached to the message, as if you'd typed it in the prompt. |
If the template has no placeholders and you type arguments anyway, they're added at the end.
Options
descriptionstringoptionalagentstringoptionalmodelstringoptionalprovider/model.subtaskbooleanoptionaltrue always runs the command in a child session, keeping your main conversation's context clean. false never does.Define commands in config
You can also define commands under command in latentcode.json. The template is required; use {file:…} to keep long templates in their own file.
{
"command": {
"changelog": {
"description": "Draft a changelog entry for the current branch",
"template": "Write a changelog entry for these changes:\n!`git diff main...HEAD --stat`",
"model": "latentrouter/bedrock-anthropic/anthropic/claude-haiku-4-5"
}
}
}Name clashes
A command you define with the same name as a built-in one replaces it. See Slash commands for the names already taken.
Other things in the command list
- Prompts offered by MCP servers, shown as
/server:promptwith:mcpafter them. - Skills can be run by name too;
/skillslists them.