Sparround

Prompting and supplying context

Working with an agent is not about finding magic prompt words. In practice four things determine the outcome:

1. Task precision — what you want and what counts as "done".

2. Context — which files to look at, which pattern to follow.

3. Constraints — what not to touch, which library not to use.

4. A verification path — how it should confirm the result (build, test, lint).

The fourth is the most often forgotten and the most valuable: tell the agent to "run ./gradlew :app:testDebugUnitTest and fix until it is green" and it finds its own mistakes.

Anti-patternWhy it is a problemInstead
"Improve the code""Good" is not measurable — the agent makes arbitrary changes"Replace the nested ifs in this function with early returns"
Dumping the whole repo into contextSignal is diluted, cost risesNaming 2-3 relevant files
Five tasks in one promptHalf stays unfinished, review becomes hardOne task → verify → next
Fixing a wrong result by handThe cause remains — it repeats next timeRecording the cause in CLAUDE.md or a skill

Before large changes use plan mode. The agent presents a plan first, you agree, then implementation starts. That is far cheaper than changing 20 files in the wrong direction.

📚 Sources and documentation