docs: diagnose why the witan-code inject-context block is not acted on - #327
Open
blarghmatey wants to merge 3 commits into
Open
docs: diagnose why the witan-code inject-context block is not acted on#327blarghmatey wants to merge 3 commits into
blarghmatey wants to merge 3 commits into
Conversation
PR #163's rewrite was measured over 1.5 days, which could only rule out a large effect. Over 34 days and 100 sessions the session-level adoption rate is flat at ~6% and the per-injection attempt rate fell, so the line the rewrite added is not working. The mechanism is substitution, not deferral. code_* and task_* arrive deferred in the same 97 of 100 sessions at the same ToolSearch cost; 89 sessions pay it for task_* and 6 for code_*. What separates them is that nothing but witan can claim a task, while `rg` can find a definition, and it is run 6,432 times against 3 code_find_definition calls. The Grep tool is called zero times, so the block's "instead of grep" does not even name the habit it is competing with. Records the numbers, the two measurement traps that silently report zero, and why the next move is not another rewrite of the block. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ki2iWyNzEzD1c4tJM7WYPA
…pt shows The failed lookup errored on a stale store rather than returning empty, and the one empty result and the one branch="main" success were different symbols, so the branch-view story is a hypothesis to check against _resolve_branch, not a finding. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ki2iWyNzEzD1c4tJM7WYPA
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Central conclusions overstate the measured evidence, and the provided reproduction script omits decisive calculations.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Documents why the witan-code context block sees low adoption and proposes follow-up experiments.
Changes:
- Adds a 100-session uptake analysis.
- Documents substitution and deferral hypotheses.
- Adds the diagnosis to internal documentation navigation.
File summaries
| File | Description |
|---|---|
zensical.toml |
Adds navigation entry. |
docs/internals/index.md |
Links the diagnosis. |
docs/internals/design/witan-code-uptake-diagnosis.md |
Adds findings, methodology, and reproduction steps. |
Review details
Suppressed comments (4)
docs/internals/design/witan-code-uptake-diagnosis.md:29
- The
task_*comparison shows that agents can pay the loading round trip, but it does not isolate deferral’s effect oncode_*: 75/100 prompts already named a task and task operations have no Bash substitute. The proposed non-deferred experiment in item 2 is what can distinguish loading cost from substitution, so substitution should remain a hypothesis rather than the demonstrated binding constraint.
**Deferral is not the binding constraint.** `code_*` and `task_*` arrive
deferred in the same 97 of 100 sessions, at the same `ToolSearch` cost.
89 of those sessions pay that cost for `task_*` and 6 for `code_*`.
docs/internals/design/witan-code-uptake-diagnosis.md:34
- The later table identifies 6,432 as all Bash invocations using
rg/grep/find/fd; only 674 are classified as definition lookups. Here, “those” reads as 6,432 definition lookups and overstates the directly substitutable behavior by nearly 10×.
runs 6,432 of those.
docs/internals/design/witan-code-uptake-diagnosis.md:154
- The 89% figure is the share of sessions issuing a
task_*ToolSearch, not tool uptake acrosstask_*,workflow_*, andmemory_*; the table explicitly omits session counts for the latter two. Limit this claim to the measured task-search metric instead of attributing 89% uptake to all three families.
Deferral is free when nothing else can answer (`task_*`, `workflow_*`,
`memory_*`: 89% uptake) and decisive when something can, because the
substitute is already loaded, always works, and is named approvingly by a
docs/internals/design/witan-code-uptake-diagnosis.md:192
- This snippet cannot reproduce the report’s decisive substitution measurements: it never inspects Bash inputs, classifies
rg/grep/find/fdor definition lookups, or computes their per-session counts. It also does not count ToolSearch queries for workflow/memory families. Include the omitted classifiers (and output for the low-frequencycode_*tools) or avoid calling this the “whole rig,” because the 6,432, 674, 94/100, and family-comparison figures currently cannot be verified from it.
Worth checking against `_resolve_branch`'s fall-through to main.
## Reproducing
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…crease Copilot was right that "the attempt rate went down" is not supported: 6/586 vs 8/951 is Fisher p=0.79, and 3/51 vs 6/100 is p=1.00. Replaced the directional claims with the point estimates, the tests, and the one thing the window does establish — a 95% ceiling of 12.5% on post-#163 adoption, which excludes a large improvement and nothing else. Same treatment for the 20% block-only claim task uptake rests on: n=25, CI [8.9%, 39.1%], so the useful conclusion is that the headline 59% is confounded rather than that 20% is the true rate. Adds a note that the two findings the diagnosis turns on (89/100 vs 6/100, p<0.001; 674 rg lookups vs 3 code_find_definition) do not depend on the underpowered pre/post comparison. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ki2iWyNzEzD1c4tJM7WYPA
blarghmatey
added a commit
to blarghmatey/dotfiles
that referenced
this pull request
Sep 4, 2026
Measured over 100 agent-kit sessions (mitodl/agent-kit#327): the Grep and Glob tools were used zero times in 27,277 tool calls, while Bash ran rg/grep/find 6,432 times, 674 of those definition lookups. Against that, the witan-code inject-context block's "use code_* instead of grep" produced 3 code_find_definition calls. This line is a plausible part of why: it is in the system prompt of every session in every repo, it names the competitor approvingly, and it outranks an injected context block. Removing it tests that. It is not the whole story — Claude Code's own prompt and auto mode push toward Bash search independently — so a null result narrows the cause rather than clearing it. Baseline note for whoever reads a later measurement: sessions from 2026-09-03 onward no longer carry this instruction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ki2iWyNzEzD1c4tJM7WYPA
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.
Closes
tk-diagnose-why-the-witan-code-inject-context-block-440e8d.The previous re-measurement of PR #163 covered 1.5 days and 66 injections,
where the pre-existing rate predicts ~0.6 calls. It ruled out a large
improvement and nothing else. This re-runs it over 34 days and 100 sessions
and then answers the question the task was actually filed for: what stops
the block from being acted on.
Does the line work?
No detectable change, and the window bounds rather than settles it. Session
adoption is 3/51 → 6/100 (Fisher p = 1.00) and the per-injection
ToolSearchattempt rate the rewrite targeted is 6/586 → 8/951 (p = 0.79) — point
estimates, not a demonstrated decrease. The 95% interval on post-#163
adoption is [2.8%, 12.5%], so a large improvement is excluded and a small
one is not. Raw calls rose 5 → 17 (p = 0.18), entirely from two sessions
using the tools more.
Why not?
Not deferral.
code_*andtask_*arrive deferred in the same 97 of 100sessions, at the same
ToolSearchcost. 89 of those sessions pay it fortask_*and 6 forcode_*(p < 0.001).Substitution. Across 27,277 tool calls the
GrepandGlobtools are usedzero times; all searching is
Bashrunningrg/grep/find— 6,432invocations in 94 of 100 sessions, 674 of them definition lookups, against
3
code_find_definitioncalls. So the block's "use them instead of grep"names a behavior that does not occur, while the habit it means to displace
lives in a different tool and is endorsed by a standing system-prompt
instruction. The
code_*tools that do get used (14 of 17 calls) are theinventory and cross-repo ones
rgcannot answer;code_callersandcode_impact, the payoff the block's own template names, were called zerotimes in 951 injections.
Those two findings are the ones the diagnosis rests on, and neither depends
on the underpowered pre/post comparison.
The task's leading hypothesis — that witan-council's In-Flight Branch block
wins by naming a specific thing — is retired as confounded: 75 of 100
sessions began with a prompt already naming a task slug, and 53 of those
claimed. Among the 25 whose prompt named no task, block-only uptake is 5/25
(CI [8.9%, 39.1%]) — small enough to leave the rate loosely pinned, but
enough to show the headline 59% is not the block's own effect.
What this does not do
Rewrite the block. The task said not to spend the 600-char budget
(
test_inject_context_block_stays_small) until the mechanism had an answer;the answer is that the mechanism is not wording, so a better-worded
exhortation is still an exhortation. Follow-ups are filed separately.
Docs-only.
just docs-checkandjust docs-buildpass; nav wired intodocs/internals/index.mdandzensical.toml.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ki2iWyNzEzD1c4tJM7WYPA