Skip to content

devlog/flow-recipes/stay-in-your-terminal-spend-less-on-ai-497.md

Stay in Your Terminal, Spend Less on AI

The most expensive AI habit in my day is not choosing a powerful model. It is sending an unclear request, switching to a browser, losing my place, and paying for three attempts to recover the original task. Keyboard-first work helps because it makes the next action deliberate. The goal is not fewer keystrokes at any cost. It is fewer unnecessary tokens, retries, and interruptions.

Bind one shortcut to collect the smallest useful context

I keep a terminal pane beside my editor and bind a shortcut to open it in the current project. Before asking anything, I inspect git diff, run the relevant test, and search with rg. That usually tells me which function and failure belong in the prompt.

Do not feed the whole repository to answer a question about one parser. Send the failing assertion, the relevant function, and the constraints. Keep secrets and environment files out of the bundle. A smaller request is easier to review before sending, and it gives the model fewer distractions.

  • Select the failing function instead of attaching an entire source directory.
  • Include the exact test command so proposed fixes remain reproducible.
  • State which public interfaces must stay unchanged before requesting edits.

Make cheap and deep explicit terminal choices

I use two shell functions with names that describe intent: ask-small and ask-deep. They call the same local wrapper but choose different models. Claude Haiku 4.5 is one concrete option to try for bounded tasks such as summarizing a diff. Claude Sonnet 5.5 is another to evaluate when a change crosses module boundaries. Check current rates and measure results on your own work; a model name alone does not establish the cheapest successful outcome.

The wrapper prints the selected model and asks for confirmation before sending a large context bundle. That little pause catches accidental repository dumps. Escalate when the smaller attempt reveals genuine complexity, not automatically after every imperfect answer.

Keep one endpoint in your shell configuration

Switching providers should not require rebuilding your workflow. Fluxo gives you one key and one base URL, https://api.fluxorelay.com, for Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok, and more. It works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. Configure the appropriate endpoint and credentials for your tool rather than assuming every CLI reads the same environment variables.

Keep credentials outside version control, and avoid commands that expose them in shell history. With the connection details centralized, changing the model becomes a deliberate task-level decision rather than another configuration detour.

Reuse stable context without treating cache as free

Fluxo bills per real token, including cache reads and writes, with no monthly fee. That makes short, occasional sessions practical, but it also means cached context is not free context. Keep stable project instructions consistent when your tool and selected model support caching, and inspect reported usage instead of assuming a cache hit.

My reusable instructions cover formatting, test commands, and architectural constraints. The changing part contains only the current task. I start a fresh session when old debugging branches stop helping; dragging yesterday's investigation into today's rename is an avoidable expense.

Finish each AI turn with a local verification shortcut

Bind your focused test command somewhere easy to reach. After accepting an edit, run that test and inspect the diff before asking another question. A compiler error often needs a local correction, not another paid conversation. If another turn is necessary, send the new failure rather than repeating the entire transcript.

Track cost per completed change alongside token usage. A short answer that creates twenty minutes of cleanup is not a bargain. Neither is a sprawling rewrite when a five-line patch would do.

Keep account decisions outside the coding loop

If this workflow fits, consider creating a Fluxo account and testing it on one small task. Users also earn a referral share when people they invite pay; treat that as separate from the savings you measure in actual development. The repeatable win is simpler: stay at the keyboard, send less irrelevant context, and verify before spending again.

Next in the buffer

Sign up in a minute and get credit to try every model mentioned here. Sign up →