Skip to Content
Components

Reasoning trail

The agent's plan, notes, sources or edits, under a header it can fold away.

A reasoning trail is the structured record the agent leaves after it thinks: a plan it works through, the notes it took, the sources it read, or the edits it made. Pick what it shows with view. The header counts the seconds and shimmers while the run is live, folds the trail away, and settles on "Reasoned for Ns" once it finishes.

Preview
Open the onboarding fileWorking
Compare it with the design systemNext
Find spacing that breaks the 8px gridNext
Draft fixes for reviewNext

Usage

<!-- include core.css + reasoning-trail.css -->
<div class="rtr panel">
  <button class="rtr-h" aria-expanded="true">
    <span class="think on rtr-mark"><i></i><i></i><i></i><i></i></span>
    <span class="rtr-title shim">Reasoning</span>
    <span class="rtr-time num muted">0s</span>
    <svg class="i xs rtr-chev"><use href="#i-chev-d"/></svg>
  </button>
  <div class="fold rtr-fold"><div><div class="rtr-body"></div></div></div>
</div>

Properties

NameTypeDescription
runningbooleanShimmers the title and counts the seconds while true.
secondsnumberSeconds to show. Leave it out to let the trail count while it runs.
titlestringHeader text. Defaults to "Reasoning" while running and "Reasoned for Ns" after.
planPlanStep[]The plan. Each step has a label, an optional detail, and a state of done, now or next.
notesstring[]The agent's notes, one per line.
sourcesSource[]The files and links it read. Each has a label, an optional kind, and an optional tip.
editsEdit[]The changed files. Each has a file, an optional detail, and removed and added lines.
viewplan | notes | sources | editsWhich part to show. Leave it out to start on the first one there is.
openbooleanWhether the trail is open. Leave it out to let the header toggle it.
barebooleanSits flat in a chat thread (the default). Set false to give it a card of its own.
onViewChange / viewChangecallbackFires when the shown view changes.
onOpenChange / openChangecallbackFires when the trail opens or folds.

Theming

Works in light and dark (data-theme="dark") and in the Soft style (data-style="soft"). In Blueprint the header, chips and edit blocks are squared off with hairline edges; in Soft they are rounded. The timeline rail, the pulse on the current step, and the shimmer on the title all take their colors from the tokens; added and removed lines use the add and remove colors.

On this page