AI Open Guide
← Claude · For builders

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

HabitWhat to doWhy
Right modelSmallest model that passes your quality test; big model only where it mattersMost cost is spent on tasks that did not need it
Caching and batchesCache long fixed text; batch anything that can wait an hourUp to 90% less on repeated context; 50% less on batches
LimitsMonthly spending cap; per-agent budgets; rate-limit handling with retriesA bug cannot become a bill
Permission modeDefault while learning; Auto for daily work; never "skip" on real dataClaude asks before the step you would regret
SecretsKeys in environment variables or a secrets store; never in prompts, repos or chatsKeys leak through the places you forget
Untrusted inputTreat web pages, emails and documents as data, not instructions; keep tools scopedPrompt injection is real; scope limits the damage
ReviewAgents open PRs, humans merge; read what the agent changedThe last line of defense is a person

5Try it now

  1. In the console, set a monthly spending limit now, before anything else.
  2. In Claude Code, type /permissions and read what Auto allows; switch to Default for a session and feel the difference.
  3. 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:

Claude Code's notice that Auto mode is the default permission mode
Claude Code's notice that Auto mode is the default permission mode

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.