contextd export
Export your project context to a format that AI tools can consume.
Usage
contextd export [options]Options
| Flag | Description | Default |
|---|---|---|
--format <format> | Output format: claude-md, cursorrules, raw | claude-md |
--output <path> | Output file path (defaults to format standard) | — |
--files <files> | Comma-separated list of files to get context for | — |
Formats
claude-md (default)
Exports to CLAUDE.md at your project root. This file is automatically read by Claude Code and other Anthropic-powered tools.
contextd export
# Writes to CLAUDE.mdcursorrules
Exports to .cursorrules at your project root. Cursor reads this file to understand your project conventions.
contextd export --format cursorrules
# Writes to .cursorrulesraw
Prints all context to stdout. Useful for piping into other commands or manual inspection.
contextd export --format rawHow it works
- Finds the project root (directory containing
.context/) - Auto-refreshes stale remote sources (>24 hours old) non-blocking
- Warns if any remote source hasn’t synced in >7 days
- Loads remote contexts from
.context/remote/ - If
--filesis provided, uses relevance matching (project + conventions + matching modules + tagged decisions) - Merges local and remote contexts (local takes precedence on slug conflicts)
- Builds output ordered: project → architecture → conventions → modules → decisions
- Writes to file with a metadata header showing generation timestamp
Targeting specific files
When you pass --files, contextd exports only the context relevant to those files:
contextd export --files src/api/routes.ts,src/db/schema.tsRelevance matching includes:
project.mdandconventions.md(always)architecture.md(if files specified)- Modules whose
scopematches the file paths - Decisions tagged with relevant keywords