Skip to main content
Everything Claude Code provides full Cursor IDE support with hooks, rules, agents, skills, commands, and MCP configs adapted for Cursor’s native format.

Overview

Cursor has more hook events than Claude Code (20 vs 8), providing richer automation capabilities. ECC leverages this with a DRY adapter pattern that reuses existing hook logic.

What’s Included

ComponentCountDetails
Hook Events15sessionStart, beforeShellExecution, afterFileEdit, beforeMCPExecution, beforeSubmitPrompt, and 10 more
Hook Scripts16Thin Node.js scripts delegating to scripts/hooks/ via shared adapter
Rules299 common (alwaysApply) + 20 language-specific (TypeScript, Python, Go, Swift)
AgentsSharedVia AGENTS.md at root (read by Cursor natively)
SkillsShared + BundledVia AGENTS.md at root and .cursor/skills/ for translated additions
CommandsShared.cursor/commands/ if installed
MCP ConfigShared.cursor/mcp.json if installed

Installation

Quick Install

# Install for your language(s)
./install.sh --target cursor typescript

# Multiple languages
./install.sh --target cursor python golang swift
The installer:
  • Copies rules to .cursor/rules/ with YAML frontmatter
  • Creates hook scripts in .cursor/hooks/
  • Sets up the DRY adapter pattern
  • Configures language-specific settings

Manual Installation

# Clone the repository
git clone https://github.com/affaan-m/everything-claude-code.git
cd everything-claude-code

# Copy rules (common + language-specific)
cp -r .cursor/rules/* ~/.cursor/rules/

# Copy hooks
cp -r .cursor/hooks/* ~/.cursor/hooks/

# AGENTS.md is auto-detected from repo root

Hook Architecture (DRY Adapter Pattern)

Cursor’s extensive hook system (20 events) is more powerful than Claude Code’s (8 events). The .cursor/hooks/adapter.js module transforms Cursor’s stdin JSON to Claude Code’s format, allowing existing scripts/hooks/*.js to be reused without duplication.
Cursor stdin JSON → adapter.js → transforms → scripts/hooks/*.js
                                               (shared with Claude Code)

Architecture Benefits

DRY Principle

Hook logic written once, works on both platforms

Zero Duplication

No need to maintain separate hook implementations

Cursor Advantages

More events = richer automation than Claude Code

Easy Maintenance

Bug fixes apply to both platforms automatically

Example Hook

const { transformCursorInput } = require('./adapter');
const shellCheck = require('../../scripts/hooks/shell-check');

const input = JSON.parse(require('fs').readFileSync(0, 'utf-8'));
const transformed = transformCursorInput('beforeShellExecution', input);
shellCheck(transformed);

15 Hook Events

Cursor provides these hook events:
  • sessionStart — Load context on session start
  • sessionEnd — Save state on session end
  • sessionIdle — Suggest compaction when idle
  • beforeFileRead — Validate file access permissions
  • afterFileEdit — Auto-format, run type checks
  • beforeFileWrite — Block writes to protected files
  • beforeTabFileRead — Block Tab from reading .env, .key, .pem files
  • beforeShellExecution — Block dev servers outside tmux, git push review
  • afterShellExecution — Log command results, detect failures
  • beforeSubmitPrompt — Detect secrets (sk-, ghp_, AKIA) in prompts
  • afterPromptResponse — Extract learnings from responses
  • beforeMCPExecution — Audit MCP tool calls
  • afterMCPExecution — Log MCP results
  • beforeToolUse — Generic pre-tool validation
  • afterToolUse — Generic post-tool actions

Key Hooks in Action

# Blocks dev servers outside tmux (exit 2)
npm run dev  # ❌ Error: Dev servers must run in tmux

# Warns on git push
git push     # ⚠️  Warning: Review changes before pushing

Rules Format

Cursor rules use YAML frontmatter with description, globs, and alwaysApply:
---
description: "TypeScript coding style extending common rules"
globs: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
alwaysApply: false
---

# TypeScript Coding Standards

## Immutability

ALWAYS create new objects, NEVER mutate existing ones.

```typescript
// ❌ Bad - mutation
const user = { name: 'Alice' };
user.name = 'Bob';

// ✅ Good - immutable
const user = { name: 'Alice' };
const updated = { ...user, name: 'Bob' };

Type Safety

Use strict TypeScript settings. Avoid any.

### Common Rules (alwaysApply: true)

These apply to **all files** regardless of language:

- `coding-style.md` — Immutability, file organization
- `git-workflow.md` — Commit format, PR process
- `testing.md` — TDD, 80% coverage requirement
- `performance.md` — Model selection, context management
- `patterns.md` — Design patterns, skeleton projects
- `hooks.md` — Hook architecture, TodoWrite
- `agents.md` — When to delegate to subagents
- `security.md` — Mandatory security checks

### Language-Specific Rules (alwaysApply: false)

These activate based on file extension via `globs`:

<CodeGroup>
```yaml TypeScript
---
description: "TypeScript coding standards"
globs: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
alwaysApply: false
---
Python
---
description: "Python coding standards (PEP 8)"
globs: ["**/*.py"]
alwaysApply: false
---
Go
---
description: "Go idioms and best practices"
globs: ["**/*.go"]
alwaysApply: false
---
Swift
---
description: "Swift coding standards"
globs: ["**/*.swift"]
alwaysApply: false
---

