---
description: This rule explains how to create and update an analytics.md file to track how often .mdc rules is being used.
globs: *
alwaysApply: false
---
# Cursor Rules Analytics
Each time you use a Cursor rule, update the analytics tracking file.
File location:
```
PROJECT_ROOT/.cursor/analytics.md
```
## Format
The analytics file contains a count of how many times each rule has been used:
```
rule-name.mdc: 5
another-rule.mdc: 2
```
Add new rules as needed.
Track rule usage with automated analytics for your Cursor projects. This rule manages a centralized analytics file that keeps count of how often each Cursor rule is being used, providing visibility into which rules are most valuable to your workflow.
The Cursor Rules Analytics rule creates and maintains a simple tracking system that automatically counts how many times each rule in your project has been used. It works by updating a dedicated analytics file within your project's .cursor
directory each time a rule is invoked.
The analytics data is stored in a straightforward format—a list of rule filenames paired with their usage counts:
rule-name.mdc: 5
another-rule.mdc: 2
This provides a quick way to see which rules are most frequently used in your workflow, helping you understand which rules provide the most value.
When the rule is activated, it checks for the existence of an analytics file at .cursor/analytics.md
in your project's root directory. If the file doesn't exist, it creates one. Each time a rule is used, the counter for that specific rule is incremented in the analytics file.
The system is designed to be:
The rule is stored in the file rule-analytics.mdc
and can be activated in Cursor based on its glob pattern configuration:
Since this rule has a glob pattern of *
, it's configured as an "Auto Attached" rule that activates automatically whenever you're working with any file in your project. This means the analytics tracking should work without manual intervention.
If you need to invoke it manually for any reason, you can do so by typing @rule-analytics
in the chat or Command-K interface.
The automatic nature of this rule makes it particularly valuable—once configured, you can simply work as usual while the rule silently tracks which rules are being used most frequently.
To check which rules are being used most often:
.cursor/analytics.md
in your projectSince the analytics file lives in the .cursor
directory, you may want to:
By monitoring rule usage through this analytics system, you can make more informed decisions about which rules to invest time in improving and which might be unnecessary for your workflow.