Export Formats
contextd can export your project context into formats that AI tools understand natively.
Available formats
CLAUDE.md
contextd export --format claude-mdExports to CLAUDE.md in your project root. This file is automatically picked up by Claude Code and included in every conversation.
The output combines all context files (project overview, architecture, conventions, modules, and decisions) into a single Markdown document, ordered: project → architecture → conventions → modules → decisions.
.cursorrules
contextd export --format cursorrulesExports to .cursorrules in your project root. Cursor reads this file to understand your project’s context, conventions, and preferences.
Raw output
contextd export --format rawPrints the combined context to stdout. Useful for piping into other tools or copying manually.
Export options
| Option | Default | Description |
|---|---|---|
--format <format> | claude-md | Output format: claude-md, cursorrules, raw |
--output <path> | (format standard) | Custom output file path |
--files <files> | (all) | Comma-separated list of specific files to include |
How exports work
Remote context merging
When you export, contextd automatically:
- Auto-refreshes stale remote sources — If any remote source hasn’t been synced in over 24 hours, it’s refreshed before export (non-blocking)
- Warns on very stale sources — If a source hasn’t synced in over 7 days, a warning is displayed
- Loads remote contexts — Reads cached files from
.context/remote/ - Merges local and remote — Local contexts take precedence on slug conflicts
File-relevant exports
When you pass --files, contextd uses relevance matching to include only context that applies to the specified files:
- Always includes
project.mdandconventions.md - Includes
architecture.mdif files are specified - Includes modules whose
scopematches the file paths - Includes decisions tagged with relevant keywords
contextd export --files src/api/routes.ts,src/db/schema.tsExamples
Export to a custom path:
contextd export --format claude-md --output ./docs/context.mdExport context relevant to specific files:
contextd export --format raw --files src/api/routes.ts,src/api/middleware.tsChoosing a format
- CLAUDE.md — Use if you work with Claude Code. It reads this file automatically on every request.
- .cursorrules — Use if you work with Cursor. It reads this file to tailor its behavior to your project.
- Raw — Use for debugging, custom integrations, or when you want to paste context manually.