Skip to content

Take every command's body by --text, --file or stdin - #3375

Merged
max-sixty merged 8 commits into
mainfrom
agent-a5a9443e10d192b44
Oct 20, 2026
Merged

max-sixty merged 8 commits into
mainfrom
agent-a5a9443e10d192b44

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Every leaf command that takes a body now takes it the same three ways: --text inline, --file PATH (- reads stdin whatever it is), or, with neither, a pipe or heredoc on stdin. Giving both options is a usage error.

Before, prose bodies (page stamp, thread open, thread reply, thread edit, thread summarize, response reply) took --text or stdin and had no --file, while JSON bodies (data set, task plan) took --file or stdin and had no inline option.

Why this convention. Two weeks of Claude Code transcripts on this machine hold about 1,300 calls that pass a body. Agents used every route: inline --text about 550 times, a heredoc about 370, a pipe or redirect about 230. Removing any route would break a habit agents already have. The failures came from the routes a command lacked:

  • One reply guessed response reply --file and was refused.
  • evals/plan's history records agents passing plan JSON as an argument.
  • About 25 calls in worktree-isolated sessions were refused by Claude Code's guard, because inline text made a compound command unverifiable. A --file written with the Write tool keeps the command plain.

--markup stays inline only: 10 calls with markup in the same window, none failed. One-line labels (status DETAIL, task start LINE, task end DETAIL, task open TITLE, --title, --todo) stay as they are, since they are labels rather than bodies.

Where it lives.

  • cli.body_options(subject) declares the pair, and cli.read_body resolves it in the CLI, so no command module reads stdin.
  • validation.admission.read_text_arg becomes checked_text: it checks a body the CLI resolved.
  • thread edit --title alone still leaves the text and stdin alone.
  • test_every_body_takes_text_and_file holds every command with either option to both.
  • SKILL.md "Operate" states the convention once. threads.md and the delivery handling text in registry.json show --file for a long reply or summary, and package-data.md shows --text for an inline JSON value.
  • A missing body is refused with one message naming every route, --file - included, which a caller whose pipe is a socket needs.

Scored. plan-shows-multi-step-work, thread-fold-without-summary-prose and deferral-holds-a-todo on Claude Code passed 2 of 2 on both the base and this branch. The agents kept writing plans by heredoc and replies inline, and every body they passed is valid under the new CLI.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 7 commits October 20, 2026 13:44
The skill told the agent to run `leaf page check` before replying about a
revision. That cost a model call (2 to 8 s) on every revision reply, plus the
check itself: 0.3 s on a plain page and 11.6 s on a page with scripts, data
widgets or media, where the check opens a browser. `leaf response reply`
already checks the saved source and refuses the reply over an error, so the
reply is now the only step.

- The shipped instructions send a revision that answers a message straight
  to the reply (SKILL.md "Check the page", conversation-loop.md). A first
  handoff and a record's stamp keep `page check`. The App Server contract
  keeps it only where the turn's final message is the reply, since that posts
  after the turn ends and a refusal there costs a correction turn.
- The first agent reply on a revision notes on stderr the advice `page check`
  gives on its source: threads the revision relocates, measurement lag,
  unreadable data and unpointable blocks (`validation.source.source_advice`,
  which now includes the relocation advice). Later replies on that revision
  repeat none of it. The reply's help says what it checks and that nothing
  runs in a browser.
- The reply leaves out `page check`'s Leaf version note. Reading this Leaf's
  provenance runs three git commands where the payload is a git checkout, as
  Codex installs and developer checkouts are. That measured about 160 ms, and
  would have added that to every first reply on a revision.

Reply time on `security-boundary`, median of 7 cold runs: 0.27 s before,
0.26 s after.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…op App Server's check before the final reply

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Every `leaf` command that takes a body now takes it the same three ways:
`--text` inline, `--file PATH` (`-` reads stdin whatever it is), or, with
neither, a pipe or heredoc on stdin. Prose bodies used to lack `--file` and
JSON bodies (`data set`, `task plan`) lacked an inline option.
`cli.body_options` declares the pair and `cli.read_body` resolves it, so no
command module reads stdin; `admission.read_text_arg` becomes `checked_text`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 20, 2026
# Conflicts:
#	skills/leaf/assets/registry.json
#	tests/model/interact_contract/_regtest_outputs/test_layer_contract.test_each_case_of_an_event_is_told_what_the_snapshot_shows__0/snapshot.yaml
#	tests/model/interact_contract/_regtest_outputs/test_layer_contract.test_each_route_hands_the_agent_what_the_snapshot_shows__0/snapshot.yaml
@max-sixty
max-sixty merged commit ef31ed0 into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-a5a9443e10d192b44 branch October 20, 2026 22:12
max-sixty added a commit that referenced this pull request Oct 21, 2026
…side it (#3396)

A survey of `notes/` against the code and history at d91b67b. Where a
note's design has landed, its contract moves beside the code if it
wasn't already there, and the note or section goes; what is still
unresolved stays.

- **Deleted:** `floating-panel/GOAL.md` (every departure is now recorded
in `floating-panel.js` and `styles/floating-panel.css`; #3392 moved the
last one, the draft posture, beside `drafted`, and this adds the
no-key-hints decision to the header), `browser-reactivity.md` (its
design is in module headers; why paints that must land in the turn use
`render` moves to `assets/AGENTS.md`, and the margin's double draw
becomes a TODO implementation candidate) and `chrome-and-covers.md`
(`page-layout.md` holds the workspace decision; the `layouts.css`
Workspace comment now records the rejected main-region-scrolls design).
- **Trimmed:** `agent-usability-evals.md` drops the findings through
2026-10-12, which have landed. `comparisons.md` drops the phone-pin
finding (#2680), the 4 October follow-up proposals and two landed
lessons. `user-feedback-responsiveness.md` narrows delegated work to
Codex and Pi (#3370) and drops "Explicit stdin" (#3375). `threads.md`
drops request buttons (#1327), placement (#2134) and notification
transitions. `shared-decisions.md` points at the recorded owner
contract. `browser-support.md` drops two fixed entries and owners #3100
removed.
- **TODO.md** follows each: #28 points at the module header, #25 asks
for the board's write rather than an owner, the annotation-placement
item loses its landed phone half, and the delegated-work and
reply-budget items lose what #3370 and #3372 settled.
- Smaller corrections in `shift-watch-cost`, `undo-reach` (#3271),
`named-widget-interfaces`, `codex-integration` (`codex_tool.py`), the
long-read eval's provenance comment, and `motion.js`'s fold comment. The
runtime comment edits rebuild `kernel.json` only.

No behavior changes.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants