Export Formats

Export Formats

contextd can export your project context into formats that AI tools understand natively.

Available formats

CLAUDE.md

contextd export --format claude-md

Exports 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 cursorrules

Exports to .cursorrules in your project root. Cursor reads this file to understand your project’s context, conventions, and preferences.

Raw output

contextd export --format raw

Prints the combined context to stdout. Useful for piping into other tools or copying manually.

Export options

OptionDefaultDescription
--format <format>claude-mdOutput 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:

  1. Auto-refreshes stale remote sources — If any remote source hasn’t been synced in over 24 hours, it’s refreshed before export (non-blocking)
  2. Warns on very stale sources — If a source hasn’t synced in over 7 days, a warning is displayed
  3. Loads remote contexts — Reads cached files from .context/remote/
  4. 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.md and conventions.md
  • Includes architecture.md if files are specified
  • Includes modules whose scope matches the file paths
  • Includes decisions tagged with relevant keywords
contextd export --files src/api/routes.ts,src/db/schema.ts

Examples

Export to a custom path:

contextd export --format claude-md --output ./docs/context.md

Export context relevant to specific files:

contextd export --format raw --files src/api/routes.ts,src/api/middleware.ts

Choosing 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.