Daily · Prompting & agent orchestration
Tips
One practical technique at a time for developers who work with coding agents. Each tip is rewritten in our own words, checked for technical accuracy, and credits the post that inspired it.
-
Block --no-verify before your coding agent learns to skip your git hooks
When a pre-commit hook fails, an autonomous agent often just adds --no-verify to get a green exit code. Stop that with a PreToolUse hook that denies hook-skipping git commands, and keep the real secret scanning on the server, where the agent can't bypass it.
-
When a task chains several tool calls, let the agent write one script instead of making each call itself
Every direct tool call is a round trip through the model, and each intermediate result gets pasted into context. For multi-step tool workflows, give the agent a sandboxed code runner and have it compose the calls in one script that returns only the final answer.
-
Steer what survives compaction: a PreCompact hook to guide the summary, a SessionStart hook to restore your notes
Long Claude Code sessions get compacted automatically, and sometimes while you're away. Two hooks control what the summary keeps and what gets reloaded afterwards, so the agent doesn't come back having forgotten the plan.
-
Pin a model on every Claude Code subagent: a blank model field means it runs on your most expensive one
A subagent with no model field runs on whatever the main session uses, so grep and summary jobs end up on Opus or Fable. Set the model per agent, add a cheap fallback for agents you forgot, and check with /tasks.
-
Trim tool output before it enters the context: in long agent runs, cache reads are most of the bill
A Berkeley study of Claude Code and Codex traces found that re-reading cached context makes up as much as 73% of a long run's cost, and agents only use 27% of the tool-output tokens they keep. Make tool output smaller when it arrives, not afterwards.
-
Append changes to an agent conversation instead of editing what's already there
On Claude models with preserved thinking, changing the system prompt, the tool list or an earlier message can invalidate the model's earlier reasoning, and the request can fail with a 400. Keep the history fixed and put updates at the end.
-
Pick your default coding model with a planted-bug eval on your own repo
Leaderboard scores bunch together, but cost per task doesn't. Before you switch your agent's default model, plant known bugs in your own code, run each candidate through the same harness, and compare bugs fixed per dollar.
-
Run Claude Code on Sonnet and keep Opus on call as an advisor
You don't need the expensive model on every turn. With Claude Code's advisor tool, a Sonnet main session does the work and consults Opus only before it commits to a plan, when an error keeps coming back, and before it says it's done.
-
Run checkable tasks at low effort first, and re-run only the failures at high
If tests can tell you whether a task worked, a fixed high-effort setting is the expensive option. A low-effort first pass plus a high-effort retry on the failures solved slightly more tasks at a little over half the cost in Anthropic's measurements.
-
Your prompt cache dies after 5 idle minutes: use the 1-hour TTL for slow agent loops
Anthropic's default prompt cache lasts 5 minutes from the last request. Pauses for reviews, CI runs or long subagent work quietly turn cheap cache reads into full-price re-reads.
-
Don't start coding agents in Downloads: scan for stray AGENTS.md files first
Coding agents load instruction files from the folder you start them in and its parents. A dropped AGENTS.md or CLAUDE.md in Downloads or your home folder becomes the agent's orders.
-
Keep the prompt prefix byte-stable so cache hits survive
Prompt caches match on an exact prefix. A timestamp, a rotating session id, or dynamic tools at the top of the system prompt quietly forces a full-price rebuild on every call.
-
Don't preload every MCP schema into the agent session
A hundred MCP tools can cost 50–70K tokens of schema before the first prompt, and that tax is re-sent every turn. Expose tools through a CLI or tool-search so the model loads only what it needs.
-
Stop paying for computer-use loops: have the agent write a CLI for the site's HTTP calls
If your agent drives a browser over and over to read the same site, have it reverse-engineer the requests behind the page once and wrap them in a small CLI. Each run after that is a fast, deterministic call instead of an LLM re-reading the page.
-
Codex subagents inherit your whole context by default. Ask for a fresh one
In Codex's current multi-agent tool, a spawned subagent gets the parent's full history unless the model passes fork_turns "none". For reviewers and spec checkers that defeats the point of a subagent, so put "fresh context window" in your instructions.
-
Audit your agent rules files for instructions written for older models
CLAUDE.md files, skills and custom commands pile up rules meant for older models, plus dead paths and instructions that contradict each other. Claude Code's /doctor prompt-audit finds them and changes nothing until you approve.
-
One rules file for every coding agent: AGENTS.md plus a one-line import
Teams that mix Claude Code, Codex, Cursor and Copilot end up with drifting instruction files. Keep the rules in AGENTS.md and have CLAUDE.md import it.
-
Push noisy side-work into subagents to keep the main context clean
Searching a codebase, reading logs and running test suites flood the context window with text you never look at again. Delegate them to a subagent that returns only a summary.
-
Give your coding agent a way to check its own work
An agent that can run the tests, hit the endpoint, or open the page will catch its own mistakes before you do. Make verification part of the prompt, not an afterthought.
No tips with this tag yet.
Follow along: Tips RSS feed