AWS Builder Center

What a code-history wiki actually buys a coding agent

We asked how much a codebase's story changes the code an agent writes, and on which dimensions. On a well-run library the answer turned out to be narrow, specific, and cheaper than we expected.

Here is the question we started with. A coding agent reading a repository at HEAD is a very fast new hire who has read all the code and none of the history. It sees what the code is. It doesn't see that the team spent six months migrating off a pattern that still has three hundred call sites, and that adding a three-hundred-and-first would be a small act of vandalism. That knowledge lives in the git log, in pull-request discussions, in the heads of people who were there.
So we built a generator that recovers it. Point it at a git repository and it produces a multi-page wiki (module pages, architecture, glossary) plus the page we cared about, a  journey.md  that distils the commit history into prose: epochs, convention migrations, "this used to be called X, it's called Y now, here's the PR, here's why."
It's open source, and it's the thing being measured in everything below:  aws-samples/sample-code-journey-wiki-generator . There's no service to run. It ships as agent instructions plus page templates, packaged for Claude Code (as a  /wiki  skill), Kiro IDE (as a spec), and Kiro CLI (as an agent). The agent does the git archaeology and writes the pages.
The question this post answers is the obvious next one: how much does that help, and on which dimensions? We set out to measure lift and break it down across convention adherence, architectural fit, historical awareness, and completeness. What we found is that on a mature, self-documenting library, most of those dimensions have no room to move, and the honest answer collapses onto a single dimension where the effect is total. The rest of this post is that answer, and the reason it's shaped the way it is.
What we set out to measure, and what we could. The plan was a clean lift-decomposition: run the same task with and without the wiki, score all four dimensions, report where the journey page helped and by how much. The corpus had other plans. Four of the five things we tried to measure were already answered by the repository itself, so the wiki had no room to move them, and no experiment on this repo could show a lift that isn't there. The study that survived contact with the data is narrower and sharper: which single dimension still has headroom, and how completely does the journey page move it? Everything below is organized around that question. The answer first, then why the other four dimensions dropped out.



The design

Five arms, layered on top of full read access to the same repository:
Arm
Context
A
nothing, the floor
B
a handwritten CLAUDE.md, the industry-standard approach
C
the full generated wiki minus the journey page
D
the full generated wiki, journey page included
E
the journey page alone
The comparison we cared about was D minus C: same wiki, one page different. If the journey page does anything, it shows up there. E minus A asks the mirror question. Does the journey page do it alone?
The task was a convention trap. Take a real library (Powertools for AWS Lambda for Python, pinned to a commit) and find a place where a v2-era API was renamed in v3. Drop in a fresh file that needs the functionality. A model whose training data is thick with v2 code has a prior pulling it toward the old name. Does the context save it? Fifteen trials: three tasks, three kinds of change (a function rename, an API-shape migration, an accessor deprecation with a semantic twist), five arms.
Everything was controlled the way you'd hope. Identical checkout per arm, in-repo answer keys pruned identically across all five, seed file md5-identical, prompt byte-identical across arms via a masked digest, so only the files on disk differed. We re-assembled every workspace afterwards and diffed it to confirm no agent had edited the library source. Fifteen out of fifteen clean.



The answer, up front

Of everything we tried to measure, one dimension moved, and it moved completely.
Dimension
Did the wiki move it?
What the data shows
Convention adherence
No, ceiling
4.33 to 5.00 in every arm, and the ordering doesn't track the journey page: the floor arm (4.67) outscored the journey-only arm (4.33)
Architectural fit
No, ceiling
unanimous 5/5 everywhere
Completeness / reuse
No, ceiling
~5/5 everywhere
Trap avoidance (does the code use the right API)
No, ceiling
15/15 in every arm, floor included
Historical provenance (can the agent say why the current API is current)
Yes, total
0/3 without the journey page, 3/3 with it
So the answer to "how much, and where":
Where: exactly one dimension. The agent's ability to ground its choice in the repository's actual history (the dated PR, the documented reason), not just name the right API. How much: on that dimension the effect is complete. Arms with the journey page scored 3/3; every arm without it scored 0/3. D−C = E−A = +100 percentage points, consistent across all three tasks. And the journey page delivered it at 19.6% of the full wiki's injected context (2,793 vs 14,219 tokens).
That is a smaller claim than "the wiki makes agents write better code," and the gap between the two is the whole story. Every other dimension was already maxed out. Not because the wiki is weak, but because the repository answers those questions itself. To see why, look at what kept hitting the ceiling.



Why only one dimension could move

We didn't plan to write about measurement. We planned to measure lift. But four times in a row, the instrument that was supposed to show lift turned out to have no headroom, and understanding why is what tells you which dimension is real.

The trap kept defeating itself

First smoke run: 5/5 trap avoidance in every arm, floor included. The correct API was demonstrated in the repo's own  examples/  directory; any agent that grepped found it. No history required.
We hardened it. Picked a rename where the deprecated function is still present, exported and callable, so there's no  ImportError  to give the game away, and pruned every example and doc that showed the new form. Second smoke run: 5/5 again. This time the cause was fundamental. The deprecated function carried its own antidote:
@deprecated("`extract_data_from_envelope` is deprecated; use `query` instead.", category=None)
def extract_data_from_envelope(data, envelope, jmespath_options=None):
warnings.warn(
"The extract_data_from_envelope method is deprecated in V3 "
"and will be removed in the next major version. Use query instead.",
...
)

