Stopping coding agents from leaking secrets and burning tokens on 2,000-line files

by•

I built TokenSafe after a $400 monthly API bill made me check what my coding agents were sending on every turn.

For a 10-line edit, the model was pulling 2,000 lines of unrelated code and lockfiles.

When other engineering teams started testing it with Cursor and Claude Code, the bill turned out to be the smaller problem. Drowned in context noise, agents forgot imports and looped on the same broken fix.

Prompt rules in .cursorrules wore off deep into a session too. Agents still tried to hardcode credential fallbacks, disable TLS checks (verify=False), pass raw SQL strings, or run git add . with .env files in the repo.

TokenSafe sits locally on your machine (under 30ms) between your coding agents and your repositories. Your source code stays local.

Instead of feeding an entire file into the prompt, it slices only the target function and its direct callers, with type contracts intact. Before anything touches disk or git, TokenSafe Guard blocks hardcoded secrets and .env commits, and cuts off runaway edit loops.

Teammates can also share a warm L3 cache across a monorepo, and engineering leads get a Friday ROI summary. One rule we refuse to bend: every metric splits `measured` bytes kept off the wire from `estimated` baselines, and shows a dash when live data is missing.

If you want to test it on your own repo, run `npx tokensafe` or `pip install tokensafe && tokensafe` (the local sandbox is free up to 500k tokens/month; team plans are $29/seat/mo with a 7-day trial).

(the CLI is MIT-licensed on GitHub: )

If your team uses Cursor, Claude Code, Codex, or Antigravity on production repos, what fails most often for you right now: regressions on big files or secret/git near-misses?

4 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.