Skip to content
Thally
Log inGet started
Guide

Published · 7 min read

Give Cursor a current, structured source for your docs, keep it in step with merged code, and check its answers against evidence. A step-by-step guide.

By Published Updated

Illustration of a code editor with an AI assistant panel pulling answers from a neatly organized stack of documentation pages linked to recent code changes.

When a developer asks Cursor how your API handles pagination, where does the answer come from? Is it last quarter's docs export, a training snapshot from before your v2 release, or the code you merged this morning? If you're wondering how to make Cursor understand your docs, the answer is not a better prompt. You need to give it a current, structured source, keep that source in step with your code, and check its answers against evidence. This guide walks through each step.

Why Cursor answers from stale product docs

Cursor is only as accurate as the context it gets. When it has no direct source for your product, it falls back on what the underlying model learned in training. Research on code generation describes the problem directly: a model's knowledge is largely determined by the code available during training, and outdated recommendations require extra developer verification and migration effort.

The numbers are not small. A 2026 arXiv paper on evolving APIs notes that prior work observed a 25% to 38% rate of deprecated API usage across eight Python libraries. In the same paper's failure analysis, Old API Usage and Mixed API Usage accounted for 16.4% and 12.3% of failures, respectively. Mixed usage is the subtle one: the model writes code that combines your current API with one it remembers.

Developers notice. In the Stack Overflow 2025 Developer Survey, "46% of developers said they don't trust the accuracy of the output from AI tools". Usage is still climbing, though. 84% of respondents said they use or plan to use AI tools in their development process, up from 76% in 2024. Teams aren't going to stop using Cursor. They need it to be right about their own product.

Even when you do give Cursor documentation, stale docs cause a second failure. If your docs say one thing and your code does another, Cursor will confidently repeat the docs. The tool isn't broken. It's faithfully reading a source that drifted.

Give it a current source, not an old export

The common first move is to paste a docs export into the project, or to drop a folder of Markdown files into the repo and hope Cursor picks it up. That works for about a week. Then someone ships a change, the export doesn't, and you have built a stale-answer machine.

A better pattern is to point Cursor at a source that is maintained as part of your normal workflow.

Use project rules for codebase knowledge

Cursor's own documentation says project rules live in .cursor/rules as .mdc files and are version-controlled. Cursor recommends using them to encode domain-specific knowledge about your codebase. That makes rules a good home for durable conventions: which SDK version to target, which endpoints are deprecated, where the canonical API reference lives.

Two practical notes from the Cursor docs:

  • A plain .md file dropped into .cursor/rules is ignored by the rules system, because it lacks the frontmatter that specifies description, globs, and alwaysApply. Use .mdc with proper frontmatter.
  • Cursor supports several rule types, including Project Rules, User Rules, Team Rules (on Team and Enterprise plans), and AGENTS.md. Put product knowledge in version-controlled project rules or AGENTS.md so it changes alongside the code it describes.

Keep rules short and pointed. A rule that says "Our public API reference is at /docs/api; prefer it over memory for endpoint names and parameters" does more than one that tries to restate the whole reference. The reference itself should live somewhere it gets updated.

Keep docs in Git, next to the code

If your docs live in a separate editor with its own workflow, keeping them current depends on someone remembering to go there. When docs are MDX or Markdown in a repository, the documentation update can ride in the same pull request as the code, or in a linked PR that is reviewed at the same time. The reviewer sees the code diff and the docs diff together.

This matters for Cursor because the docs in Git are what Cursor can read, and Git history tells you exactly how current they are.

Illustration of Give it a current source, not an old export

Publish llms.txt, structured JSON, and MCP tools

Human-readable HTML is not the best format for an AI tool. Navigation chrome, cookie banners, and client-side rendering all get in the way. Publish your docs in formats an agent can consume directly.

llms.txt

The llms.txt proposal describes it simply: "We propose adding a /llms.txt markdown file to websites to provide LLM-friendly content". It's a Markdown index that lists your key pages with a one-line description of each. You can put it at /llms.txt, or at a scoped location like /docs/llms.txt when that fits your site. A minimal section looks like this:

