@datasemantics/cursor-agent
v0.1.9
Published
Per-developer agent that extracts Cursor usage (prompts, sessions, tool calls) from local state.vscdb (whichever is fresher: live or .backup) and ships it to a central admin server. Pure-JS SQLite via sql.js — no native compile. Path-only privacy contract
Maintainers
Readme
@datasemantics/cursor-agent
Per-developer agent for cursor-monitor — extracts prompts, sessions, tool calls, and per-commit AI attribution from your local Cursor install and ships them to a central admin dashboard for team monitoring.
Ships file paths and names only — never file contents. See What gets sent / What does NOT leave your machine below for the full list.
Install (Windows)
# Get the server URL + shared secret from your admin, then:
powershell -ExecutionPolicy Bypass -File install.ps1 -ServerUrl "https://cursor-monitor.example.com" -AgentSecret "<secret from admin>"The installer:
- Verifies Node.js 20+ is on PATH.
npm install -g @datasemantics/cursor-agent.- Configures the agent (writes
%USERPROFILE%\.cursor-agent\config.json, mode 0600). - Registers a Windows Scheduled Task that runs every 5 minutes, only while you're logged in.
No admin rights required. No Intune. No code signing (v1).
macOS / Linux
npm install -g @datasemantics/cursor-agent
cursor-agent init --server=https://... --secret=...
# Add to crontab:
(crontab -l 2>/dev/null; echo "*/5 * * * * $(which cursor-agent) run") | crontab -CLI
| Command | What it does |
|---|---|
| cursor-agent init | Interactive setup, writes config |
| cursor-agent run | One-shot: read Cursor state → ship to server |
| cursor-agent start | Register scheduled task (Windows) |
| cursor-agent stop | Deregister the scheduled task |
| cursor-agent status | Print config + last-run stats |
| cursor-agent uninstall | Remove task + config (then npm uninstall -g @datasemantics/cursor-agent) |
What gets sent to the server
Each run ships:
- Sessions (composer metadata): name, workspace folder path, unified_mode, lines added/removed, files changed, context%.
- Messages (from
cursorDiskKV): role, prompt/response text, token counts, file-path refs (NOT file content). - Workspaces: local folder path → workspace ID mapping.
- Daily stats: tab vs composer lines accepted/suggested per day.
- Recent commit: AI attribution % from
aiCodeTracking.recentCommit. - Metadata: your Cursor email, machine ID, OS hostname, privacy-mode setting, agent version.
What does NOT leave your machine
- Full file content from
codebaseContextChunks,attachedCodeChunks,gitDiffs,tool_resultbodies,write_file/search_replacecontent args, images. - The agent strips these at parse time and ships only
{path, bytes, sha256}stubs. - Admin never sees your code — only which files were referenced and how many bytes were stripped.
Troubleshooting
- Log file:
%USERPROFILE%\.cursor-agent\agent.log(Windows) /~/.cursor-agent/agent.log - Scheduled task:
schtasks /Query /TN DataSemantics_CursorAgent /V /FO LIST - Manual run with verbose output:
cursor-agent run(logs to stderr) - Server unreachable: the agent fails open on kill-switch check; normal runs will retry on next tick.
- Cursor schema change: if a Cursor update breaks extraction, the agent logs parse errors per row but continues. Report to admin.
Uninstall completely
cursor-agent uninstall # stops the task, removes config
npm uninstall -g @datasemantics/cursor-agent
# Optional: remove the log directory
Remove-Item -Recurse "$env:USERPROFILE\.cursor-agent"