What's the best practice coding with Cursor agent?

Glad to hear /agent-review is working and that the context usage in canvas was helpful.

On your question about the system prompt and compact, you don’t need to worry. The system prompt (Cursor’s base instructions plus anything specific to the model or agent) is re-sent on every request and isn’t part of what compaction compresses. Compaction only runs over the chat history, messages, tool calls, and tool results, not the system prompt. So if you switch to a different agent, it just has its own system prompt, and compact won’t “collapse” it.

Where you can actually lose info is in the compressed chat history. Summarization is lossy by definition, so some details from earlier messages can get smoothed out. There are also open reports that summarization can sometimes drop active skills and tool usage knowledge, which can cause disruptive tool permission failures, for example this thread: After context summarization, the agent loses active Skills and tool-usage knowledge (causes disruptive tool/permission failures)

Practical takeaway for your subagent pattern: keep critical instructions and review criteria in rules files, not only in the chat. For example .cursor/rules with alwaysApply, AGENTS.md, BUGBOT.md. These rules are pulled from config, not kept alive by chat memory, so they’re more resilient to compaction than info buried in the conversation.

Docs for context: rules Rules | Cursor Docs, subagents Subagents | Cursor Docs