← Catalog

pi-step-labels

shows the `[step] description` comment an agent writes on the first line of a script as a header above the tool call in pi.

Extension

Install

Install with PiG

pig install npm:pi-step-labels

Install with Pi

pi install npm:pi-step-labels
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.0 (README.md). PiG does not review it.

pi-step-labels

npm MIT License

shows what each tool call in pi is for, in a header above the call.

beforeafter
pi tool calls without labels: a bare bash command and a codemode scriptthe same calls with pi-step-labels: each has the tool name and a step label with its description above the code

when an agent starts a script with a label comment, like # [build] compile the release binary, this extension takes that line off the code and draws it as a header. the tool name comes first, then the step and its description, a blank line, and the call as pi normally draws it:

bash
build # compile the release binary

$ cargo build --release
codemode
scan // count tool calls per week

const r = await tools.bash({ command: "..." });
return r.output;
mcp__roblox_studio execute_luau
rig-fix -- reparent the arm bones

...

the step name stays the same across all the calls in one step, so a long run reads as a list of steps instead of a wall of shell.

install

pi install npm:pi-step-labels

style

two styles, set with stepLabels.style in pi's settings.json (~/.pi/agent/settings.json, or a project's .pi/settings.json):

{ "stepLabels": { "style": "divider" } }
  • stacked (default): a blank line between the header and the call
  • divider: a full-width line between the header and the call
the divider style: a thin line separates each header from the call below it

the setting is read when a session starts; run /reload after changing it, or use /step-labels below.

summary view

alt+o switches every tool row to one line: the tool name, the step and description (or, for calls without a label, the first argument, like read's path), then the status and time. a running call shows a clock that ticks every second; a finished one shows ✓ or ✗ and the duration pi recorded, which is kept in the session, so resumed history has it too. the script and its output are hidden until you press alt+o again. ctrl+o still collapses and expands output in the normal view.

the summary view: four calls, one line each, with the step, description and time; two passed, one failed, and the last is still running with a ticking clock

clicking a row in summary view opens just that row: the first click shows it the normal way, the second expands it like ctrl+o, the third folds it back to one line. when expanding would show nothing more, the second click folds it back instead. ctrl+o and alt+o fold every row back.

one codemode call clicked open to its full view, with its label header, code and result, between one-line rows

to start every session in it, run /step-labels view summary, or set:

{ "stepLabels": { "view": "summary" } }

alt+o itself only changes the current session.

the summary view covers every tool with a renderer, not just the labeled ones.

/step-labels

/step-labels opens a menu with both settings; /step-labels view summary or /step-labels style divider sets one directly (tab completes the values). the change shows at once and is saved to stepLabels in the global settings.json, leaving the rest of the file as it is. a project's .pi/settings.json still wins over it in later sessions.

the /step-labels menu listing view: summary and style: stacked

the agent writes the labels

the extension appends one rule to pi's system prompt, so the model labels its script calls on its own: every call that runs a script gets a first-line comment in that script's comment syntax, with a step name that stays the same across the calls in one step. it also tells the model the label is no reason to prefer bash over one codemode call.

the rule is appended to the prompt as other extensions leave it (ponytail, pi-yaml-hooks and others rewrite the prompt too), and its text never changes, so it doesn't break the prompt cache. you don't need to add anything to APPEND_SYSTEM.md or AGENTS.md.

what counts as a label

  • the first line of the script (or the second, after codemode's // @options: line)
  • a comment marker, #, //, --, ; or %, then [step], then an optional description
  • the marker you see between the step and the description is the one the agent wrote

a plain comment (# build it), a shebang, or a label further down the script is left alone.

which calls

any tool whose arguments have a script in command, code, script, function, statement, query or stdin, either at the top level or inside an MCP proxy's args. for MCP proxies the header also names the tool that was called on the server.

tools without a script field (read, edit, write…) are drawn as before. write's content is skipped on purpose, so a markdown # [1.0.0] heading isn't taken for a label.

the label is removed from the display only. the model and the tool still get the script exactly as written.

tip: MCP rows

pi-mcp-adapter draws its calls without a background by default. to give them the same boxed row as bash and codemode, set this in its config (~/.pi/agent/mcp-adapter.json):

{ "settings": { "toolResultRendering": "boxed" } }

development

npm install
npm test
npm run typecheck

license

MIT