Token Optimization Mechanism Explained
Cursor Memories uses an intelligent hierarchical loading strategy to balance context comprehensiveness with token usage efficiency. Instead of reading everything, the system loads different combinations of documents on demand, depending on the current development phase and task type. For example, in PLAN mode, only projectbrief.md and techContext.md will be loaded, while progress notes will be brought in only when they are actually needed.
- ground rules: each schema has its own minimum set of documents loaded by default
- dynamic expansion: allow users to add temporary contexts via activeContext.md
- caching mechanism: loaded content is retained within the session, reducing duplicate transmissions
Practical data show that this layered strategy can reduce the token consumption of 20%-40%, which is especially suitable for long-term development of large projects.
This answer comes from the articleCursor Memories: Provides persistent context memory for Cursors.The