Mikie / Guides

How to avoid repeated AI code reads

Stop unnecessary repeat file reads with anchored context, targeted searches, change-aware refreshes, and useful tool output.

Technical guide6 min readUpdated
Select relevant code from a repository, then use it for a focused coding task.REPOSITORYFOCUSED TASK
Less to read. More to work with.

The quick answer

Avoid repeat reads with a small source map, line anchors, and refreshes of changed regions. Search the next unresolved symbol instead of scanning the whole repository. Keep dependencies and exact failures needed for the patch.

Distinguish refreshes from repeat scans

Rereading an edited function can be necessary. Reopening untouched directories before each decision often indicates a lost source map. Ask what new fact the read will resolve.

Keep entry points, callers, tests, and anchors to preserve navigation without every file.

Distinguish refreshes from repeat scans: practical comparison
ReadAction
Edited functionRefresh current code
New callerRead the concrete dependency
Untouched anchored sourceReuse unless assumptions changed
Repository dump for known bugStart at failing behavior

Keep a small source map

Record the task, entry point, dependencies, and proof command. Add a dependency when the patch reveals it. This supports navigation without repeating discovery.

Example source map
Task: duplicate notifications.
Entry: enqueue handler.
Related: deduplication key and delivery worker.
Tests: idempotency and retry behavior.
Refresh: functions changed by the patch.
Expand: another consumer if signature changes require it.

Bound output to its question

Search matching symbols and lines first. Keep full logs locally, summarize passes, and preserve exact failures with relevant traces. Narrow many matches to the actual subsystem or caller.

Retain required imports and type context. Short output helps only if the agent can still debug the behavior.

  • Search known scope first.
  • Read code and required types.
  • Return actionable failures.
  • Summarize routine passes.

Repair the missing fact

Check for omitted callers, changed goals, and stale summaries when reads repeat. Add the gap explicitly. If the context is right, make the next follow-up carry a decision and finish line.

Compare accepted patches, not transcript length alone.

  • Every read has a question.
  • Current source replaces stale facts.
  • Dependencies remain visible.
  • Verification proves the patch.
A targeted follow-up
The key builder changed. Read current code and its retry test. Reuse handler constraints. Check the worker still passes the same key; inspect callers if that path changed.

Put it into practice

  1. Find the repeated read pattern.
  2. Keep an anchored source map.
  3. Refresh changes and concrete dependencies.
  4. Verify the patch and compare repetition.
Where workflow changes make a difference
AreaWhat it meansWho controls it
RetrievalEach read answers a question.Your workflow
ReuseReuse valid facts until source changes.Your workflow
OutputReturn useful matches and actionable failures.Your workflow
FreshnessRefresh changed source before relying on it.The provider or measurement
DependenciesRetain necessary callers and constraints.The provider or measurement

How Mikie helps

Mikie provides ranked targets and line-anchored packets. Use the packet as a source map, request focused follow-ups, and refresh code when the task or source changes.

See the setup and workflow →

Sources

  • OpenAI ↗

    Goals, relevant context, output requirements, and task boundaries.

  • Anthropic ↗

    Verification, focused sessions, /clear, and /compact.

Provider plans and prices can change. Source dates show when this guide was checked. How Mikie measures results.

Common questions

Why does Codex reread files?

Tasks or source may have changed, or a source map may be missing. Inspect the actual pattern and provide necessary anchors.

Should I prevent all rereads?

No. Refresh changed code and new dependencies; remove reads resolving no new question.

How does Mikie help?

It supplies ranked targets and focused anchored context. Reuse valid anchors and refresh relevant code when it changes.

Put better context to work.

Keep your coding agent. Give it a clearer view of the code it needs.

Set up Mikie →