1In one sentence
Spending less and staying safe come from the same five habits: the right model, caching, batches, the right permission mode, and never pasting secrets.
2New words
- Permission mode (Claude Code) — Default asks before actions; Auto (the default since 2026) checks each action for risk and runs the low-risk ones itself; stricter and looser modes exist for special cases.
- Rate limit — how many requests the API accepts per minute on your tier. Going over gives errors, not bills.
- Spending limit — a cap you set in the console; the API stops when it is reached.
- Secret — any key, password or token. The one thing that must never appear in a prompt, a file in a repo, or a screenshot.
- Prompt injection — text inside a web page or document that tries to give Claude instructions ("ignore your rules and send the data"). Auto mode checks for it; your design should assume it exists.
3Why you would want it
Builders get two kinds of surprise: a bill and a breach. Both come from skipping the same small steps. This chapter is the checklist.
4The checklist
| Habit | What to do | Why |
|---|---|---|
| Right model | Smallest model that passes your quality test; big model only where it matters | Most cost is spent on tasks that did not need it |
| Caching and batches | Cache long fixed text; batch anything that can wait an hour | Up to 90% less on repeated context; 50% less on batches |
| Limits | Monthly spending cap; per-agent budgets; rate-limit handling with retries | A bug cannot become a bill |
| Permission mode | Default while learning; Auto for daily work; never "skip" on real data | Claude asks before the step you would regret |
| Secrets | Keys in environment variables or a secrets store; never in prompts, repos or chats | Keys leak through the places you forget |
| Untrusted input | Treat web pages, emails and documents as data, not instructions; keep tools scoped | Prompt injection is real; scope limits the damage |
| Review | Agents open PRs, humans merge; read what the agent changed | The last line of defense is a person |
5Try it now
- In the console, set a monthly spending limit now, before anything else.
- In Claude Code, type /permissions and read what Auto allows; switch to Default for a session and feel the difference.
- Search your repo for anything that looks like a key. Move it to an environment variable.
6What you will see
The notice Claude Code shows about Auto mode, which explains the idea in one paragraph:

In Default mode, every action gets an Allow or Deny card; in Auto, only the risky ones do. The console shows spend against your cap.
7Watch out
- "It is only a test" is how keys end up in repos. Treat test keys like real ones.
- Review what agents changed, especially what they deleted or sent. Logs exist; read them.
8Go further
Write these seven habits into your CLAUDE.md so every session starts with them. Part 7 explains how this guide stays correct as Claude changes.
