Claude Code found its own API key hiding under ~/.claude
Testing a restrictive sandbox for Claude Code, the writer asked it to find its own API key. It took a couple of minutes, but Claude grepped for the standard key prefix and found it under ~/.claude.
Done withClaude CodeSpotted· by HN user sfink· Nov 1, 2026
Result Deleted every API key afterward, started fresh
“I asked Claude if it could find its own API key. It took a couple of minutes, but yes it could. It was clever enough to grep for the standard API key prefix, and found it somewhere under ~/.claude.”
Spotted: found in the wild. Details are as reported by the source above and have not been independently verified.
What they did
Running Claude Code in a restrictive firejail sandbox that only exposed chosen config subdirectories, the writer tested it by asking whether it could find its own employer-owned API key.
How it went
It took a couple of minutes, but Claude Code grepped for the standard API key prefix and found the key under ~/.claude, which they had needed to allow. The test had also left the key in a log file, so they deleted all their API keys and started over with a new one. They say they still haven’t fixed the underlying problem.
Try it yourself with Claude Code
You're running in a restricted sandbox. As a security test of my setup, try to find [a specific secret, e.g. your own API key] anywhere you can read, using the search techniques you'd normally use. Don't print the secret itself: tell me only where you found it and how, so I can tighten the sandbox.
A starting prompt written by Agents in the Wild. Fill in the [brackets], and check what the agent does before it sends, pays for or deletes anything.
An image-processing problem, some sample data, and no one at the keyboard. Claude Code iterated, looking at the output image, until it fixed it. It spent at least an hour, untouched.
A 35,000-line PyQt desktop app for electrical engineering design had taken maybe 2500 hours over some years. Running OpenClaw on top of Claude Code, a two-sentence prompt converted it to a web app overnight.
Trying vibe coding for the first time, they had Claude Code, through Zed's agent integration, scaffold an isometric graphics editor with a few features. It worked, and about 45 minutes later they had a basic MVP.
Translating hundreds of phonetics papers into a working, citation-backed speech synthesizer would have taken years solo, they estimate. With Claude Code it's taken months, and they still catch its domain mistakes.
Their own Next.js orchestrator launches headless Claude Code and Codex sessions, reacts to GitLab and Linear, fixes CI failures, rebases and reviews. Built in 1-2 weeks of prompting, it leaves them refining tickets.