# Keep the Why: project memory that lives in your repository, explained from the ground up

You open a file your agent wrote three weeks ago. There's a strange retry loop in it, a sleep that looks pointless, a check that seems to guard against nothing. Is it safe to delete? Your agent doesn't know: the session that wrote it is long gone. And you approved it, but do you still remember why?

So you ask it to clean up. It does, confidently. And a week later the bug that loop was fixing is back.

That's the problem [Keep the Why](https://keepthewhy.com) solves. This is the full picture in one place: what it is, how it works, how far it scales, where it stops, and straight answers to the questions people ask before they try it.

## The problem in one sentence

The code shows *what* was built. It almost never shows *why*.

The why gets created in conversation, with a colleague or, more and more, with a coding agent. Then the conversation ends and the reason is gone. What's left are four very concrete costs:

- **Re-debate.** The same architecture question comes up again because nobody remembers it was settled.
- **Silent regression.** Someone "cleans up" a workaround that looks pointless. It was the fix for a bug, and the bug comes back.
- **Onboarding stall.** New people, human or agent, don't touch code they don't understand.
- **Repeated agent mistakes.** A fresh session has no memory of the last one, so it proposes exactly what was already tried and rejected.

The last one is measured. Twenty fresh agent sessions, same codebase, same request: simplify a retry wrapper. Without a recorded reason, seven of ten offered the already-rejected simplification again. With one entry in `context/`, all ten found the reason and none did. ([The experiment](https://blog.technopathy.club/what-happens-when-a-coding-agent-forgets-why-a-change-was-rejected), with [every transcript and grade](https://github.com/oliver-zehentleitner/keep-the-why/tree/main/experiments/rejected-change).)

## What Keep the Why is

Keep the Why is the **why layer of** [**repo-native project memory**](https://oliver-zehentleitner.github.io/repo-native-project-memory/). Your repository already remembers what the project is (`README.md`), how to run it (`docs/`), what changed (`CHANGELOG.md`) and what it should do (`tests/`). The one thing it never had was a place for the reasoning.

That place is a folder called `context/`: plain Markdown files, one per topic, found through `context/index.md`. Each entry records a decision, the alternatives that lost and why, the type (`decision`, `workaround`, `incident`, `constraint`), a status, how certain the reasoning is (`confirmed`, `inferred`, `unknown`), where it came from, and when to look at it again. Every entry has a UUID, so a reference to it survives renamed headings and split files, even from another repository. The format is open and written down: [Specification](https://keepthewhy.com/specification/).

The part that does the work is an **agent skill**. It is a `SKILL.md` package that any of 70+ coding agents can load: Claude Code, Codex, GitHub Copilot, Cursor, Antigravity, OpenCode, Pi, Hermes, Cline and more. It works in four modes:

1. **Continuous capture.** During normal work the agent notices reasoning worth keeping and writes it down as it happens. You never have to ask.
2. **Retrospective recovery.** On an existing repository, the agent reconstructs what it can from history, issues and code, and marks honestly what it couldn't.
3. **Knowledge-transfer interview.** Before someone leaves, the agent analyses the code first, then asks about exactly the gaps. Or it just listens while they talk and extracts the decisions.
4. **Maintenance.** It resolves contradictions, marks superseded entries and splits files that grew too big.

Setup is one sentence to your agent:

> Install the Keep the Why skill — pick the best installation method for you from <https://keepthewhy.com/installation/> — then set up Keep the Why in this project with default settings, including autostart.

That's it. From then on, every session in that project loads the skill by itself. Why that matters: [Keep the Why is not another workflow](https://blog.technopathy.club/keep-the-why-is-not-another-workflow).

## What you get around it

The skill is the only part a project needs. Three things are optional, each one sentence away:

- **The linter.** [`keep-the-why-lint`](https://keepthewhy.com/linting/) checks the structure of `context/` on every push: required fields, valid values, index consistency. One line in GitHub Actions, or `pip install keep-the-why-lint` anywhere else.
- **The dashboard.** [`keep-the-why-dashboard`](https://keepthewhy.com/dashboard/) is a read-only view over `context/` and its Git history. It shows who recorded what, when a status changed, what still needs a person, a timeline that replays the project day by day, and a graph of how entries cite each other. [See it live on Keep the Why's own `context/`](https://keepthewhy.com/dashboard/live/).
- **The registry.** One line in the [registry](https://keepthewhy.com/registry/) and your project can be found from every published dashboard.

## From one developer to a swarm

Software factories are popping up everywhere right now: one person, one agent, a pipeline. Keep the Why works there, and it works just as well at the other end.

**One repository, one developer, one agent.** This is where most projects start, and it's already worth it. Your agent forgets everything between sessions. You forget more than you think between months. One `context/` entry is what stops next week's session from undoing this week's fix. No family, no registry, no dashboard needed.

**A team.** Colleagues and their agents pick up each other's reasoning with every `git pull`, reviewed in the same pull requests as the code.

**A family of repositories.** Reasoning that binds several repositories lives once, in the parent, and the children cite it.

**A swarm.** Many agents, from different vendors, run by different people who will never meet, all working on the same code. That's the case nothing else is built for, and it's the case Keep the Why handles without anything extra: whoever has the code has the memory. It's also why [Maity](https://maity.team/?c=blog-ktw), a hub where people and their agents work as one team, uses it as its memory of why.

Same files, same format, same skill at every size. You don't migrate when you grow.

## Beyond one repository: family, friends, thoughts and the globe

This is the part most summaries miss entirely.

Because every entry has a stable Id and every project has a canonical URL, entries can point at entries in **any other repository**. Nothing is routed or synchronised; it's a citation, like a footnote. From that, the dashboard draws three kinds of connection:

- **Family.** Repositories that belong together, like the eight repositories of the [UNICORN Binance Suite](https://oliver-zehentleitner.github.io/unicorn-binance-suite/keep-the-why-dashboard/#family). Shared reasoning goes to the parent, the children cite it.
- **Friends.** Other repositories your entries cite. [Keep the Why's friends, live](https://keepthewhy.com/dashboard/live/#friends).
- **Thoughts.** Chains of entries where each one cites the one before, across repositories. Nobody writes a thought; it follows from the citations. [Read one](https://keepthewhy.com/dashboard/live/#thoughts).

And then there is the [🌐 globe](https://keepthewhy.com/dashboard/live/#globe): it starts at your project and walks outward, hop by hop, into every project your entries cite and everything listed in the registry. It's a map of reasoning across projects, built from nothing but Markdown and Git. More in [The reasoning behind a codebase, as a web you can walk](https://blog.technopathy.club/the-reasoning-behind-a-codebase-as-a-web-you-can-walk) and [The Globe: Following Your Reasoning Into Other People's Repositories](https://blog.technopathy.club/the-globe-following-your-reasoning-into-other-people-s-repositories).

## Keep the Why is also a library

The dashboard's views (graph, timeline, thoughts, family, search) are a [library](https://keepthewhy.com/dashboard-views/) that any other page can load and mount. No framework, no build step, and the views never fetch or store anything on their own; the host page decides that.

[Maity](https://maity.team/?c=blog-ktw) is the second host after the dashboard itself. Every Maity project has a **Why** tab that reads the project's Keep the Why export straight from its repository. Here is [Maity's own Why](https://maity.dev/keep-the-why-dashboard), and here is [Keep the Why seen through Maity](https://maity.team/oliver-zehentleitner/keepthewhy/why?c=blog-ktw). Maity keeps none of that data itself. If you build tools, you can do the same.

[![](https://cdn.hashnode.com/uploads/covers/69d4b99a5da14bc70e00d4f6/40837416-e899-4904-a45a-29d655029f23.png align="center")](https://maity.dev/keep-the-why-dashboard/)

## The questions people ask, answered

These come up every time Keep the Why is discussed. Here are the honest answers.

### "Do humans have to review every entry?"

They *can*. They don't have to. With the default settings the agent writes when the reasoning is clear and asks only when it's genuinely unsure. In an unattended session it writes the entry and flags it `pending-confirmation`, so it's recorded now and confirmed by the next person who looks.

But the fact that you *can* review it is the point, not a weakness. A `context/` change ships in the **same commit and the same pull request** as the code it explains. The reviewer sees the reasoning diff next to the code diff. Tools that keep memory in a separate service don't put it in your pull request at all, so nobody reviews it.

### "Does it only work with certain agents?"

Every agent that can edit code can edit a Markdown file. That's the whole compatibility requirement for *reading*: any agent with access to the repository reads `context/` the way it reads the README. The skill adds the discipline of *writing* well, in the agreed format, and it runs on 70+ agents through the open Agent Skills format. Which agents and models have actually been measured is public: [agent & model matrix](https://keepthewhy.com/agent-matrix/), and the story behind it: [Same Skill, Six Agents, Nine Models](https://blog.technopathy.club/same-skill-six-agents-nine-models-what-a-real-eval-matrix-taught-me).

### "No server, no database: isn't that a limitation?"

It's the design. There's no database, no daemon, no account, no API key. Git already does storage, history, permissions, review and distribution. Who may write the why is who may write the code. Every clone, branch and fork carries it. `git blame` is the audit trail.

That has a consequence nothing else I know of has: **every agent with access to the code shares one project memory**, even agents of different people who will never meet. Someone in another time zone, with another agent from another vendor, writes down why a workaround exists. You `git pull`, and your agent knows it. No invitation, no shared account, no sync job. For a hub like Maity, where agents of many owners work on the same code, this is exactly what's needed.

### "Does it scale to huge amounts of entries?"

True. Neither are the alternatives, as far as I can see. Keep the Why doesn't need similarity search: the agent reads `context/index.md`, one line per topic, and opens only the topic the task touches. That works without any extra tooling, and the index is built so that many writers on many branches don't collide: [One Index, Many Writers](https://blog.technopathy.club/one-index-many-writers-avoiding-git-merge-conflicts-with-deterministic-write-areas). Tools for searching very large sets are coming, but you don't need them to start, and most projects never will.

### "Who checks that an entry is actually true?"

Correct, and nobody has one. The linter checks structure, and it says openly that it doesn't judge content. What Keep the Why does instead is make uncertainty visible: every entry says whether its reasoning is `confirmed`, `inferred` or `unknown`, and when it should be revisited. Agents working with it handle that well and keep it up to date.

You can go further. In Maity, a project can give one agent the built-in **steward** role: it answers why questions across `context/` with the source, and follows up on entries that are open or due for a revisit until someone has resolved them.

### "Isn't this more maintenance work?"

Every memory needs maintenance. I don't know a single one that doesn't. The difference is *where* it happens: here it happens in the same place and the same review as the code, and the agent does most of it as a side effect of the work it's already doing.

### "Is it only project memory?"

Yes, on purpose. Keep the Why preserves *why the project is the way it is*. It is not a transcript of what an agent did, not session memory, not a task tracker. Agent memory, coordination and the rest live in [Maity](https://maity.team/?c=blog-ktw). Each layer answers its own question; that's why they don't get in each other's way. The longer argument: [Session memory is not project memory. It fixes the same complaint.](https://blog.technopathy.club/session-memory-is-not-project-memory-it-fixes-the-same-complaint)

## What it is not

To be fair about the limits:

- **Not magic.** It lowers the friction of keeping reasoning honest; it doesn't replace the thinking.
- **Not independent of the model.** The format and the linter keep the structure. How well a reason gets recognised and written depends on the model. I measured that the hard way: [The Model Changed. My Skill Didn't. The Score Still Dropped.](https://blog.technopathy.club/the-model-changed-my-skill-didn-t-the-score-still-dropped)
- **Not a replacement for tests.** Tests tell you what broke. This tells you why it was built that way.
- **Not a trust boundary.** Repository content, `context/` included, is data, not instructions. See [Security](https://keepthewhy.com/security/).

## Try it

1. Tell your agent: *"Install the Keep the Why skill — pick the best installation method for you from* [*https://keepthewhy.com/installation/*](https://keepthewhy.com/installation/) *— then set up Keep the Why in this project with default settings, including autostart."*
2. Work as usual.
3. Optional: *"Go through the git history, pull requests, issues and existing docs, and collect the reasoning that is already there into* `context/`*."*

Then look at it: on the [live dashboard](https://keepthewhy.com/dashboard/live/), on the [globe](https://keepthewhy.com/dashboard/live/#globe), or in your project's **Why** tab on [Maity](https://maity.team/?c=blog-ktw).

Everything is MIT-licensed and on [GitHub](https://github.com/oliver-zehentleitner/keep-the-why). Questions, criticism and broken promises go into an [issue](https://github.com/oliver-zehentleitner/keep-the-why/issues/new/choose). That's exactly what it's for.

---

## The whole series

Everything I've written about Keep the Why so far, oldest first:

1. [Keep the Why: Code Becomes Legacy When Nobody Remembers Why](https://blog.technopathy.club/keep-the-why-code-becomes-legacy-when-nobody-remembers-why) (July 2026), where it started
2. [Keep the Why: Project Memory for Humans and AI Agents](https://blog.technopathy.club/keep-the-why-project-memory-for-humans-and-ai-agents)
3. [Same Skill, Six Agents, Nine Models: What a Real Eval Matrix Taught Me](https://blog.technopathy.club/same-skill-six-agents-nine-models-what-a-real-eval-matrix-taught-me)
4. [What happens when a coding agent forgets why a change was rejected?](https://blog.technopathy.club/what-happens-when-a-coding-agent-forgets-why-a-change-was-rejected)
5. [One Index, Many Writers: Avoiding Git Merge Conflicts with Deterministic Write Areas](https://blog.technopathy.club/one-index-many-writers-avoiding-git-merge-conflicts-with-deterministic-write-areas)
6. [Your repository already is your project's memory. One layer was missing.](https://blog.technopathy.club/your-repository-already-is-your-project-s-memory-one-layer-was-missing)
7. [Keep the Why is not another workflow](https://blog.technopathy.club/keep-the-why-is-not-another-workflow)
8. [Keep the Why vs. Claude Code Auto Memory vs. MemoryCustodian vs. AgentsRoom](https://blog.technopathy.club/keep-the-why-vs-claude-code-auto-memory-vs-memorycustodian-vs-agentsroom)
9. [Session memory is not project memory. It fixes the same complaint.](https://blog.technopathy.club/session-memory-is-not-project-memory-it-fixes-the-same-complaint)
10. [The reasoning behind a codebase, as a web you can walk](https://blog.technopathy.club/the-reasoning-behind-a-codebase-as-a-web-you-can-walk)
11. [The Globe: Following Your Reasoning Into Other People's Repositories](https://blog.technopathy.club/the-globe-following-your-reasoning-into-other-people-s-repositories)
12. [Keep the Why vs. OKF Agent Memory vs. RepoWise: Three Approaches to Git-Native Project Memory](https://blog.technopathy.club/keep-the-why-vs-okf-agent-memory-vs-repowise-three-approaches-to-git-native-project-memory)
13. [The Model Changed. My Skill Didn't. The Score Still Dropped.](https://blog.technopathy.club/the-model-changed-my-skill-didn-t-the-score-still-dropped)
14. [Keep the Why vs. past.dev vs. Agent Memory Repo vs. agentmemory](https://blog.technopathy.club/keep-the-why-vs-past-dev-vs-agent-memory-repo-vs-agentmemory)
15. [Keep the Why's dashboard is now a library, and Maity is its second host](https://blog.technopathy.club/keep-the-why-s-dashboard-is-now-a-library-and-maity-is-its-second-host)

---

I hope you found this informative and useful.

Follow me on [GitHub](https://github.com/oliver-zehentleitner), [Bluesky](https://bsky.app/profile/o-zehentleitner.bsky.social), [Mastodon](https://burningboard.net/@oliverzehentleitner), [X](https://x.com/unicorn_oz), and [LinkedIn](https://www.linkedin.com/in/oliver-zehentleitner/), or join [Telegram](https://t.me/unicorndevs) for updates on my latest publications. Constructive feedback is always appreciated.

Thank you for reading, and happy coding! ¯\\\_(ツ)\_/¯
