Total System Reset
Relevant source files
The following files were used as context for generating this wiki page:
The "Total System Reset" is a comprehensive utility designed to completely purge all settings, configurations, and identification data related to the Cursor AI editor from a user's system. Its primary purpose, within the educational context of this project, is to demonstrate the mechanisms used by software to track trial periods and how they can be reset. This feature performs a destructive action on Cursor-specific files, clearing cached data, resetting machine identifiers, and patching core application files to bypass trial detection. The process is initiated by the user from the main menu.
Sources: main.py:403-405, locales/en.json:284-301
Overview and Execution Flow
The reset process is a multi-step operation that combines file system manipulation, database updates, system-level identifier changes, and JavaScript file patching. Before execution, the user is presented with a detailed disclaimer about the permanent nature of the action and must provide explicit confirmation to proceed.
Sources: locales/en.json:302-318, totally_reset_cursor.py
The following diagram illustrates the high-level execution flow of the Total System Reset feature.
Key Features
The reset process is designed to be thorough, targeting multiple aspects of the Cursor installation.
| Feature | Description |
|---|---|
| Configuration Removal | Complete removal of Cursor AI settings and configurations. |
| Cache Clearing | Clears all cached data, including AI history and prompts. |
| Machine ID Reset | Resets the machine ID to bypass trial detection by creating new randomized identifiers. |
| Preference Reset | Removes custom extensions and user preferences. |
| Trial Data Purge | Resets trial information and activation data. |
| Deep File Scan | Performs a deep scan for hidden license and trial-related files. |
| Cross-Platform | Compatible with Windows, macOS, and Linux. |
Sources: locales/en.json:293-301
Machine ID and Configuration Reset
A core component of the reset process is the MachineIDResetter class, which is responsible for generating new identifiers and updating them across Cursor's configuration files and databases. This is the primary mechanism for bypassing trial detection.
Sources: totally_reset_cursor.py:615-860, reset_machine_manual.py:620-865
ID Generation and Update
The generate_new_ids method creates a new set of unique identifiers. These are then propagated to Cursor's JSON configuration, its SQLite database, and system-level identifiers.
This diagram shows the process of generating and applying the new machine IDs.
The following new identifiers are generated:
| ID Key | Generation Method | Purpose |
|---|---|---|
telemetry.devDeviceId | uuid.uuid4() | A unique device identifier for telemetry. |
storage.serviceMachineId | uuid.uuid4() | A unique machine identifier for storage services. |
telemetry.machineId | hashlib.sha256(os.urandom(32)) | A 64-character hexadecimal ID for machine identification. |
telemetry.macMachineId | hashlib.sha512(os.urandom(64)) | A 128-character hexadecimal ID, primarily for macOS. |
telemetry.sqmId | "{ + str(uuid.uuid4()).upper() + }" | A GUID for the Software Quality Metrics (SQM) client. |
Sources: totally_reset_cursor.py:706-724
Database and File Updates
The MachineIDResetter interacts with several files to persist the new IDs.
The sequence diagram below details the interactions between the resetter and the various storage mechanisms.
Sources: totally_reset_cursor.py:726-800
storage.json: The main JSON configuration file is read, updated with the new IDs, and written back to disk. A backup (.bak) is created before modification.state.vscdb: This SQLite database is updated. The script connects to the database and executesINSERT OR REPLACEqueries to update the key-value pairs corresponding to the machine IDs.machineIdfile: A separate file, typically located at~/.config/cursor/machineid(Linux) orAPPDATA\Cursor\machineId(Windows), is overwritten with the newdev_device_id.
Sources: totally_reset_cursor.py:726-753, 800-811, 862-890
System-Level Identifier Modification
To ensure a thorough reset, the script attempts to modify system-level identifiers that Cursor might use for tracking. These operations often require elevated (administrator or sudo) privileges.
Sources: totally_reset_cursor.py:755-800, locales/en.json:332-333
| Operating System | Target | Method |
|---|---|---|
| Windows | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid | A new UUID is generated and written to the registry key. |
| Windows | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient\MachineId | A new GUID is generated and written to the registry key. |
| macOS | /var/root/Library/Preferences/SystemConfiguration/com.apple.platform.uuid.plist | The plutil command is executed with sudo to replace the UUID value with the new telemetry.macMachineId. |
Sources: totally_reset_cursor.py:766-800
If these operations fail due to permission errors, the script prints a warning advising the user to run the tool as an administrator or with sudo.
Sources: totally_reset_cursor.py:773-774, 793-795
JavaScript Application Patching
A critical part of the reset process is patching Cursor's core JavaScript files. This is done to alter the application's behavior regarding trial status, feature limits, and UI elements.
Sources: totally_reset_cursor.py:507-564, reset_machine_manual.py:512-569, bypass_token_limit.py:126-187
workbench.desktop.main.js Modifications
The modify_workbench_js function applies several string replacements to this file to change the front-end behavior.
| Original Pattern | Replacement Pattern | Purpose |
|---|---|---|
title:"Upgrade to Pro" | title:"yeongpin GitHub" | Replaces the "Upgrade to Pro" button with a link to the project's GitHub repository. |
<div>Pro Trial | <div>Pro | Changes the "Pro Trial" badge to simply "Pro", implying a full version. |
notifications-toasts | notifications-toasts hidden | Hides toast notifications, which might include trial-related messages. |
async getEffectiveTokenLimit... | async getEffectiveTokenLimit(e){return 9000000;... | Bypasses the token limit for AI features by hardcoding a very large number. |
Sources: reset_machine_manual.py:526-545, bypass_token_limit.py:140-159
main.js Modifications
For Cursor versions 0.45.0 and higher, the modify_main_js function is called to patch the getMachineId function, which is another mechanism for identifying the machine.
- Target:
out/main.js - Action: It uses regular expressions to modify the
getMachineIdandgetMacMachineIdfunctions, simplifying their return logic to bypass more complex identification routines.
Sources: totally_reset_cursor.py:566-595