Saw someone do this with Claude Code a few weeks ago and got curious what mine would turn up, since I've used Cursor for everything since last year.
Opened agent mode in my home folder with some rules. Only report the file path and the kind of secret. Never print a value. Don't change anything.
It took about 6 minutes, and it found 45
The obvious ones first. 22 in .env files across old projects, a lot of them for apps I shut down ages ago. An AWS key in ~/.aws/credentials from 2023 that still works. A GitHub token in ~/.npmrc.
Then the ones that surprised me. My ~/.cursor/mcp.json had 5 keys in it, GitHub, Supabase, Stripe, Linear and Sentry, all pasted into the env blocks because that's what every MCP readme tells you to do. And 7 more in Cursor's chat history. Every time I pasted a connection string or a failing curl command to ask "why is this broken", it got saved. Those live in SQLite files in Cursor's app data, in plain text.
And the twist. The scan itself is now in my chat history too. To decide if something is a key the agent has to read it, so the matched lines from that session are saved in the same place I was worried about. Someone pointed this out on the Claude Code post and they were right. Next time I'd run gitleaks for the scan and only ask the agent about the report.
What I did after. Rotated the ones that still worked, AWS and Stripe first. Deleted the dead projects' .env files and cleared old chat history. The MCP servers get their keys from Infisical at launch now so mcp.json only has the commands, and my apps pull secrets at runtime instead of reading a .env, so there's nothing on disk to paste by accident.
Not saying anyone should panic. But if you've used Cursor for a while, run gitleaks on your home folder and check your mcp.json. Curious what everyone's number is, 47 felt high until I saw the other post had 63.