Skip to content

Handbook

Custom agents

Create read-only specialist agents, understand tool and turn limits and manage source-bound trust deliberately.

Reviewed CLI source version: 2.4.0 · Editorial update:

Create a project reviewer

Custom agents receive their own system prompt and perform a scoped task. They are different from command templates and internal orchestrator roles. You need a project, a CLI session and readable project code.

Create .lurus/agents/reviewer.md:

---
name: Reviewer
description: Inspect correctness and tests without modifying the project
tools:
  - Read
  - Grep
  - Glob
  - GitInspect
maxTurns: 12
---

Inspect the requested code. Report only concrete correctness and test-coverage findings with file references. Do not modify files.

For global use, put the same content at ~/.lurus/agents/reviewer.md. Start a new CLI session after creation or editing. Project agents replace global agents with the same key. The lowercase path/filename determines the key reviewer; name: Reviewer is only the display name.

Invoke and manage trust

Review the agent file before approving it. “Trust and run once” saves trust persistently, despite the wording. Running an agent may incur model costs.

/agents list
/agents show reviewer
/agents trust reviewer
/agents run reviewer Review the current changes and their tests.
/agents untrust reviewer
StepExpected effect
/agents or /agents listLists custom agents only, with source, key, display name, trust, tools and optional turn limit. Not a catalogue of internal built-in roles.
/agents show reviewerMetadata and file path; does not display the full system prompt.
/agents trust reviewerPersists trust for the loaded source and file content. Review the file first.
/agents run reviewer <prompt...>Starts the custom agent directly with your task, rather than submitting a parent prompt first. Results, partial output, tokens/cost and cancellation status may be displayed.
/agents untrust reviewerRemoves the matching persistent trust record. Does not delete the agent file.

Without a task, run displays usage; an unknown key does not start an agent. An untrusted source triggers a trust dialog. “Trust and run once” actually persists trust here; the label does not mean temporary trust. If saving trust persistently fails, the CLI may display a warning even though the agent was approved for the current run. Check the trust status again after restarting.

Cancellation or reaching the turn limit can leave a partial result. Custom agents report results; they do not gain write roles. You can also explicitly ask the parent agent to invoke a custom agent; this is a different entry point from the direct slash command. /reviewer … is not automatically registered as an alias.

Frontmatter and turn limits

FieldType / exampleEffect
namestring, ReviewerDisplay name, not the invocation key.
descriptionstringPurpose in the list and agent description.
Markdown bodyText after frontmatterThe specialist agent’s system prompt.
toolsstring[], [Read, Grep]Requested tools, intersected with the fixed custom-role ceiling.
modelstring from the public model listOptional agent model; availability and plan restrictions still apply. Do not guess internal identifiers.
maxTurnsfinite number, 12Rounded down. Values below 1 are invalid and treated as absent; values above 50 are capped at 50. Without a valid value, 25 turns.

A turn limit is not a fixed runtime or reserved budget. Model or tool failures can end a task earlier. Extra mode, isolation or arbitrary permission fields do not unlock agent capabilities.

Fixed tool ceiling

Custom agents can receive only these built-in tools:

Read
Glob
Grep
ListDirectory
SemanticSearch
RepoMap
GetMemory
GitInspect
  • Missing tools: the entire list above is the starting allowlist.
  • tools: []: no tools.
  • tools: [Read, Bash, Write]: only role-compatible tools remain, here Read.
  • Agent frontmatter cannot unlock Bash, Exec, Write, Edit, MultiEdit, Delete, web tools or MCP.
  • Mode, policy and permission checks apply in addition to the allowlist. A tool list is not blanket permission to read secrets or external paths.

Internal write-capable orchestrator roles are not custom agents. This ceiling is useful for a read-only reviewer. Running tests or modifying files requires a different workflow with explicit parent-agent permissions.

Trust binds source and content

Approval applies to the name, source, resolved path and contents of the entire file. Global and project files are separate sources. Frontmatter changes therefore also require review.

An already loaded agent prompt and hash do not refresh automatically from disk on every invocation. After editing:

  1. Start a new CLI session.
  2. Check /agents show reviewer and its source.
  3. Review the file and, if needed, run /agents trust reviewer again.
  4. Start the task with /agents run reviewer ….

There are no supported /agents create, reload or remove subcommands. To remove an agent, deliberately remove your file manually and restart. Manage trust through the CLI rather than editing internal settings or registries.

Advanced: Git-only review

Create .lurus/agents/git-reviewer.md:

---
name: Git reviewer
description: Review tracked changes using read-only Git inspection
tools:
  - GitInspect
  - Read
maxTurns: 8
---

Inspect the current diff and read relevant files. Separate confirmed problems from suggestions. Do not change files or run commands.
/agents show git-reviewer
/agents trust git-reviewer
/agents run git-reviewer Check the current diff for regressions.

Expected result: a scoped read-only review report, no Git commit or shell test run. The key is git-reviewer, not Git reviewer.

Troubleshooting

ProblemAction
Agent missingCheck project CWD, .md path, restart and path-derived key. Command/built-in collisions may skip an agent.
Wrong sourceA project agent replaces a global file with the same key.
Trust requested againHash, source or path changed, or the previous persistence attempt failed.
Tool missingCheck the fixed role ceiling and an explicitly empty tool list.
Task incompleteCheck partial output and turn limit; scope the task more narrowly instead of bypassing tool protections.

Next: permissions, skills, orchestration.

A deliberate choice

Before your first prompt.

Interactive demo
Lurus Codeprivacy-demo · illustrative workspace

Demo session ready. Your model choice and data route are separate decisions.

Illustrative scenario. No real sign-in, security test or code transmission takes place.

Image preview