Every agent, in every arm, opened the definition of the function it was about to call, read that line, and corrected itself. The floor arm didn't need history. It needed to read one decorator. And you can't prune that: it's in the body of the code under test.

So we asked whether any trap could discriminate

Instead of hardening a third trap, we asked the prior question: on this repository, can a convention trap discriminate at all? We classified every migration the journey page documented on two axes. Lure: is the old form still present and callable at HEAD? Oracle: does the working tree itself name the successor, via a  @deprecated  annotation, a warning string, a docstring?

Nine documented migrations. Five had a live lure. All five landed in Q1, tempted then corrected by the tree. Q2, the only quadrant with any code-level headroom, was empty.
This generalises well beyond our project: a library disciplined enough to ship deprecation annotations has, by that very discipline, published the answer next to the question. The better maintained the codebase, the less room any external context (your wiki, your  CLAUDE.md , your RAG pipeline) has to improve code-level correctness on convention tasks. If you're evaluating a context system and you get a null result, check this first. You may not have learned that your context is useless. You may have learned that you picked a well-run repository.
We ran the full pilot anyway, so the ceiling would stand as a pre-registered prediction rather than a post-hoc excuse. Trap avoidance: 15/15, every arm, exactly as predicted. In all fifteen trials the agent found and cited the in-source deprecation marker, unprompted.
One thing to be plain about: nothing in that pilot was executed. "Trap avoided" was a regex over the diff and "correct API" was an  ast.parse . No test suite was run. We fixed that later, and it's the fourth ceiling below.

The LLM judge maxed out too

We had a second track: an LLM-as-judge scoring each blinded submission 1 to 5 on four dimensions, one being historical awareness. Blinding was strict. A script rewrote every mention of a context file to "a project documentation file" and refused to emit a bundle that still leaked (it caught two real leaks on the first run). Three passes, randomised order, median per dimension.
Historical awareness came back 5.00 out of 5 for all fifteen submissions, floor included. The judge wasn't broken. Here it is explaining a perfect score for the no-context arm:
"Names the rename explicitly, cites the  @deprecated  marker and  PowertoolsDeprecationWarning , and chooses  query  because it is the current name, not merely by accident."
That is a correct reading of our rubric, whose score-5 anchor was "could cite why: the project moved from X to Y." The agent cited why. It got the fact from a decorator instead of from history, and the rubric couldn't tell the difference. The lesson, which is not about us:
An LLM-judge rubric for a context claim can be quietly satisfied by the very context you're trying to control for.
There's a coda worth keeping, because it's the difference between honest and overclaiming. That 5.00 is a median of three. One pass, blind to arm, docked exactly two trials on this dimension, and both were the floor arm, reasoning that they "argued only from the  @deprecated  decorator in source, with no reference to the project's version trajectory." That is our whole hypothesis, rediscovered from the anchors alone by a rater we gave no hint to. Then the median of three erased it.

So the rubric was ambiguous, not unusable. One rater in three read the boundary the way we meant it, and median-of-three, which we picked for robustness, is exactly the wrong aggregator when the discriminating rater is the minority. Never look only at the aggregate. Report per-rater means per condition.

And when we finally executed the code, the network answered

A metric nobody executed is a metric nobody has tested. So we rebuilt the outcome on SWE-bench Verified, where the measure is the project's own test suite running in a container and the grader is somebody else's harness, on  psf__requests-1766 : quote the  qop  directive in Digest auth, per RFC 2617. (To avoid handing the agent the answer key, the wiki was generated from a clone whose history ends at the base commit, verified by grepping the generated pages for any post-cut identifier and refusing to run if one appeared.)
All five arms produced byte-identical patches, one pair of quotes, and all six graded tests passed in all five. That's the fourth ceiling, and again we called it before the run: a one-token RFC fix has no room for context to move an executed pass/fail.
Except the harness reported four resolved and one not. The floor arm, same bytes as the others, was marked unresolved because one unrelated test posted to the live public httpbin service and got a 502.  resolved  is a single boolean AND over "fixed the bug" and "broke nothing," and a stranger's server flipped it. Identical bytes, different verdict, and the difference was the weather. An executed metric feels more authoritative than a judge; at k=1 it was noisier. The point that survives: an executed metric is not automatically a trustworthy one. Record which tests failed, not just the boolean.



The dimension that did move

