contexity CLI — see the Installation guide if you have not done that yet.
Attach a Project
Run the following two commands from any directory, replacing The
/path/to/project with the absolute path to your Git repository:init command bootstraps the project and the --yes flag accepts all prompts non-interactively. The attach command registers the project with your local Contexity state home. After these two commands complete, you will have:.cxcap/project.identity.jsonwritten into the project root — this file carries the project’s stable identity across sessions and should be committed to version control.- Local durable state created in the Contexity state home — this is where run ledgers, memory entries, and source captures are persisted.
Retrieve Context
Test that Contexity can assemble a context pack for a real task:The output is a bounded context pack. Each entry in the pack includes trust level, freshness score, original source, and selection metadata that explains why Contexity chose to include it. This lets you — and the agent — verify that the retrieved context is current and traceable before acting on it.
Connect an Agent Host
Contexity integrates with agent hosts through a generated configuration. Always preview the configuration before applying it:The Contexity supports the following host profiles out of the box:
Replace
--dry-run flag prints exactly what Contexity would write without making any changes. Review the output, then apply it:| Profile | Host |
|---|---|
codex | OpenAI Codex CLI |
claude-code | Anthropic Claude Code |
cursor | Cursor editor |
vscode | Visual Studio Code with a compatible agent extension |
codex in the commands above with whichever profile matches your agent host.Let the Agent Use It
Once the host configuration is in place, your agent host calls Contexity automatically over the MCP tool interface — you do not need to invoke these tools yourself during normal use. The host calls them in sequence across a task lifecycle:
context_start_run— called at the start of every agent task to open a tracked run in the ledger.context_retrieve_pack— called before the agent begins editing to fetch a bounded, task-aware context pack.context_impact— called before the agent edits a file that Contexity has an existing record for, to surface any known implications.context_detect_changes— called after meaningful edits to record what changed and update freshness signals.context_close_run— called at task closeout to seal the run record and persist any candidate memory entries for review.
Verify the Setup
Run the built-in doctor check to confirm the project is healthy and all connections are configured correctly:The doctor command inspects the project identity file, validates the state home, and checks the host configuration. It reports any issues with actionable remediation steps.
If you are working from a source checkout and want to run the full test suite, use
cargo test --workspace from the repository root.