## 一、建立共享的”真相文档”
最有效的方法是在项目根目录维护一套 `.notes/` 或专用文件夹,存放所有上下文文档 :[1]
– **`project_overview.md`**:
– **`task_list.md`**:当前任务拆解与优先级,
– **`project_config.md`**:约束条件、
– **`workflow_state.md`**:当前阶段、
Claude 负责**生成和更新**这些文档,Cursor 负责**读取和执行**,形成单向的”设计→实现”流。
## 二、Cursor Rules(`.cursor/rules/`)
Cursor 的 `.mdc` 规则文件是向 Cursor 内置 AI 注入持久上下文的官方机制 。规则有四种触发模式:[3][4]
| 模式 | 触发方式 | 适用场景 |
|——|———|———|
| `alwaysApply: true` | 每次对话自动加载 | 项目核心架构、技术栈说明 |
| Glob 匹配 | 特定文件/文件夹被引用时激活 | 模块级规范(如 `src/rag/**` 触发 RAG 规则)|
| Intelligently Applied | AI 根据描述判断相关性 | 条件性规范 |
| 手动调用 | 在提示中显式引用 | 特定任务的专项指引 |
每个规则文件建议**保持在 500 行以内**,内容聚焦、可操作 。[3]
## 三、`@` 符号精准注入上下文
在 Cursor 对话中用 `@` 引用具体文件,相当于”将 Claude 的设计决策带入 Cursor 的执行上下文” :[1]
“`
@.notes/task_list.md 按这个任务列表实现第3项
@src/rag/retriever.py 这个检索器的错误如何修复?
@project_overview.md 这个改动是否符合整体架构?
“`
## 四、上下文窗口管理
Cursor 的上下文会随对话积累而稀释,建议在**功能完成后开启新对话*
1. 让 Claude 对已完成工作生成**摘要文档**,存入 `.notes/`
2. 新会话开始时,用 `@` 引用该摘要,而非重新解释全部背景
3. Cursor 内置上下文压缩(compact/summarize)
## 五、针对你的 RAG 项目的具体建议
将 Claude 的架构输出直接结构化为以下文件,可以让 Cursor 无缝接管执行:
“`
project/
├── .cursor/rules/
│ ├── rag-architecture.mdc # alwaysApply,说明 LightRAG 架构约束
│ └── python-standards.mdc # Glob: src/**/*.py
├── .notes/
│ ├── project_overview.md # Claude 生成的系统架构
│ ├── task_list.md # Claude 拆解的当前迭代任务
│ └── workflow_state.md # 执行进度与日志
“`
这样,Claude 在外部完成的逻辑设计与 Cursor 的实时执行之间就形成了**持久、可追溯的上下文桥梁**,
Sources
[1] Mastering Long Codebases with Cursor, Gemini, and Claude https://forum.cursor.com/t/
[2] [Guide] A Simpler, More Autonomous AI Workflow for Cursor [New … https://forum.cursor.com/t/
[3] cursor-rules-writing | Skills Market… – LobeHub https://lobehub.com/en/skills/
[4] Rules | Cursor Docs https://cursor.com/docs/
[5] Cursor AI Dev Best Practices Just Dropped And it’s Good … – YouTube https://www.youtube.com/watch?
[6] 25 Claude Code Tips from 11 Months of Intense Use : r/ClaudeAI https://www.reddit.com/r/
[7] How I Use Every Claude Code Feature – by Shrivu Shankar https://blog.sshh.io/p/how-i-
[8] My Top Cursor Tips (Oct 2025) – DEV Community https://dev.to/heymarkkop/my-
[9] Guide:How to Handle Big Projects With Cursor https://forum.cursor.com/t/
[10] Cursor Rules Skill for Claude Code | Optimize .mdc Files – MCP Market https://mcpmarket.com/tools/
[11] 5 Useful Tips For Building with Claude Code (2025) – YouTube https://www.youtube.com/watch?
[12] CLAUDE.md and Cursor Rules: Multiple Levels – YouTube https://www.youtube.com/watch?
[13] Claude Code vs Cursor – Complete Enterprise Decision Guide 2025 https://bonjoy.com/articles/
[14] Looking for Clarity on Cursors Rules vs Cursor Skills vs Claude Skills https://www.reddit.com/r/
[15] I Read the Secret Instructions Behind Claude Code & Cursor. Here’s … https://www.youtube.com/watch?