Zero-Friction Context Capture
Contxt captures context where you already work — in code, git, and your editor. No terminal. No forms. No friction.
The Problem
Manual memory tools fail because the moment you make a decision — choosing Prisma over Drizzle, adopting a retry pattern, switching to a new architecture — you're deep in code. Stopping to open a terminal and type a command breaks flow and rarely happens.
Passive capture means context accumulates in the background. Annotations live next to the code they describe. Commit messages capture decisions as they're made. The file watcher sees your editor activity. Your AI session records what was discussed. Nothing requires you to remember to log it later.
Capture Methods
Code Comment Annotations
Add @decision, @pattern, or @context tags to any code comment. The watcher or contxt scan picks them up and creates draft entries automatically.
//@decisionUse Prisma for ORM | rationale: type-safe queries
Rules File (.contxt/rules.md)
A human-readable markdown file that mirrors your memory store. Edit it in your IDE and changes sync to memory automatically when the watcher is running. Generate it from memory, or sync from it after manual edits.
Rules file format →Import Sources
One-time import from files that already contain structured knowledge: README, Cursor rules, CLAUDE.md, ADR directories, recent git commit history, and package.json metadata. A fast way to seed memory on an existing project.
Import sources reference →Git Hooks
Install once, capture forever. The post-commit hook detects decisions in commit messages. The post-checkout hook keeps your memory branch in sync with your git branch. The prepare-commit-msg hook injects active context into the commit editor.
Hook installation guide →File Watcher
Run contxt watch --daemon once and leave it. The daemon monitors file changes, rules.md edits, git HEAD changes, and session timing — all without any manual commands after startup.
MCP Auto-Capture
When Contxt is connected as an MCP server to Claude Code or Cursor, your AI silently captures context during the natural flow of conversation. Decisions made mid-session, patterns discussed while debugging, and implementation choices are all drafted into your context store without interrupting the session.
MCP setup guide →Draft Review Queue
All passive sources write entries as drafts, never confirmed records. This is intentional: passive capture is optimistic by design, and not every annotation or commit message maps to a genuine architectural decision. The draft queue gives you a lightweight checkpoint before anything enters your permanent context store.
Run contxt review at any point to step through pending drafts. For each one you can confirm, edit before confirming, or discard. The process takes seconds per entry.
--auto-confirm to any capture command to skip the review queue entirely. Useful in CI pipelines or personal projects where you trust the source implicitly.Quick Start
Enable git hooks and background watching in two commands:
$contxt hook install✓ Installed post-commit, pre-push, post-checkout hooks$contxt watch --daemon✓ Watcher started (PID 48291) — monitoring src/
Then annotate decisions directly in your code:
// src/lib/db.ts//@decisionUse Prisma for database|rationale:type-safe queriesimport { PrismaClient } from '@prisma/client';//@patternAlways use db.$transaction for multi-step writesexport const db = new PrismaClient();
Save the file. The watcher picks up the change and creates draft entries automatically. Run contxt review to confirm.