Claude Code Tips & Token Saving

Practical tips for using Claude Code more efficiently with BytePass. Save tokens, manage context, and get better results.


Essential commands

CommandWhat it does
/compactSummarize the conversation to reduce context size
/clearClear the entire conversation and start fresh
/contextAdd files or URLs to the context
/memoryEdit persistent memory (CLAUDE.md) for the project
/helpShow all available commands

Save tokens

1. Use /compact regularly

Long conversations accumulate context and cost more tokens per message. When you notice the conversation getting long, run /compact to summarize earlier context.

2. Use /clear between unrelated tasks

If you're switching to a completely different task, /clear is better than /compact. It gives you a fresh start with zero context overhead.

3. Write a good CLAUDE.md

Create a CLAUDE.md file in your project root. Claude Code reads it automatically at the start of every session. Put your project's key context here so you don't have to re-explain it every time:

  • Build commands (npm run dev, npm test)
  • Project architecture overview
  • Key conventions and patterns
  • Common gotchas

This saves tokens because Claude doesn't need to explore the codebase to understand basics.

4. Be specific in your prompts

"Fix the bug" costs more tokens than "Fix the null pointer in src/auth/login.ts:42" because Claude needs to search the codebase to understand the vague request.

5. Use a lightweight model for simple tasks

Not every task needs the most powerful model. For simple refactoring, formatting, or boilerplate generation, a smaller model saves significant tokens.


Context management

Add files to context proactively

Instead of letting Claude search for files:

/context src/components/Auth.tsx src/lib/api.ts

This is faster and cheaper than Claude running find and grep commands.

Keep context focused

If Claude is working on file A but keeps reading files B, C, D for context, consider whether those files are actually needed. You can redirect: "Focus only on auth.ts, don't read other files."


Codex CLI tips

config.toml settings

For Codex CLI, you can tune behavior in ~/.codex/config.toml:

[model]
name = "gpt-5.4"

[history]
max_entries = 100

[approval]
auto_approve_read = true

Set auto-approval for read operations

Codex asks permission for every file read by default. Enable auto_approve_read in config.toml to skip the prompts for read-only operations — this speeds up workflows significantly.


What's next?