Easily aggregate your Cursor rules and generate a
CLAUDE.mdfile for:
- 🔄 Transition from Cursor to Claude Code
- 🤖 Automated CC Code Reviews via GitHub Action
Moving between AI coding assistants shouldn't be a hassle. Cursor Rules to Claude empowers developers to:
- Transition from Cursor to Claude Code: Take your carefully crafted
.mdcand Cursor rules with you. - Generate
CLAUDE.md: Create the configuration file required for Claude Code Action and CC Code Reviews automatically. - Consolidate Knowledge: Aggregate scattered rule files into a single, cohesive context file (
all_rules.txt) for any LLM.
- Automatic Aggregation: Scans your
rules/directory and combines all rule files. - Smart Generation: Uses Anthropic (Claude) or OpenAI (GPT) to intelligently synthesize a
CLAUDE.mdfile based on yoursystem_prompt.txt. - Token Counting: Calculates token usage before sending requests to avoid surprises.
- Dual Vendor Support: Works with both Anthropic and OpenAI API keys.
- Executable Generation: Build a standalone binary for easy usage across your system.
- Node.js (v18+ recommended)
- pnpm (or npm/yarn)
- API Key: An
ANTHROPIC_API_KEYorOPENAI_API_KEY.
-
Clone the repository:
git clone <your-repo-url> cd cursor-rules-to-claude
-
Install dependencies:
pnpm install
-
Configure Environment: Create a
.envfile in the root directory:# Required: Choose one (Anthropic is preferred for CLAUDE.md generation) ANTHROPIC_API_KEY=sk-ant-... # OR OPENAI_API_KEY=sk-proj-... # Optional Configuration MAX_TOKENS=32000 # Optional: Override default models # ANTHROPIC_MODEL=claude-sonnet-4-20250514 # OPENAI_MODEL=gpt-5.1-2025-11-13
To work on the tool and test changes locally:
-
Add Rules: Place your Cursor rule files (e.g.,
.mdc,.md) in therules/directory. -
Run in Dev Mode:
pnpm start
This runs
ts-node src/index.ts. -
Review Output:
output/all_rules.txt: The concatenated raw text of all your rules.output/CLAUDE.md: The generated instructions file.
To build a standalone executable script that you can run from anywhere:
-
Build the project:
pnpm run build
This compiles the TypeScript code and runs the executable creation script.
-
Locate the executable: The executable will be created at
dist/cursor-rules-aggregator. -
Run the executable:
./dist/cursor-rules-aggregator
Options:
cursor-rules-to-claude/
├── rules/ # 📥 INPUT: Place your cursor rules here
├── output/ # 📤 OUTPUT: Generated files appear here
├── src/
│ ├── controllers/ # Main logic and flow
│ ├── services/ # AI integration (Anthropic/OpenAI)
│ └── utils/ # File handling helpers
├── scripts/ # Build scripts
├── system_prompt.txt # Instructions for the AI on how to format CLAUDE.md
└── package.json
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.

