Repository navigation
Say why the fork eval replays a transcript, and which prefix it sends - #6570
Merged
Merged
Conversation
The header said the replay keeps the tool definitions a live fork resends. It sends `claude -p`'s headless prefix: "You are a Claude agent, built on Anthropic's Claude Agent SDK.", a 4,300-character system prompt and 12 tools, where an interactive session's request carries "You are Claude Code, Anthropic's official CLI for Claude.", 15,800 characters and 21 tools (captured `/v1/messages` bodies on Claude Code 2.1.329; a live session's `api-request-shape` on 2.1.328). The header now also says why the replay resumes a transcript rather than asking the fork in one composed message, which the Agent SDK can send on the login. Measured 2026-11-19 with that route (`claude -p --system-prompt <the headless text> --tools ""`, the conversation as `conversation_text` renders it, then the prompt), comparing the two requests whole, since they also differ in tools and reminders: - All 35 fork cases, one sample each: both routes pass every deterministic check (the text judges weren't run). List-price cost $2.14 against the replay's $2.84; 6,300 input tokens per case against 24,500. - `source-edited` on the arm before #6477: the replay handed the read of the page's source over 3 times of 12 (4 of 10 in #6477's own run), the composed message 0 of 12; pooled, 7 of 22 against 0 of 12, Fisher p = 0.04. #6477 measured 29 of 60 on three journey sessions' own conversations sent with nothing after the prompt. The composed forks wrote 56 output tokens on average there, the replay's 230. Sending a live fork's request exactly needs a Messages API client: on an API key, which `eval run` keeps out of evals, or on the login token Promptfoo's `anthropic:messages` takes from the keychain.
leaf-agent
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fork eval's module header said the replay keeps the tool definitions a live fork resends. It sends
claude -p's headless prefix instead: the Agent SDK identity line, a 4,300-character system prompt and 12 tools, where an interactive session's request carries the Claude Code CLI identity, 15,800 characters and 21 tools (captured/v1/messagesbodies). The header now says so, and records why the replay resumes a transcript rather than asking the fork in one composed message: that route passes all 35 cases' deterministic checks for a quarter less, but onsource-editedunder the line fork prompt before #6477 it handed the source read over 0 times of 12, against the replay's 7 of 22 across this run and #6477's.Docstring only; no behavior changes. Max asked whether the fork evals could score a request we compose; the full comparison, with the terms on running the Agent SDK on a subscription login, is on a Leaf page in that thread. Fork replay smoke tests pass.