Skip to content

Measure Claude Code's new fork effort option for the clerk and thread replies #5302

Closed

Description

@leaf-agent

Claude Code 2.1.318 (published 2026-11-03) added an effort option to a mod's $.model.fork: "so a quick side job can run at low whatever effort the session uses; the result reports the effort sent." Leaf's two forks could use it to cut the time a thread reply takes. Whether they should depends on cache behavior nobody has measured yet.

Where Leaf forks. hooks/claude-code.ts calls $.model.fork({ prompt }) in two places, at L319 and L375: the clerk at each turn end, and the fork that answers a user's thread message. Both run at the session's own effort.

Possible gain. notes/fork-replies.md puts a reply's median time from send to reply at 12 s. A median of 829 output tokens dominates that time, and 77% of those tokens are thinking at the session's xhigh effort. Short answers of 200–300 tokens took 4.5–6 s. A lower effort for the clerk, and maybe for replies, could cut most of that wait.

Risk. The same note found that a claude -p --fork-session fork at --effort low read none of the main thread's cache. The header at L298 relies on the fork resending the same effort so the cache serves the conversation. It is unknown whether the new option keeps the cached prefix. If it does not, each fork writes the whole 46–77k-token context uncached, which costs more. The note does say that cold versus cached context "changed the time little", so the latency gain may hold even then.

Proposed next step. In the Claude Code journey, run the clerk and a thread reply with effort: "low". Compare time to answer, output tokens and cache read/write against the current forks. Then decide each fork's effort separately. The header at L298 and the src/leaf/forks.py header would change with it.

I confirmed the changelog entry and both call sites. The latency and cost effects above are a hypothesis from the note's measurements, not something I measured.

Activity

  1. leaf-agent commented on Nov 4, 2026

    @leaf-agent
    CollaboratorAuthor

    I can't run this measurement here yet. The triage runner has Claude Code 2.1.310 installed, and the effort option on $.model.fork first shipped in 2.1.318, so the comparison has nothing to test against on this runner. The issue is open and the next step is unchanged: once a 2.1.318+ install is available, it needs one claude-code journey run with each fork at effort: "low" and one at the current default.

    Most of what that comparison needs is already recorded. The clerk hands each fork's usage and elapsed_ms to Leaf (hooks/claude-code.ts), and Leaf notes them in the page's diagnostics. The experiment then only needs the effort argument added at the two fork calls. The cache read and write counts in that usage answer the risk the issue raises. src/leaf/clerk.py states the same assumption as the hook header: the fork reuses the cached prefix only while the request matches the main thread's. If the low-effort fork turns out to keep the cache, both headers need rewriting.

  2. added
    backlog
    next
    agent-experience
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-experiencebacklognext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions