What Your AI Agent Actually Sees When It Reads Gradle Docs
Table of Contents
Introduction
When you ask an agent about Gradle, it probably goes and reads our docs for you. Whether it reads the page you’d read depends on how long the page is.
In Claude Code, the agent gets the first 39,000 or so characters of a page as they are. Everything after that is replaced by a summary, written by a second model you never talk to, and that summary comes out different every time.
We changed docs.gradle.org so agents get the page itself, and our AI-readiness score went from a C to a B. Then we measured what Claude Code actually receives from our docs now.
What does an agent see when it reads a docs page? #
On December 2, 2026, we pointed Claude Code’s WebFetch tool (version 2.1.311) at Gradle docs pages and wrote down exactly what came back. These tools change often, so treat this as a snapshot.
Claude Code’s documentation describes the general idea: “For most pages, Claude doesn’t see the full text. It asks a question about the page, and a separate model call reads the page and returns an answer.”
In practice, it comes down to page size:
| Page | Size as Markdown | What the agent got |
|---|---|---|
| About Best Practices | 4,386 characters | The whole page, word for word |
| General Best Practices | 57,494 characters | The first 39,385 characters word for word, then a summary of the remaining 18,109 |
| Best Practices for Tasks | 84,871 characters | The first 39,387 characters word for word, then a summary of the remaining 45,484 |
WebFetch says so at the top of every result:
Fetched https://docs.gradle.org/current/userguide/best_practices_tasks.html (HTTP 200 OK, text/markdown, 84871 characters, truncated to the first 39387, then a model-extracted summary of the rest).
Claude Code’s docs say pages “of up to about 48,000 characters” are read in full. On our pages, the cut came at about 39,400.
Four fetches of About Best Practices returned the same 4,386 characters every time. We fetched Best Practices for Tasks four times too. The word-for-word part was identical on every run, but the summary wasn’t. Four fetches gave four different write-ups of the same six best practices, each about 1,500 characters long, standing in for 45,484 characters of page. For that page, more than half of what we wrote reaches the agent only as a summary.
WebFetch ends up with Markdown because it asks for it.
It sends an Accept header that prefers text/markdown, with a Claude-User user agent.
The Claude Code docs say so, and httpbin.org/headers, a service that prints back the request headers it receives, showed us exactly what WebFetch sent:
{
"headers": {
"Accept": "text/markdown, text/html, */*",
"Accept-Encoding": "gzip, compress, deflate, br",
"Host": "httpbin.org",
"User-Agent": "Claude-User (claude-code/2.1.311; +https://support.anthropic.com/)"
}
}
docs.gradle.org answers that Accept header with Markdown.
You can send the same request to a Gradle docs page yourself:
$ curl -si https://docs.gradle.org/current/userguide/userguide.html \
-H 'Accept: text/markdown, text/html, */*' \
-A 'Claude-User'
HTTP/1.1 200 OK
Content-Type: text/markdown; charset=utf-8
...
For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. ...
# Gradle User Manual
version 9.9.3
...
Not every tool summarizes.
MCP fetch tools, OpenCode’s webfetch, and RAG pipelines ingest the document directly, so for them, smaller and cleaner Markdown helps the most.
Why does that matter for Gradle docs? #
A summary of a Gradle page can drop the one line you needed. A summary that changes on every fetch can give you a different answer every time you ask.
The win is a page that arrives complete and comes back the same way every time, and for pages under the cut, Markdown does exactly that.
What did we change? #
Four things, spread across Gradle releases and our documentation portal.
1. Markdown on request #
Ask any page on docs.gradle.org for Accept: text/markdown and our documentation portal sends Markdown back.
The user manual’s home page is 159,142 bytes as HTML and 6,110 bytes as Markdown.
The Tasks best practices page is 293,144 bytes as HTML, so even its Markdown, at about 85,000, is a big step down.
2. A Markdown twin for every user manual page #
Starting with Gradle 9.9.0, each of the roughly 260 user manual pages has a Markdown copy at the same URL, with .md instead of .html.
Try docs.gradle.org/current/userguide/userguide.md.
We generate them with the Asciidoctor Gradle plugin and a custom converter (gradle/gradle#39485), which first needed a plugin upgrade (gradle/gradle#39313). Along the way, we sent two fixes upstream to make the plugin compatible with the Configuration Cache and Isolated Projects, because nothing in build tooling is ever just one PR.
3. An llms.txt with notes for agents #
docs.gradle.org/llms.txt indexes the docs, and llms-full.txt holds the full text.
llms.txt opens with “Notes for agents”, which tells them:
currentis the latest release, and versioned docs live atdocs.gradle.org/<version>/.- Every user manual page has a
.mdtwin, and any page returns Markdown withAccept: text/markdown. - Markdown pages keep only the Kotlin DSL variant of samples that exist in both DSLs.
- Builds run with the Wrapper (
./gradlew build), and the Java compatibility matrix is one link away.
4. Three fixes for agents that got lost #
gradle/gradle#39757 (merged November 12, shipped in Gradle 9.9.2) fixed three checks we were failing:
| Problem | Fix | How often it failed |
|---|---|---|
An agent that fetched one .md page had no way to find the rest. |
Every .md page links to llms.txt. |
Every sampled page |
A fetched .md file has no base URL, so relative links went nowhere. |
Links in the Markdown are absolute. | 20 of 50 sampled pages |
| Navigation came before content in the HTML. | Content comes first in the HTML, and CSS keeps the navigation on the left on desktop. | 27 of 50 sampled pages |
For the third fix, this is how far down the page the content started in the scoring tool’s text conversion:
| Page type | Before | After |
|---|---|---|
| User guide | 80 to 88% | 3 to 7% |
| DSL reference | 56 to 86% | 5 to 8% |
Humans still see the same layout.
Did it work? #
Before these changes, Fern’s Agent Score gave docs.gradle.org 78 out of 100, a C, with 13 of 23 checks passing.
We’re a B now. Agent Score now gives docs.gradle.org 89 out of 100, with 16 of 23 checks passing, 2 warnings, and 3 failures.

In Claude Code, short pages like About Best Practices now arrive whole, with no summary anywhere.
What’s still left? #
Three Agent Score checks still fail, and we’ll probably keep failing two of them on purpose:
- llms.txt coverage. Our sitemap lists 11,294 pages, and almost all of them are API reference: 8,618 Kotlin DSL API pages, 1,821 Javadoc pages, and 335 DSL reference pages. We don’t generate Markdown for API reference, and
llms.txthas to stay under 50,000 characters anyway, so it lists 266 pages, almost all from the user manual. - Markdown and HTML parity. The Markdown pages keep only the Kotlin DSL samples, so a checker that compares them with the HTML sees the Groovy samples as missing.
The third, content start position, still flags 5 of the 10 pages it sampled.
Some of our pages are longer than the part WebFetch passes along word for word. These Markdown pages run past it or sit right at the edge:
- Best Practices for Tasks, at about 85,000 characters
- General Best Practices, at about 58,000
- Toolchains, at about 39,000
Splitting pages like these, or putting the most important material at the top, would get more of them to agents word for word.
How do I point my agent at Gradle docs? #
- Start it at
https://docs.gradle.org/llms.txt. - Swap
.htmlfor.mdin any user manual URL to get the Markdown. - Use a versioned URL (
/9.9.0/userguide/...) instead ofcurrentwhen you’re on a specific Gradle version. - If your tool lets you set headers, request
Accept: text/markdown.