Your AGENTS.md,
except it writes itself.

What your agent learns shouldn't die with the session, stay locked in one AI tool, or live on one laptop. keepctx keeps it constantly updated and available — across sessions, across Claude, Codex and other AI agents, and across your team.

Stop re-explaining the same thing

Every session, you re-explain how to log in to your servers, where the logs live, and what runs where. Every next session, it's forgotten. The fix isn't a bigger context window — it's writing things down once, in a place the next session reads automatically.

Every AI agent shares one memory

Correct Claude on Monday and Codex knows on Tuesday — and so does any other agent that reads AGENTS.md. Context is plain markdown behind that file, so there's no plugin per tool and nothing to migrate when you switch.

Corrections stick

When you correct your agent, it records the correction. The next session — yours or a teammate's — starts already knowing.

Onboarding on day one

A new hire clones the repo and their agent already knows how to get into prod, where the logs are, and which docs are lying.

Nothing gets wrecked

Every change is versioned server-side and one revert away. A weak model can add noise; it can't destroy what your team already established.

Never in your git history

.ctx/ ignores itself, so context never pollutes diffs and never goes stale on a branch. Your AGENTS.md gets a short pointer and nothing else.

Plain markdown, open source

Facts are readable text. Run our server or your own. Uninstalling is deleting .ctx/.

How it works

A context is a list of facts. The bolded lead is the key, and the value can be an IP, a command, or a sentence.

# .ctx/example-project/facts.md

- **prod.access** — SSO, then jump host `bastion.example.com`, then `aws --profile prod-ro`. Never direct SSH. `[verified]`
- **network.proxy** — internal hosts only resolve through the corporate proxy; set `HTTPS_PROXY` first
- **logs.location** — Splunk, index `app_prod`. Not CloudWatch, whatever the old runbook says.
- **api.runs-on** → Cloud Foundry (`cf logs api --recent`), not Kubernetes
- **api.depends-on** → auth-service, for session validation

What goes in a context

Everything you'd tell a sharp new teammate on day one. Your agent fills it in as it learns, in whatever order the work turns things up.

Purposewhy this exists, and who it's for
Partswhat it's made of — components, stack, tools
Wherewhere things run and live, and where to look — logs, dashboards, files
Howthe routines, done the way this place does them — deploy, operate, maintain
Vocabularyinternal names no model could guess
Gotchaswhat looks wrong but is intentional, and what looks right but breaks
Sources of truthwhich doc wins when two disagree
Decisionswhat was chosen, why, and what was ruled out — so it stops being re-suggested
Rulesstandards, compliance, budgets, never-do-X
People & accesswho owns what, who to ask, and how to get in — never the credentials themselves

Not just code. Anything you keep explaining to an AI is a context.

Investing

Your thesis, entry criteria, sizing rules, which account holds what for tax reasons, sources you trust — and what you've ruled out, and why.

Writing a book

Characters, voice rules, the timeline, what's canon and what got cut.

Running a business

Customers, pricing logic, vendors, tone of voice, the promises you've made.

Research

Sources, what's been ruled out, and the questions still open.

Reads and writes are just files

Your agent opens facts.md with the same tools it uses for any other file, and edits it as it learns. There's no write command to forget and no ceremony to skip — which is exactly why capture actually happens.

Conflicts resolve without anyone arbitrating

Changes sync per key, not per file. Two people learning different things both land. Two people changing the same fact means the later one wins, and every version is kept — so a bad change is one revert away rather than an argument.

SyntaxMeans
— valuean attribute
→ valuea relationship — what your architecture diagram is drawn from
[verified]a human settled it; stop re-deriving it

Quickstart

Two minutes to local. An account only matters when you want to share.

  1. Install

    Python 3.9 or newer, no dependencies. The app is keepctx, and it also installs ctx as a short alias, which is what the examples below use. If another ctx is already on your PATH the alias is skipped and keepctx works the same.

    curl -fsSL https://keepctx.com/install.sh | sh
  2. Set up in your project

    Creates .ctx/, adds a short pointer to AGENTS.md, and ignores itself in git. The name defaults to your directory.

    cd ~/work/example-project
    ctx init
    
    Initialized `example-project`
      .ctx/example-project/facts.md  your facts
      .ctx/instructions.md           how the agent maintains them
      AGENTS.md                      pointer added at the top
    
    Tell your AI to re-read AGENTS.md.
  3. Work

    Your agent reads .ctx/instructions.md, learns the rules, and starts recording what matters — corrections, hard-won findings, decisions. Nothing else to do.

  4. Share it, when you want to

    Local works forever with no account. ctx remote puts it on a server so your team gets it — and so it survives a dead laptop.

    ctx remote   # one time, creates it on the server
    ctx sync     # two-way. mostly automatic after this
  5. Your teammates

    ctx clone your-org:your-context

The commands, all of them

Shown as ctx; keepctx works the same everywhere.

ctxstatus
ctx init [name]set up here. local, no account, no network
ctx remoteone-time. create this context on a server
ctx clone org:nameget a context you don't have
ctx syncupload local changes, download remote ones