Dave Ng
Projects / OpenCode practice

Trace review and continuous improvement.

How I use real OpenCode sessions to find workflow problems, make small changes, and check whether the next run improves.

Back to the OpenCode case study

The review loop

Start with what the agent did.

A trace is a record of a session’s decisions, tool calls, and handoffs. I compare that record with the task I gave the agent and the result it produced. I look for the first decision that sent the work off course.

  1. Observe a real run

    Pick a run with a clear outcome. Note where the work stopped, what the session asked me to decide, and whether the next agent had what it needed.

  2. Find the cause

    Check what the agent knew at that point. Was the rule unclear, was context missing, or did the tool or environment prevent the right action? A bad outcome alone does not tell me which part to change.

  3. Make the smallest change

    Fix the rule where it belongs. Remove conflicting copies. If the rule was already clear and the agent simply missed it, I do not add a new rule by default.

  4. Check the next comparable run

    Record the result I expect before the run. Then see whether the agent makes the right decision, finishes the work, and needs less intervention. Keep safeguards that protect the result.

An observed example

Separate checkouts did not stop cross-checkout reads.

What I saw

An implementation session needed an agreed spec. It read files from another session’s worktree, a separate checkout of the same repository. I saw reads, not edits. The risk was using a draft that could change during the task.

What I changed

The session now has a clear instruction: read committed files through Git from its own checkout. Do not inspect another session’s live files. Cleanup of completed checkouts stays a separate, scoped task.

What would confirm the fix: In the next comparable run, the agent finds the correct committed spec and continues without opening the other checkout or asking me for access. The config change is in place. That live result is not yet confirmed here.

Evidence

Check the outcome and the effort it took.

Did the change land with the evidence it needed? How many times did I have to step in? Did the agent repeat a check without learning anything new? Compare similar tasks and record the config revision, model, and environment when those differences could affect the result.

A static check can confirm that the rule and its references are present. A repeatable agent evaluation can test a specific decision. A live run shows whether the handoff works when the team is doing real work. I keep these forms of evidence separate.

This follows the same idea as Toyota’s “go and see” practice: observe the work before changing the process. In agent engineering, Anthropic’s evaluation guide recommends starting with real failures and turning them into repeatable checks.