From cursor-pack
Guides Cursor context management using @-mentions (@Files, @Codebase), context pills, and task strategies for code understanding, debugging, and architecture.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin cursor-packThis skill is limited to using the following tools:
Optimize how Cursor AI uses context to produce accurate, relevant responses. Context is everything the model sees when generating a response -- managing it well is the single biggest lever for output quality.
Guides Cursor AI Chat: panel (Cmd+L) for conversations, inline edit (Cmd+K) for targeted changes, @-mentions (@Files, @Codebase, @Web) for context in code assistance.
Optimizes AI agent context setup with rules files (CLAUDE.md), specs, source files, and hierarchy. Use for new sessions, degrading output, task switches, or project configuration.
Provides expert guidance on Cursor AI IDE features like .cursorrules files, Plan Mode, Background Agents, context management, and model selection for AI-assisted coding productivity.
Share bugs, ideas, or general feedback.
Optimize how Cursor AI uses context to produce accurate, relevant responses. Context is everything the model sees when generating a response -- managing it well is the single biggest lever for output quality.
Cursor assembles context from multiple sources before each AI request:
┌─ Always Included ─────────────────────────────────────┐
│ System prompt (Cursor internal) │
│ Active .cursor/rules/*.mdc with alwaysApply: true │
│ Current file (for Tab, Inline Edit) │
└───────────────────────────────────────────────────────┘
┌─ Conditionally Included ──────────────────────────────┐
│ Selected code (highlighted before Cmd+L/Cmd+K) │
│ @-mention targets (@Files, @Folders, @Code) │
│ Glob-matched rules (.mdc with matching globs) │
│ Conversation history (prior turns in chat) │
│ Open editor tabs (lightweight reference) │
└───────────────────────────────────────────────────────┘
┌─ On-Demand (explicit @-mention) ──────────────────────┐
│ @Codebase → semantic search across indexed files │
│ @Docs → crawled external documentation │
│ @Web → live web search results │
│ @Git → uncommitted diff or branch diff │
│ @Lint Errors → current file lint diagnostics │
└───────────────────────────────────────────────────────┘
Active context appears as pills at the top of the Chat/Composer panel:
[main.ts] [src/utils/] [@Web: next.js 15] [Rule: typescript-standards]
x on a pill to remove it from context@src/auth/middleware.ts @src/types/user.ts
Explain how the JWT validation works and what happens when a token expires.
Use @Files for specific files. Avoid @Folders unless you need the full directory -- it consumes a lot of context.
@src/hooks/useCart.ts @Lint Errors @Recent Changes
The cart total is NaN after the latest changes. What broke?
@Recent Changes + @Lint Errors gives the model forensic context.
@Codebase where are database queries made?
@Codebase triggers semantic search across the indexed codebase. Good for discovery when you do not know which files are relevant. Costs more context than targeted @Files mentions.
@Docs Prisma @Web prisma client extensions 2025
How do I add soft-delete as a Prisma Client extension?
@Docs uses pre-indexed documentation. @Web does a live search. Combine both for comprehensive answers about third-party tools.
Each model has a context limit. Overloading it causes the model to drop information silently:
| Model | Context Window | Practical Limit |
|---|---|---|
| GPT-4o | 128K tokens | ~80K usable |
| Claude Sonnet | 200K tokens | ~150K usable |
| Claude Opus | 200K tokens | ~150K usable |
| cursor-small | 8K tokens | ~5K usable |
@src/api/users.ts is better than @src/api/.x to drop stale files.@Files when you know the location.Cursor automatically includes context in some cases:
| Feature | Automatic Context |
|---|---|
| Tab Completion | Current file + open tabs + recent edits |
| Inline Edit (Cmd+K) | Selected code + surrounding file |
| Chat (Cmd+L) | Conversation history + explicitly added context |
| Composer (Cmd+I) | Referenced files + codebase search |
For Chat and Composer, you control context through @-mentions. Tab and Inline Edit manage their own context automatically.
Prevent files from ever being included in AI context:
# .cursorignore (project root)
# Secrets and credentials
.env
.env.*
**/secrets/
**/credentials/
# Large generated files
dist/
build/
node_modules/
*.min.js
*.bundle.js
# Data files that consume context budget
*.csv
*.sql
*.sqlite
fixtures/
Note: .cursorignore is best-effort. It prevents files from appearing in indexing and AI features, but is not a security boundary for protecting secrets. Use .gitignore and environment variables for actual secret management.
Project rules automatically inject context when relevant files are opened:
# .cursor/rules/database-patterns.mdc
---
description: "Database query patterns and conventions"
globs: "src/db/**/*.ts,src/repositories/**/*.ts"
alwaysApply: false
---
# Database Conventions
- Use parameterized queries exclusively
- All queries go through repository pattern
- Wrap multi-table operations in transactions
- Use connection pooling (pool size: 10)
This rule automatically loads when editing database files, giving the AI the right conventions without you manually adding context each time.
.cursorignore to exclude files with PII, credentials, or regulated data