Use an agent inside your step
A custom step can start the agent CLI you already configured. That is Claude Code, or the Cursor CLI with the model setting it accepts. Kusaw does not choose one for you. Pass a runner [preset](../glossary.md#preset) (`read_only`, `edit`, or `interview`) rather than assembling vendor flags by hand.
A custom step can start the agent CLI you already configured. That is Claude Code, or the Cursor CLI with the model setting it accepts. Kusaw does not choose one for you. Pass a runner preset (read_only, edit, or interview) rather than assembling vendor flags by hand.
kusaw agent-args prints the argv the built-in runner would use for that CLI: the command, isolation flags, and, when you pass --model, the model. Your step runs that argv instead of assembling vendor flags by hand.
kusaw claude-args stays as an alias of kusaw agent-args --provider claude-code. Its output is the same.
Print the argv
The default provider is Claude Code. A step that already has KUSAW_AGENT_PROVIDER set (from the factory) can omit --provider.
On a demo repo, Claude Code:
kusaw agent-args --preset read_only
# same as:
kusaw claude-args --preset read_onlyCursor, after it is enabled in allowed_providers:
kusaw agent-args --provider cursor --preset read_onlyRead-only is the default review shape. Edit is the default build shape. Pass the printed argv to the process you start, with the request's worktree as the working directory and the prompt on stdin.
--model is passed through only when given, unchanged. The helper keeps no model list and adds nothing about endpoints or credentials.
From a custom step
Keep the handshake and result contract from Write your first step. When you want an agent turn, spawn "$KUSAW_BIN" agent-args (or cache its output), then spawn the printed command. Forward progress if the agent CLI emits it. End with ok, fail with feedback, retry, or reject as you would for any other program.
Do not hard-code a model name, an endpoint, or credentials. The user already configured the CLI. If the step config includes model, kusaw agent-args passes the setting that CLI accepts; if model is empty, that user's default stays.
Interview is Claude Code only. Cursor refuses it with the same capability message the built-in runner uses.
Complete pipelines that call kusaw agent-args from POSIX sh are in Example pipelines.
Replace a built-in step
Point a pipeline entry at your `command:` instead of `builtin:`. Keep the same step id so gates, loops, and feedback keep working. The built-in steps stay available as defaults; replacing one is a config change, not a new pipeline.
More examples
Each of these is a small, complete program that speaks the step protocol.