Skip to main content

MCP server that captures and retrieves architectural decisions and context for Claude Code sessions

Project description

Contexer

Contexer is a lightweight MCP server for Claude Code that automatically captures decisions made during coding sessions and surfaces them at the start of every future session — so Claude never starts blind.

The problem

Every Claude Code session starts with no memory of the previous one. CLAUDE.md files require manual maintenance and go stale. When Claude works autonomously, the reasoning behind decisions disappears when the session ends. Teams end up re-explaining the same constraints, conventions, and architecture choices every time.

Contexer solves this by capturing decisions as they happen — silently, automatically, in the background — and replaying them as project rules at session start.


Quick start

Install takes under two minutes. See docs/install.md for full steps, verification, and uninstall.

Step 1 — install the package:

uv tool install contexer

Step 2 — wire it into Claude Code:

contexer install

Step 3 — restart Claude Code and open any git repo. Bootstrap runs automatically on the first session.


How it works

You work normally. Contexer runs silently in the background.

  • Session start — all your constraints and conventions are injected as project rules before you type anything
  • As you work — Claude captures significant decisions automatically; you never have to do it manually
  • "Why" questions — if you ask about rationale or past decisions, Contexer auto-fetches the relevant ones
  • Context window limit — decisions are saved before compaction and restored after, so nothing is lost

You never call anything directly. If Claude misses something, say "store that decision" and it will be captured immediately.


Decision types

Every stored decision has a type that controls when it is surfaced.

Type What it captures Surfaced at session start?
constraint Rules that must always apply — "never commit untested code" Yes — always
convention Team or project standards — "use uv not pip", "conventional commits" Yes — always
architecture Structural decisions — "chose REST over GraphQL for this service" No — fetched when relevant
pattern Recurring implementation approaches — "always validate at the boundary" No — fetched when relevant

Constraints and conventions apply to every task, so they load immediately. Architecture and pattern decisions are fetched on demand when the task requires them.


Managing decisions

All operations use natural language.

Store a decision

"store that as a constraint"
"save this as a convention: always use uv not pip"
"remember this architecture decision"

Note: Your first prompt each session is captured as the current task description, not as a constraint. If you open a session with an instruction like "always update docs before committing", say "store that as a constraint" to make sure it is saved correctly.

Query decisions

"show me all constraints"
"what decisions did we make about postgres?"
"show everything stored for this repo"

Update a decision

"update the uv decision — we switched back to pip"
"correct the constraint about commit format"

The old entry stays alongside the new one. If the revision is too similar to the original, rephrase it to include what changed.

Remove a decision

"delete the postgres decision"
"remove all outdated constraints"

You can also edit the store file directly — it is plain JSON at ~/.contexer/.


Troubleshooting

Claude isn't storing decisions automatically. Say "store that decision" and Claude will capture it immediately.

A decision was stored but isn't appearing. Constraints and conventions load at session start. If you added one mid-session, it will appear from the next session onward.

A decision is outdated or wrong. Say "delete the X decision" or edit the store file directly.

A new decision wasn't saved — it looks like a duplicate. If the content is too close to an existing decision, it is silently skipped. Rephrase it to include what specifically changed.

No context appeared at session start. This happens the first time you open a repo — bootstrap will run to capture your initial decisions. Complete it once and all future sessions will have context.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contexer-0.1.2.tar.gz (66.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contexer-0.1.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file contexer-0.1.2.tar.gz.

File metadata

  • Download URL: contexer-0.1.2.tar.gz
  • Upload date:
  • Size: 66.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for contexer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9dba118ca70da710cbcf10c6db10726b9a7da0c9608694e70051699ff27d55bb
MD5 f9acaea8c727eb9551fe591aa370fbab
BLAKE2b-256 70428e135a82c6192e749c17caa3cd80c6209333f74325e9f3780b60a5d01d1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for contexer-0.1.2.tar.gz:

Publisher: publish.yml on bhargavamin/contexer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file contexer-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: contexer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for contexer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 699e6c0d7114913cdcb7424f46a1dab37eb92ab65a66f52a0a8a143c82800b89
MD5 f2a91bde6eb5654f64d4beae219c0705
BLAKE2b-256 66756a70e92423b985e4615f1218a4b1a095b9a9ebd12037546b1c293834d11c

See more details on using hashes here.

Provenance

The following attestation bundles were made for contexer-0.1.2-py3-none-any.whl:

Publisher: publish.yml on bhargavamin/contexer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page