3. On red, read only what broke. gh run view <run-id> --log-failed | tail -n 100 shows the failing step's output without twenty minutes of dependency install.
2. Block instead of polling. gh pr checks --watch (or gh run watch --exit-status) waits until the run ends and exits non-zero on failure. One tool call instead of a wake-up every minute.
1. Check the status and skip the logs. gh pr checks gives pass/fail/pending for each job. In AGENTS.md or CLAUDE.md: check CI with gh pr checks, read logs only when a job failed.
3. Has this failure ever happened? Search logs and incident notes for the error the guard prevents. If it never fired, weigh it against everyone who has to read past it every day.
Asked the agent to harden a function. Most of the diff guards against inputs that can't happen. Ask these 3 questions before you accept any of those guards:
2. Where does the data come in? Validation belongs at the boundary: request handler, queue consumer, CLI parser. One check at the edge beats five checks three layers deep.
If your agent opens every session by re-reading the same files it read yesterday, here are the 3 things to write down once so it stops paying for the same tour.
2. What not to read. Generated code, lockfiles, vendored deps, old migrations. Put them in the ignore settings your agent respects so search stops returning them.
3. Ask for the answer and its source together.
"One sentence, plus the file and line."
Once it can cite something it stops exploring, and you can check the citation in seconds.
Your agent read a whole folder to answer a yes-or-no question about your repo.
The 3 ways to phrase codebase questions so it opens the right file first:
2. Fence the search.
Name the package: "only look in services/billing". Say which folders are generated, vendored or archived.
Unless you say otherwise, a README from 2021 looks like current docs to an agent.
Your agent's context is half full and it hasn't written a line yet. Open the transcript and read the first ten tool calls. They usually land in 3 kinds of file. Here is each one, and how to fence it off:
3. Old migrations and vendored code. Years-old migrations, vendor/, third_party/. The agent treats them as current truth. Say in CLAUDE.md or AGENTS.md which folders are history.