Every ceiling above is a dimension the repository can satisfy on its own. To measure the one it can't, we built a metric the repository can't fake.
The first attempt failed instructively. We keyed on version tokens: does the agent say "v3"? But the in-source warning text itself says "deprecated in V3," so the token proves nothing about where the knowledge came from. So we went through the migration facts and kept only the ones  grep  confirmed were absent from the pruned tree: release dates ( 2024-09-23 ), pull-request identifiers ( #5028 ), and the documented reason ("too generic," "per RFC 9110"). Zero occurrences each. An agent that produces one of those did not get it from the code; there's nowhere else to get it. We kept the discredited version-token check in the results, labelled as a non-discriminator, precisely so the contrast stays visible.
Arm
Context (tokens)
Trap avoided
Version-aware (fakeable)
History-grounded  (unfakeable)
Judge "historical" (median)
A (nothing)
0
3/3
2/3
0/3
5.00
B (handwritten CLAUDE.md)
256
3/3
3/3
0/3
5.00
C (wiki without journey)
11,426
3/3
3/3
0/3
5.00
D (full wiki)
14,219
3/3
3/3
3/3
5.00
E (journey page only)
2,793
3/3
3/3
3/3
5.00
Read the two middle columns side by side. That contrast is the whole argument. "Version-aware" (does the agent name the major version) is at ceiling everywhere because the tree hands it over. "History-grounded" asks for a fact the tree does not contain, and it splits perfectly on whether the journey page was present.

One honest boundary on that column: it detects a citation. An agent that repeats a release date it was handed scores the same as one that reasoned from it. So this measures whether provenance reached the agent, not whether the agent understood it. That's the difference between the claim we can defend and the one we wanted.
Two details make it more than a tautology.
Arm C scored 0/3 despite a confound in its favour. The generated wiki leaks: for two of three tasks, the glossary and module pages state the migration outright. We chose not to redact them, because gutting the module pages would have manufactured the effect, and reported the leak instead. Arm C still scored zero, because those pages say what changed without saying when, in which PR, or why. You cannot ablate history out of a generated wiki by deleting one page; only the journey page carried provenance.
The smallest artifact won. Arm E matched the full wiki on the only discriminating metric at 2,793 tokens against 14,219, which is 19.6% of the injected context, and cited fewer files than the floor arm (6.3 vs 7.0). The other 80% of the wiki bought exploration, not grounding: C minus A on history grounding is exactly zero.

The page-by-page breakdown carries a practical lesson.  journey.md  is the single largest page in the wiki at 19.6% of its tokens, and no module page exceeds 4.6%. So the obvious optimisation, trimming the longest page, deletes the only page that worked and recovers a fifth of the injected context. The 80% you can safely drop is spread across nineteen small files. Cost and value were inversely distributed here, and you'd have no way to know that without measuring the pages separately.

And in the executed run, the journey-only arm didn't just cite history. It used a real pre-cut commit to reject a plausible wrong fix (echoing back every  qop  value the server offered), on the grounds that the project had already handled that case and forwarding the list would claim a protection level the client doesn't implement. The arms without the journey page rejected the same alternative from the source alone. Which is the honest shape of the whole result: the history changed the argument, not the code.



What we'll claim, and what we won't

On a self-documenting library, the journey page doesn't change what a strong agent writes. It changes whether the agent can say why what it wrote is current. It is the only artifact we tested that transmits provenance, and it does so at a fifth of the injected context of the full wiki.
What that isn't: fifteen statically scored trials on one repo and one model, where "trap avoided" means the correct call appears in the source, not that the code runs, plus five executed trials on a single SWE-bench instance. k=1 throughout, no statistical claims. Exploration-cost numbers are self-reported by the agents (kernel-level read tracking didn't work on our filesystem), and the token figures measure the artifact injected, not what a trial consumed.
Most importantly: we showed provenance is transmitted, not that it is used. Whether knowing why changes what an agent writes needs a different corpus, one with live lures and no in-source oracle (the empty Q2 quadrant). On a well-documented library like Powertools, more trials would only buy tighter error bars around a ceiling. That's the next experiment, and it's a corpus-recruitment problem, not a sample-size one.



Try it on your own repository

The most useful thing you can do with this is not take our tables on trust. Run the generator on a codebase you know and read the  journey.md  it produces. That page is where the measured value was concentrated, and on your own repo you'll know right away whether its account of the history rings true.
 aws-samples/sample-code-journey-wiki-generator  Point it at a git repo; it works as a Claude Code  /wiki  skill, a Kiro IDE spec, or a Kiro CLI agent. No service, no dependency to install into your project: it's agent instructions plus page templates.
If you're evaluating whether context helps your agent, three things from this study are worth stealing regardless of what tool you use:
  1. Audit your corpus for headroom before you run anything. The lure × oracle taxonomy took an afternoon and would have saved two experimental rounds. "Can this benchmark possibly show my effect?" is a cheaper question than "did it?"
  1. Name a fact your context uniquely supplies, and measure only that. Our valid metric came from grepping the tree for facts available exclusively from history. If you can't name one, you don't have a measurable hypothesis yet. You have a preference.
  1. Distrust instruments that flatter you. Run your no-context baseline through the judge first, look past the median at per-rater scores, and when you execute, record which tests failed rather than just the boolean. Every ceiling in this post was an instrument agreeing with us for the wrong reason.
The result we wanted would have been a nicer chart. What we got is a narrow claim we'd defend in review, and a tool worth pointing at your own history. We'll take the trade. The harness, every trial artifact, the judge bundles, and the scripts that failed are kept alongside the write-up, so you can ask for them rather than trust the tables.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article