Tutorials

How to Export Rules from RuleSync

Export your rulesets from RuleSync: as CLAUDE.md, .cursorrules, JSON, or Markdown. For backup, migration, sharing, or using rules outside the RuleSync ecosystem.

4 min read·July 5, 2025

Your rules are your data. Export as CLAUDE.md, .cursorrules, JSON, or Markdown — anytime, any format, no restrictions.

Dashboard, CLI, and API export, automated weekly backups, version-specific snapshots, and compliance evidence

Why Export: Backup, Migration, and Portability

Export use cases: backup (regular export of all rulesets for disaster recovery — if RuleSync is unavailable, you have local copies of all rules), migration (moving to a different rule management tool or to a manual git-based workflow), sharing (exporting a ruleset to share with a partner organization that does not use RuleSync), offline use (exporting rules for air-gapped environments or development without internet access), and auditing (exporting the current rule state for compliance documentation or security review).

The export principle: your rules are your data. RuleSync stores and manages them, but you own them. Export: available at any time, in standard formats, with no restrictions. You should never feel locked into RuleSync because you cannot get your data out. The export: ensures portability. If you decide to manage rules differently: export everything and continue without RuleSync. AI rule: 'Data portability is a feature, not a limitation. Export: always available, always free, always complete.'

Export formats: CLAUDE.md (the generated rule file for Claude Code), .cursorrules (the generated rule file for Cursor), JSON (the structured data representation of the ruleset — includes metadata, version history, and assignments), and Markdown (the human-readable source content of the ruleset). Each format: serves a different use case.

Step 1: Export from the Dashboard

Single ruleset export: Rulesets → [your ruleset] → Export. Choose format: CLAUDE.md (the composed output file), .cursorrules (same content, Cursor format), Source Markdown (the editable source content), or JSON (complete data including metadata and version history). The export: downloads immediately. For CLAUDE.md and .cursorrules: the file is identical to what rulesync pull generates. For JSON: includes additional metadata (version, description, assignments, creation date).

Bulk export: Settings → Data → Export All Rulesets. Exports: every ruleset in the organization as a ZIP file. The ZIP: contains one directory per ruleset, each with the source Markdown, the generated outputs (CLAUDE.md, .cursorrules), and a metadata.json file. The bulk export: the complete backup of your organization's AI rules. Use: for disaster recovery (store the ZIP in a secure backup location) and for auditing (the ZIP is a point-in-time snapshot of all rules).

Version-specific export: for rulesets with version history, export a specific version. Rulesets → [your ruleset] → Version History → [select version] → Export. This exports: the ruleset as it existed at that version. Use: for comparing versions (export v2.3 and v2.5, diff the Markdown), for rollback (export an old version and re-import it), and for auditing (export the version that was active on a specific date). AI rule: 'Version-specific export: the time machine for your rules. Export any historical version for comparison, rollback, or audit purposes.'

💡 Bulk Export = Complete Backup in One Click

Settings → Data → Export All Rulesets → Download ZIP. The ZIP: every ruleset, every format (CLAUDE.md, .cursorrules, source Markdown, metadata JSON). Total time: 5 seconds. The ZIP: a complete backup of your organization's AI rules. Store it: alongside other critical data backups. If RuleSync has an extended outage: you have every rule, every version, every assignment — locally. The bulk export: the 5-second insurance policy.

Step 2: Export via CLI and API

CLI export: rulesync export --ruleset my-ruleset --format markdown --output ./exported-rules/. The CLI: exports the specified ruleset in the specified format to the specified directory. For all rulesets: rulesync export --all --format json --output ./backup/. The CLI export: scriptable, automatable, and suitable for inclusion in backup pipelines. AI rule: 'CLI export in a backup script: the automated backup approach. Schedule weekly: rulesync export --all --format json --output /backups/rulesync-$(date +%Y%m%d)/.'

API export: GET /api/v1/rulesets/{id}/export?format=markdown. Returns the ruleset content in the requested format. For bulk: GET /api/v1/rulesets/export?format=json (returns all rulesets as a JSON array). The API: for custom integrations, automated workflows, and programmatic access. Authenticate: with the RULESYNC_API_KEY header. AI rule: 'The API export: for custom tooling that needs to read RuleSync data programmatically. The CLI: for humans and scripts. The dashboard: for one-time manual exports.'

Automated backup pipeline: a weekly GitHub Action or cron job that: calls rulesync export --all, stores the export in a backup repository or S3 bucket, and retains the last 12 weekly backups (3 months of history). The pipeline: ensures you always have a recent backup, regardless of what happens to the RuleSync service. AI rule: 'Automated weekly backup: the insurance policy. If RuleSync has an extended outage: you have all rules locally. If you decide to leave RuleSync: you have all data exported. The backup: makes the decision to use RuleSync risk-free.'

ℹ️ Version-Specific Export: The Time Machine for Your Rules

Question: 'What did our error handling rule say 3 months ago, before we changed it?' Without version export: dig through git history, reconstruct the old CLAUDE.md, and hope the changes are traceable. With version-specific export: Rulesets → Error Handling → Version History → v2.3 (from 3 months ago) → Export. The rule: exactly as it existed 3 months ago. Downloaded in 2 seconds. The version export: answers historical questions instantly.

Step 3: Export Best Practices

Regular backups: export all rulesets weekly. Store in: a git repository (version-controlled backup — compare exports over time), an S3 bucket or equivalent (durable cloud storage), or the organization's backup system (alongside other critical data backups). The backup: not a replacement for RuleSync (RuleSync provides: versioning, sync, composition, and management). The backup: insurance against data loss.

Export before major changes: before a major ruleset restructuring, technology migration, or organizational change: export all rulesets. The export: a snapshot you can restore from if the change goes wrong. After the change: export again (the new state). Both exports: preserved for comparison and rollback. AI rule: 'Export before major changes. If the change fails: restore from the export. The export: a safety net that costs 30 seconds to create.'

Export for compliance: some compliance frameworks (SOC 2, ISO 27001) require evidence of: what coding standards are in place, when they were established, and how they have changed over time. Monthly exports: provide this evidence trail. Each export: timestamped and stored alongside other compliance documentation. The exports: demonstrate systematic management of AI coding standards. AI rule: 'Monthly exports for compliance. Weekly exports for backup. Both: simple to automate and valuable for different purposes.'

⚠️ Export Before Major Restructuring — 30 Seconds of Insurance

You are about to: restructure the entire ruleset (splitting one large ruleset into 3 technology-specific rulesets), migrate from manual rules to RuleSync-managed rules, or merge two organizations' rulesets. Before starting: export everything. If the restructuring goes wrong: restore from the export. If the migration has issues: rollback to the exported state. The export: 30 seconds. The restructuring rollback without an export: hours of manual reconstruction.

Export Summary

Summary of exporting rules from RuleSync.

  • Formats: CLAUDE.md, .cursorrules, Source Markdown, JSON (with metadata and version history)
  • Dashboard: single ruleset or bulk (ZIP of all rulesets). Version-specific export available
  • CLI: rulesync export --ruleset/--all --format --output. Scriptable for automated backups
  • API: GET /api/v1/rulesets/{id}/export. For custom integrations and programmatic access
  • Backup: weekly automated export to git repo or S3. Retain 12 weeks (3 months history)
  • Before changes: export snapshot before major restructuring. Restore if the change fails
  • Compliance: monthly exports as evidence for SOC 2, ISO 27001 audits
  • Principle: your rules are your data. Export always available, always free, always complete
How to Export Rules from RuleSync — RuleSync Blog