# We have context all over the place and constantly being generated. How do we organize it so AI pulls the right thing?


URL: https://getunblocked.com/answers/organize-scattered-context-so-ai-pulls-the-right-thing/
Published: 2026-11-03T14:00:00Z
Updated: 2026-11-01T13:26:57Z
Author: Brandon Waselnuk
Categories: Context Engine, Engineering Insights

**Short answer:** Don't move it. Leave context where people write it, add a few cheap links that tell a machine what is current and who owns it, and let a retrieval layer rank the sources each time the AI asks. A cleanup project goes stale the week it ships; the links and the ranking keep working as new context arrives.

---
You organize context for AI by leaving it where it is written and organizing the links between it. New context lands every hour in pull requests, tickets, Slack threads and incident notes, so no person can file it fast enough. What you can do is make each piece easy for a machine to place: which ticket a change belongs to, who owns the code, and which page is retired. Then let a retrieval layer rank the sources each time the AI asks. **Source-side hygiene** is the small set of habits, done where the work happens, that give a retrieval system those signals for free. It takes a few minutes each week, while a migration project takes months and begins decaying on its first day.

## Why a cleanup project does not keep up

The usual first instinct is to gather everything into one wiki or one folder the AI can read. It feels organized on the day it ships. The next merged pull request makes it slightly wrong, and the copy carries the date it was pasted, not the date the decision was made.

That lost date is measurable damage. A September 2026 study built a benchmark of 317 facts that had reversed, spanning medicine, law, software and platform policy. Retrieving the outdated document "flips 30% of Llama and 37% of Qwen answers" that the models got right without retrieval ([arXiv 2609.31342](https://arxiv.org/abs/2609.31342)). A re-ranker that favored recent documents cut that damage by 4.6 to 10.0 points, but only "when dates are accurate." The authors add that the gains "depend on reliable temporal metadata" (same study). A migrated page has the wrong date by design. Source-side hygiene keeps the right ones.

## The habits at the source that actually help

These cost almost nothing, and each one gives a retrieval system a fact it would otherwise have to infer from incomplete evidence.

**Put the ticket key in the branch, commit or PR title.** Jira links them for you. Atlassian's docs say "including the key in the title of your pull request will automatically create a link to Jira," and the same works for branch names and commit messages ([Atlassian Support](https://support.atlassian.com/jira-software-cloud/docs/reference-issues-in-your-development-work/)). That one link joins the code change to the ticket, and the ticket to its comments. When an engineer asks why the code works this way, the answer can go from the diff to the discussion.

**Name owners in a CODEOWNERS file.** **A CODEOWNERS file** is GitHub's plain-text list of who owns which paths. GitHub describes it as a file that defines "individuals or teams that are responsible for code in a repository," and owners "are automatically requested for review" on changes to their code ([GitHub Docs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)). A retrieval system can use the same file to tell whose word counts on a given service.

**Archive pages instead of leaving them to rot.** In Confluence, archiving "removes it from your content tree," and archived content "is excluded from quick search" ([Atlassian Support](https://support.atlassian.com/confluence-cloud/docs/archive-pages/)). A retired design doc left live is how an AI ends up confidently describing a system that no longer exists.

**Keep instruction files to rules that rarely change.** Claude Code's docs say to keep CLAUDE.md to "facts Claude should hold in every session: build commands, conventions, project layout" ([Claude Code docs](https://code.claude.com/docs/en/memory)). Anything that changes weekly, such as who owns what or how a service behaves today, should be looked up when the agent asks. We wrote up what happens otherwise in [rules-file rot](https://getunblocked.com/blog/rules-file-rot/).

| Habit | Where it lives | What the AI learns from it |
| --- | --- | --- |
| Ticket key in branch, commit or PR title | Git host and Jira | Which discussion explains a change |
| CODEOWNERS entries | Repository root | Whose statement is authoritative for a service |
| Archived pages | Confluence | Which documents describe retired designs |
| Short instruction files | CLAUDE.md, AGENTS.md | Stable conventions, separate from live facts |


Each habit is a key, a line in a file, or a click on "archive." Nobody has to write more documentation.

## Let retrieval rank the sources when the AI asks

The habits do not decide which source wins. They give the ranking something to work with: a ticket link tells it which thread explains a change, a CODEOWNERS line tells it whose word counts, and an archive flag tells it which page to drop. Writing the ranking itself down, per type of question, is covered step by step in our guide to [organizing context for AI agents](https://getunblocked.com/blog/organize-engineering-context-for-ai-agents/).

The ranking has to run at the moment of the question, across every source, as the person asking. **A context engine** is a service that indexes code, tickets, docs and chat together, applies that kind of ranking per question, and returns one cited answer instead of a list of documents. Unblocked connects code, issues, docs, Slack or Teams, and production systems such as Datadog and Sentry. It "reconciles information across sources, including sources that contradict each other," with "access controls that mirror your source systems" ([Unblocked docs](https://docs.getunblocked.com/)). Brent Vatne, VP of Engineering at Expo, describes what that looks like across Expo's history: "The quality of the answers is good. It does this over eleven years of data and still gives me what is true today, compared to what was true six, seven, or eight years ago. It consolidates the context, adds that temporal element, and resolves conflicting takes. I don't have to think about any of that." ([Expo customer story](https://getunblocked.com/customers/expo/)). The same answer reaches Claude Code and Cursor over MCP and engineers in Slack, so every agent starts from one ranked answer. Our comparison of [tools that resolve conflicting information](https://getunblocked.com/blog/conflicting-context-tools/) covers the other options. When the wiki and the code disagree, see [which one an agent believes](https://getunblocked.com/answers/wiki-says-one-thing-code-does-another-which-does-ai-believe/) and [how a recent Slack message is weighed against an old doc](https://getunblocked.com/answers/how-an-ai-knowledge-tool-weighs-a-recent-slack-message-against-an-old-confluence-doc/).

## How to check the habits are working

Test the signals, not just the answers. Pick a handful of real questions whose right answer depends on one of the habits: why a change was made (the ticket link), who owns a service (CODEOWNERS), and how something works after a redesign (the archived page). Ask them through whatever your agents use today, then grade each answer on three things:

1. Did it cite the source you would trust for that kind of question?
2. Did it say so when two sources disagreed?
3. Did it leave out anything the asker is not allowed to see?

For example, if "what is the retry limit on the billing service" comes back with the old design doc's number and not the code's, you have found a page to archive or a ranking to fix. Run the same questions again after each archive sweep. If they keep passing as new context arrives, the habits are holding.

## Read more

- [How to Organize Context for AI Agents When It Lives Everywhere](https://getunblocked.com/blog/organize-engineering-context-for-ai-agents/)
- [Rules-File Rot: Why CLAUDE.md, AGENTS.md, and Cursor Rules Drift Out of Date](https://getunblocked.com/blog/rules-file-rot/)

## Related answers

- [There is drift between our repos and our documentation and agents cannot tell. What handles this?](https://getunblocked.com/answers/documentation-drift-between-repos-and-docs-for-ai-agents/)
- [How do I mark old Confluence pages as deprecated so AI stops using them?](https://getunblocked.com/answers/mark-confluence-pages-deprecated-for-ai/)
- [MCP tools are eating the whole context window in Claude Code. How do other teams give agents company context?](https://getunblocked.com/answers/mcp-tools-filling-claude-code-context-window/)
- [Agents are generating garbage docs that become a source for the next agent. How do we stop that?](https://getunblocked.com/answers/stop-agent-generated-docs-feeding-the-next-agent/)
