Save Tokens: 6 Claude Code Commands for 2026
01 / Use slash commands as a token budget, not a shortcut list
Claude Code can spend tokens in two places: the conversation context it keeps sending and the output it generates. On a pay-as-you-go relay, both matter. The cheapest workflow in 2026 is not simply choosing a smaller model. It is keeping each task narrow, checking context before it grows, and removing stale history before the next request.
The commands below are useful because they control context, instructions, model choice, or visibility into spending. Command names and displays can change between Claude Code releases, so update the CLI and verify behavior locally before building an automated budget around them.
02 / Use /compact when the task still needs its history
Run /compact after a meaningful phase of work, especially when Claude has inspected several files, discussed alternatives, and completed a subtask. It replaces a long conversation with a summary that preserves the working state. Add a short instruction when needed, such as /compact Keep the current API contract, failed tests, and next three actions.
Compact earlier than feels necessary. A summary is usually cheaper than repeatedly resending hundreds of messages and tool results. Do not compact during a delicate debugging exchange if exact logs or code fragments are still important; save those facts in a file first.
03 / Use /clear before switching to an unrelated job
Run /clear when the next request has a different objective, repository area, or risk profile. A clean context prevents old assumptions from influencing the new task and stops irrelevant history from consuming input tokens.
For example, clear after finishing a migration review before starting documentation work. Then provide only the files, constraints, and acceptance criteria needed for the new task. This is often more economical than asking Claude to ignore a large previous conversation.
04 / Use /context to catch waste before the next request
Run /context during long sessions to inspect how much of the context window is occupied. Treat the display as a warning system, not a performance score. When the conversation is crowded with repeated tool output, compact it. When it contains unrelated work, clear it.
A practical rule is to review context at phase boundaries: after exploration, after implementation, and before tests or review. Do not wait for a context-limit error, because recovery can require another request and another round of file inspection.
05 / Use /cost to measure the session you are actually paying for
Run /cost regularly, particularly after a broad search, repeated failed commands, or a large test run. It gives a useful session-level signal about usage and helps identify habits that create expensive loops.
Relay accounting can differ from the CLI display. CheapRelay bills real tokens, including cache reads and cache writes, so a cached request is not necessarily free. Compare the relay receipt with your workflow rather than assuming that a lower visible generation count means zero input cost.
06 / Use /model before expensive reasoning, not after it
Use /model to select an appropriate model before starting a task. Keep routine edits, file navigation, and simple explanations on a lower-cost option when quality is sufficient. Reserve a stronger model for architecture, difficult debugging, or a final review.
For example, Claude Haiku 4.5 may fit mechanical changes, while Claude Sonnet 5.5 may be more suitable for a complicated cross-file design review. Switching models does not refund tokens already spent, so decide before sending the large prompt.
07 / Use /init to stop repeating project instructions
Run /init in a new repository, then review the generated project guidance before accepting it. Keep durable facts in the project instructions: build commands, test commands, directory rules, formatting requirements, and definitions of done.
This saves tokens over multiple sessions because you do not have to restate the same setup in every prompt. Keep the file concise. A bloated instruction file is still sent as context and can erase the saving. Remove obsolete rules instead of appending exceptions forever.
08 / Build a cheaper Claude Code loop in 2026
- ■ Start with /context and a short task statement.
- ■ Use /model before broad exploration or deep reasoning.
- ■ Run /compact at completed milestones.
- ■ Run /clear when the objective changes.
- ■ Run /cost after unusually long sessions.
- ■ Keep /init project guidance short and maintained.
CheapRelay is useful for this discipline because it has no monthly fee or subscription and uses pay-as-you-go billing through its Claude Code-compatible API access. If you want one key for multiple providers and a receipt-based view of actual usage, sign up for CheapRelay and start with a small balance. A tight budget still requires inspecting context: commands reduce waste, but they cannot make necessary tokens disappear.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-28 | Coding agents, cheaply | EN | $1 Budget: Catch a Coding Agent Loop Before It Spends Spot repeated tool calls, rising token use and stalled edits early, then stop and restart a coding agent within a tiny budget. |
| 2026-10-28 | Coding agents, cheaply | EN | $1 Budget: Codex and Claude Code on One Tiny Repo Compare Codex and Claude Code on one tiny Python repo with a $1 planning budget, identical tasks, local tests, and honest cost tracking. |
| 2026-10-28 | Coding agents, cheaply | EN | $0.50 task budget: Claude Code, fewer file reads A beginner workflow for limiting Claude Code's file reads, narrowing searches, and checking token spending on a tiny pay-as-you-go budget. |
| 2026-10-28 | Coding agents, cheaply | EN | $2 Budget: Connect a VS Code Assistant Connect a VS Code assistant to an OpenAI-compatible API, test one small task, and track token costs with a $2 planning budget. |
| 2026-10-28 | Coding agents, cheaply | EN | 36,000 to 12,000 Tokens: Trim Your Agent's Context A tiny-budget walkthrough for cutting coding-agent context: select files, limit logs, compact history, and check actual token charges. |
| 2026-10-28 | Coding agents, cheaply | EN | $1 Test Budget, 2 Variables: Claude Code on a Relay Connect Claude Code to CheapRelay with two environment variables, then run a small test and check token charges before spending more. |