My AI agent ran a loop overnight and billed me way more than expected. So I built a small library that wraps your OpenAI client and blocks calls before they happen if they’d exceed your budget. import { guard } from ‘@salimassili/ai-costguard’ const ai = guard(anthropic, { budget: 10 }) That’s it. It also detects loops and retry spirals. Free and open source: github.com/salimassili/[ https://github.com/salimassili62-afk/ai-costguard/ ] npm: npmjs.com/package/@salimassili/ai-costguard Would love feedback from anyone building AI agents. submitted by /u/salim_assili
Originally posted by u/salim_assili on r/ClaudeCode
You must log in or # to comment.
