---
name: trajectory-review
description: Review how an agent reached its result, not only whether the result passed, covering tools called, detours, unverified assumptions and wasted round trips, and turn the findings into concrete harness or prompt fixes. Use after an agent task finishes or fails, when an eval task flips, or when asked to look at the process behind a result.
title: trajectory-review
canonical_url: https://skilld.dev/gh/minimax-ai/mcode-stack/trajectory-review
last_updated: 2026-10-29T09:48:02.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install minimax-ai/mcode-stack/trajectory-review`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/trajectory-review`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/minimax-ai/mcode-stack/trajectory-review) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/trajectory-review`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/trajectory-review --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/trajectory-review --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Trajectory Review

A passing result can hide a fragile process: an assumption that happened to
hold, a lucky retry, ten round trips where two would do. A failing result
usually has its cause several steps before the error. Review the path, not
only the end point.

## 1. Get the real trajectory

Use the actual record of the run: the session transcript, tool-call log, or
eval trace. Note the model, settings and repository state. Do not reconstruct
the run from memory.

## 2. Walk it step by step

Build a compact timeline. For each step: what the agent intended, which tool
it called with which key arguments, what came back, and what it decided next.

While walking, mark:

- **Unverified assumptions.** The agent states or acts on something it never
  checked ("callers already validate this", "the test passes").
- **Detours.** Loops, repeated searches with changing keywords, re-reading the
  same file, retries without a change in approach.
- **Wrong tool or wrong arguments.** Including tools it could not find.
- **Context waste.** Large outputs pulled in and never used, polling instead of
  waiting for a notification.
- **Missed signals.** Errors, warnings or test failures it saw and ignored.
- **Instruction drift.** Earlier constraints it later broke, often after
  compaction.

## 3. Find the first point where it went wrong

For a failure, find the earliest step after which success became unlikely.
For a pass, find the riskiest step: where a slightly different input would
have broken it.

## 4. Turn findings into fixes

Map each finding to the cheapest durable fix:

| Finding | Typical fix |
| --- | --- |
| Assumption never checked | A verification step in a skill or project rules |
| Could not find or picked the wrong tool | Tool description, naming or grouping (see `tool-budget-audit`) |
| Lost an earlier constraint | Write it into a file the agent reloads (see `long-session-check`) |
| Polling or waiting idle | Background tasks with notification (see `long-command-check`) |
| Repeated per-turn overhead | Context injection review (see `context-tax-audit`) |
| Model limitation | Record it; re-check after the next model upgrade |

Keep one-off quirks out of project-wide rules. Only propose a rule for
something that has happened more than once or caused real damage.

## 5. Confirm

A fix is a harness change, so check it with `harness-experiment`: rerun the
same task several times and compare the trajectory, not only the outcome.

## Output

The compact timeline with marked steps, the first wrong (or riskiest) step,
and a short list of proposed fixes, each tied to a specific step.
