Skip to content

Agent tips

The words that get coding agents to do what you mean. Each one comes with a prompt swap: what people usually type, and what to say instead.

Context

What the agent can see, and how long it remembers it.

Context window#

Context

noun

Everything the model can see at once: your messages, the files it read, tool output. Past the limit, older parts get dropped or summarized.

Instead of: Remember what we changed earlier?

Say: Re-read src/lib/content.ts before you edit it. Don't rely on what you saw earlier.

Context window0k / 200k

  • System0k
  • Tools0k
  • MCP0k
  • Skills0k
  • Memory0k
  • Messages0k

NOTES.md in memory · decision: use Pagefind

      Illustrative numbers.

      Compaction#

      Context

      noun

      When a session gets long, the harness summarizes older turns to free up space. Details you didn't write down can get lost.

      Instead of: Keep going.

      Say: Before we compact, write the open decisions and next steps to NOTES.md.

      Grounding#

      Context

      noun

      Pointing the agent at a real source, like a file, a doc page or an error, instead of letting it answer from memory.

      Instead of: How does the Astro content API work?

      Say: Check the Astro docs on content collections first, then answer and link the page.

      Harness

      The tool around the model, and the pieces you plug into it.

      Harness#

      Harness

      noun

      The program that runs the model in a loop with tools: Claude Code, Codex, Cursor. Same model, different harness, different results.

      Instead of: Can the AI run my tests?

      Say: Run pnpm test and fix the first failure. Show me the output before and after.

      Skill#

      Harness

      noun

      A folder with instructions (a SKILL.md) that the agent loads only when the task matches its description. It costs almost nothing until it's needed.

      Instead of: Always remember to check for existing helpers.

      Say: Use the brainstorming skill before you change anything.

      Slash command#

      Harness

      noun

      A saved prompt you run by name, like /pr-description. Same words every time, no retyping.

      Instead of: Write a PR description like you did last time.

      Say: /pr-description

      Hook#

      Harness

      noun

      A script the harness runs on an event, like after a file edit or when the agent stops. A rule the model can't forget, because the model isn't the one enforcing it.

      Instead of: Please always run the linter.

      Say: Add a hook that runs pnpm lint after every file edit.

      Subagent#

      Harness

      noun

      A separate agent with its own fresh context, sent to do one piece of work and report back. Keeps the main conversation small.

      Instead of: Look through the whole codebase and tell me everything.

      Say: Send a subagent to find every caller of formatDate. Report file and line only.

      Main conversation18k tokens

      Subagent, fresh context0k tokens

        Illustrative numbers.

        Workflow

        How work gets split, handed off and checked.

        Handoff brief#

        Workflow

        noun

        The note you give another agent: the goal, the files, what done looks like, and when to stop. The brief decides the result more than the model does.

        Instead of: Fix the search thing.

        Say: Goal: search skips list pages. File: BaseLayout.astro. Done when /workflows/steps/ is not a result. Stop if the index format has to change.

        Spike#

        Workflow

        noun

        A quick throwaway build to learn one thing. No tests, no polish, deleted afterwards.

        Instead of: Build the feature.

        Say: Spike this in a scratch file, under 30 lines. We'll throw it away after.

        Root cause#

        Workflow

        noun

        Why a bug happens, as opposed to where it shows up. Fix the cause and every place it shows up is fixed too.

        Instead of: Make the error go away.

        Say: Find why this value is null before patching anything. List every caller first.

        Second-model review#

        Workflow

        noun

        A code review by a different model from the one that wrote the code. The builder shouldn't mark its own work.

        Instead of: Is this secure?

        Say: You didn't write this change. Find ways to abuse it, then show me the steps to reproduce each one.

          Shipped. Nobody else looked.

          GPT Sol 6.1max

          Found: usage credits can be abused by switching workspaces.

          Fixed. The abuse steps no longer work.

          Illustrative numbers.

          Prompting

          Words that make a request precise.

          Stop condition#

          Prompting

          noun

          The point where the agent should stop and ask you instead of pushing on.

          Instead of: Do whatever it takes.

          Say: If the fix touches more than two files, stop and show me the plan first.

          fix the date bug in formatDate

          0 tool calls

          Paused. 4 more files would change. Plan first?StopShow plan

          Illustrative numbers.

          Acceptance criteria#

          Prompting

          noun

          How you'll know the work is done, written down before it starts.

          Instead of: Make it better.

          Say: Done when no page scrolls sideways at 375px wide and the build passes.

          Cost

          Where the tokens go.

          Input tokens#

          Cost

          noun

          Everything you send the model: messages, files, tool results. On long sessions this is usually most of the bill.

          Instead of: Read the whole repo.

          Say: Read only src/components and src/lib.

          Output tokens#

          Cost

          noun

          What the model writes back. There are fewer of them, but each one costs more than an input token.

          Instead of: Explain everything in detail.

          Say: Answer in three lines. Code only, no walkthrough.

          Cache read#

          Cost

          noun

          Input the provider saw recently and charges much less for. Prompts and files that stay the same hit the cache. Reworded ones don't.

          Instead of: Here's the project context again, written differently.

          Say: Keep the same project notes at the top of every session.

          Ready

          Turn 1
          Turn 2
          Turn 3
          Turn 4

          cache read, cheapfresh inputbilled $0.00

          Illustrative numbers.