Be realistic about what this does. It helps clients that choose to read it understand your documentation. It is not a guarantee that every AI product will use it, and some analysts point out that major LLM providers don't currently support it as a standard. The dependable use is direct: give Cursor the URL of your llms.txt, or reference it in a project rule, so the agent has a clean map of your current docs.

Structured JSON

For reference material like endpoints, parameters, error codes, and config options, structured JSON beats prose. An agent can look up a parameter's exact type and default without parsing paragraphs. If you generate references from an OpenAPI spec or schema files, publish that output alongside your pages.

MCP tools

Anthropic introduced the Model Context Protocol as "an open standard that enables developers to build secure, two-way connections between their data sources and AI-powered tools". Developers can expose data through MCP servers, and AI applications connect to those servers as clients. Cursor can act as an MCP client, so an MCP server for your docs lets the agent search and fetch current pages on demand instead of relying on whatever was in its context window.

You can build these outputs yourself. Thally's Content Graph takes another route: you author once in MDX, and it publishes the same source as a site, Markdown, JSON, llms.txt, and MCP tools. Either way, the principle is the same. Every format should come from one source, so they can't disagree with each other.

Update that source when code merges

Here's the uncomfortable part. Everything above makes Cursor better at reading your docs. None of it makes your docs correct. If the source drifts, every format you publish drifts with it, and Cursor gets a cleaner path to the wrong answer.

The arXiv research on evolving APIs found that "providing external documentation significantly improves API adoption". It also found that models still struggle to override stale knowledge they learned in training. Current docs help, but only if they're actually current.

Docs rarely go stale because nobody cares. They go stale because a change touches pages nobody thinks of as "the docs for" that feature: guides, tutorials, support articles, and marketing pages that mention a behavior in passing. A renamed flag might appear in the reference, a quickstart, three help articles, and a pricing page.

To keep the source current:

  • Review docs changes in the same pull request as code changes, or in a linked PR reviewed alongside it.
  • Generate references from your OpenAPI spec or schema files so they can't fall behind.
  • Run impact detection on every merge so you know which pages a change affects, not only the obvious one.
  • Add a scheduled sweep to catch drift that event-based checks miss.

Automating that impact step is the job of Thally Automation. When a pull request merges, it analyzes the change, drafts the documentation updates the change implies, and opens them as a pull request on your docs repo for your review. It uses a read-only GitHub App, and you choose what triggers a draft, such as release tags, changes to openapi.yaml or schema files, or a weekly sweep. Nothing publishes until a person approves it.

Illustration of Update that source when code merges

Check answers against evidence before you trust them

Even with current docs and good formats, test what Cursor actually says. The llms.txt proposal suggests a useful check: ask an agent questions about your content, giving it only your llms.txt as a starting point. If it can't find the answer, the problem is your index or your pages, not the model.

Build a small evaluation set from questions your users and engineers really ask:

  • "What's the current way to authenticate?" Confirm it doesn't suggest a deprecated method.
  • "Which parameters does this endpoint accept?" Compare the answer against the generated reference.
  • "How do I migrate from v1?" Check that it cites the migration guide rather than inventing steps.
  • "What changed in the latest release?" Check that the answer matches your changelog and does not describe an older version.

Run the same questions after each release. When an answer is wrong, trace it to the page or index entry behind it, fix that source, and ask again.

Sources

  1. Rules (Cursor official docs)
  2. The /llms.txt file (llmstxt.org, Jeremy Howard)
  3. Stack Overflow 2025 Developer Survey (press release)
  4. Introducing the Model Context Protocol (Anthropic)
  5. When LLMs Lag Behind: Knowledge Conflicts from Evolving APIs in Code Generation (arXiv)
  6. What Was Once Learned May Need to Be Unlearned (arXiv)
  7. Keep Your Docs Site in Sync With Code Changes | Thally
  8. Make Documentation Readable by AI Agents | Thally
  9. Thally Automation: Ship the Code. Docs Follow. | Thally

Published under the Thally editorial policy. Technical conformance is defined in the agent-readiness methodology.

Build docs that stay close to your product.

Create a managed site, or use the open-source engine to run Thally yourself.