Configuration Example

.cursor/settings.json:
{
  "cursor.ai.model": "claude-sonnet-4.6",
  "cursor.ai.maxTokens": 10000,
  "cursor.ai.temperature": 0.7,
  "cursor.ai.enableHooks": true,
  "cursor.ai.rulesDirectory": ".cursor/rules"
}

Feature Comparison

FeatureClaude CodeCursor IDE
Agents13 agentsShared (AGENTS.md)
Commands33 commandsShared
Skills50+ skillsShared + Bundled
Hook Events8 types15 types
Hook Scripts9 scripts16 scripts
Rules29 rules29 rules (YAML)
Custom ToolsVia hooksVia hooks
MCP Servers14 serversShared
Secret DetectionHook-basedbeforeSubmitPrompt hook
Auto-FormatPostToolUse hookafterFileEdit hook
Cursor Advantages: More hook events, richer automation, native IDE integration

Usage Examples

Starting a Feature

# Cursor detects AGENTS.md automatically
# Just start prompting:

"Plan authentication with OAuth"
# → planner agent creates blueprint

"Implement with TDD"
# → tdd-guide enforces write-tests-first

"Review my changes"
# → code-reviewer checks quality

Auto-Formatting on Save

Cursor’s afterFileEdit hook automatically:
  1. Runs Prettier on TypeScript/JavaScript files
  2. Runs TypeScript compiler check
  3. Warns if console.log detected
  4. Updates documentation if needed
No manual action required!

Secret Detection

# Try to submit a prompt with a secret:
"Deploy with API key sk-1234567890"

# beforeSubmitPrompt hook blocks it:
# ❌ Error: Detected secret pattern in prompt (sk-)

Best Practices

Use AGENTS.md

Keep project-specific context in AGENTS.md at repo root

Leverage Hooks

Cursor’s 15 hook events enable rich automation

Language Rules

Install only rules for languages you use

Test Hooks

Verify hooks work by triggering events manually

Troubleshooting

  1. Check .cursor/hooks/ exists and scripts are executable
  2. Verify cursor.ai.enableHooks is true in settings
  3. Check hook script exit codes (0 = allow, 2 = block)
  4. View Cursor logs for hook execution errors
  1. Verify rules are in .cursor/rules/
  2. Check YAML frontmatter is valid
  3. Ensure globs match your file extensions
  4. Common rules need alwaysApply: true
  1. Place AGENTS.md at repository root
  2. Restart Cursor
  3. Open a file in the project
  4. Check Cursor AI panel for context loading

Next Steps

Hook Examples

See all 16 hook scripts in detail

Rules Guide

Learn about the 29 rules and how to customize

Agents

Explore shared agent system

Skills

Browse 50+ skills available in Cursor