MCP server that captures and retrieves architectural decisions and context for Claude Code sessions
Project description
contexer.ai · Discord · Docs
Contexer is an MCP server for Claude Code that remembers decisions made during a session and replays them at the start of every future session.
The problem
Every Claude Code session starts fresh. No memory of what was decided yesterday, last week, or in a different window.
You end up repeating yourself constantly: "we use uv not pip", "always write tests before committing", "we chose Postgres because of transactions". CLAUDE.md files help, but they need manual upkeep and go stale. The reasoning behind decisions disappears when the session ends.
Install
uv tool install contexer
contexer install
Restart Claude Code and open any git repo. That's it.
See docs/install.md for verification, update, and uninstall steps.
How it works
Contexer runs silently in every session. You don't interact with it directly.
First time in a repo — Claude includes a brief offer at the top of its first response:
Contexer: no project context stored. Save decisions for future sessions? (yes / full / no)
Say yes for one question (what does this repo do?), full for a thorough setup, or no to skip. Claude answers your original request either way.
Every session after that — before your first message, Claude reads:
Contexer: 3 constraints, 2 conventions loaded. 8 arch/patterns will be loaded on demand.
Constraints and conventions are injected immediately — they apply to every task. Architecture and pattern decisions load on demand when the task needs them.
As you work, Claude stores decisions automatically. If it misses something, say "store that as a constraint" and it's saved.
CLI reference
| Command | Description |
|---|---|
contexer install |
Connect Contexer to Claude Code |
contexer status |
Show connection status, store size, current repo; warns about corrupt config files and cleans stale temp files |
contexer reinstall |
Re-sync after a Claude Code update |
contexer uninstall |
Disconnect; context store is kept |
contexer uninstall --purge |
Remove everything including ~/.contexer/ |
contexer version |
Print installed version |
contexer help |
Show all commands and flags |
Decision types
| Type | What it captures | Loaded at session start |
|---|---|---|
constraint |
Hard rules — "never commit untested code" | Yes |
convention |
Team standards — "use uv not pip", "conventional commits" | Yes |
architecture |
Structural choices — "REST over GraphQL for the external API" | On demand |
pattern |
Recurring approaches — "validate at the boundary" | On demand |
Storing and querying decisions
"store that as a constraint"
"save this as a convention: always use uv not pip"
"what decisions did we make about postgres?"
"show all constraints"
"delete the postgres decision"
"save this as a global constraint: always use conventional commits"
Global decisions apply across all repos — use them for commit style, branch naming, anything that travels with you.
Note: Your first prompt each session is also captured as the current task. A first prompt phrased as a clear directive ("always update docs before committing") is still auto-saved as a constraint — but a rule phrased indirectly may slip past the detector, so follow up with "store that as a constraint" to be sure.
Edit the store directly if you prefer — it's plain JSON at ~/.contexer/.
Performance
Context processing runs before Claude generates a response, not during it. It adds nothing to response time.
| Operation | Time |
|---|---|
| Hit (decision found) | 0.3–0.5ms |
| Miss (no match) | ~0ms |
| Session start load | ~1ms |
Token cost is paid once at session start. Every prompt after that is free.
| Pre-loaded rules | Tokens |
|---|---|
| 5 | ~125 |
| 10 | ~250 |
| 25 | ~625 |
~26 tokens per rule, fixed regardless of store size. On prompts unrelated to stored decisions, Contexer skips entirely — no read, no tokens.
Troubleshooting
Decisions aren't being stored automatically. Say "store that decision" to save it manually.
A decision isn't appearing at session start. Constraints and conventions load at session start. One added mid-session shows up next time.
A new decision was silently skipped. Content too similar to an existing entry is rejected as a duplicate. Rephrase to include what specifically changed.
No context at session start on a new repo. Claude will offer bootstrap setup. Say yes to capture initial decisions — all future sessions will have context.
Contributing
Bug reports, fixes, and documentation improvements are welcome. See CONTRIBUTING.md for setup, code style, and the PR process.
Questions? Discord.
License
MIT — see LICENSE for full terms.
The Contexer name and logo are trademarks of Contexer.ai. The MIT license does not grant rights to use the name or logo in a way that implies official affiliation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contexer-0.5.3.tar.gz.
File metadata
- Download URL: contexer-0.5.3.tar.gz
- Upload date:
- Size: 128.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73baef785b243ccdb60d5c80450b9080b70261e1c4705db66b5b0263da4a4164
|
|
| MD5 |
d805678bd7cbc9332e00ae3655b5dd8f
|
|
| BLAKE2b-256 |
2e58d60076d51f7bc9452a2b83132b69f0152f0fb69348c77e833efd3df05e97
|
Provenance
The following attestation bundles were made for contexer-0.5.3.tar.gz:
Publisher:
publish.yml on bhargavamin/contexer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contexer-0.5.3.tar.gz -
Subject digest:
73baef785b243ccdb60d5c80450b9080b70261e1c4705db66b5b0263da4a4164 - Sigstore transparency entry: 1779317827
- Sigstore integration time:
-
Permalink:
bhargavamin/contexer@7da4b2c438ab877b29d67d55f0a50ae812f1375c -
Branch / Tag:
refs/tags/v0.5.3 - Owner: https://github.com/bhargavamin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7da4b2c438ab877b29d67d55f0a50ae812f1375c -
Trigger Event:
push
-
Statement type:
File details
Details for the file contexer-0.5.3-py3-none-any.whl.
File metadata
- Download URL: contexer-0.5.3-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20c62f41d7e364b3a2193d1760ce4708bc8e137ea6f33aa4ceab20799550ee60
|
|
| MD5 |
9b315b9c670dff78c3587038dc6f6312
|
|
| BLAKE2b-256 |
b9036cd94bb5be63b2d29a0e8650a0cd8dea4f056d9d2e3198587eebecceee82
|
Provenance
The following attestation bundles were made for contexer-0.5.3-py3-none-any.whl:
Publisher:
publish.yml on bhargavamin/contexer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contexer-0.5.3-py3-none-any.whl -
Subject digest:
20c62f41d7e364b3a2193d1760ce4708bc8e137ea6f33aa4ceab20799550ee60 - Sigstore transparency entry: 1779318087
- Sigstore integration time:
-
Permalink:
bhargavamin/contexer@7da4b2c438ab877b29d67d55f0a50ae812f1375c -
Branch / Tag:
refs/tags/v0.5.3 - Owner: https://github.com/bhargavamin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7da4b2c438ab877b29d67d55f0a50ae812f1375c -
Trigger Event:
push
-
Statement type: