---
url: https://docs.mochiexec.io/guides/history.md
description: >-
  Every run Mochi records, from you or an agent, plus usage-ranked search across
  every workspace, favorites, and run statistics.
---

# Run History & Search

Mochi learns what you actually run. Every run is recorded, search ranks by it, favorites
pin it, and stats show it back to you.

## Runs

Every run is kept, whether you started it in the desktop app, typed it in a terminal, or an
agent ran it over [MCP](/guides/ai#agents-and-mcp). The **Runs** page in the desktop app
lists them all, live and past, with their output.

The **Origin** column names the client that started a run (Claude Code, Cursor, Mochi's own
chat), and the **Agent runs** tab lists only those. Filter **History** by **Source**
(**CLI**, **Desktop** or **Agent (MCP)**), or by client and session.

When a run fails, open it and ask Mochi to [diagnose it](/guides/ai).

flow docs: [History & logs](https://flowexec.io/guides/execution-history)

Every run is a flow execution, and flow keeps the logs. `mochi logs` works exactly like
`flow logs`.

## Search

```sh
mochi search            # your favorites and most recent executables
mochi search deploy     # ranked matches across every workspace
```

Results are ranked by how well the name matches, whether it's a favorite, and how often
and how recently it has run. The desktop's `⌘K` palette uses the same search.

| Flag | Effect |
|---|---|
| `-n, --limit` | Maximum results (default 20) |
| `-o json` | Machine-readable output |

## Favorites

Favorites sort first and show up on the desktop home screen. They're shared between the CLI
and the desktop app.

```sh
mochi favorite add --workspace my-project
mochi favorite add --executable "build my-project/app:image"
mochi favorite list
mochi favorite remove --executable "build my-project/app:image"
```

To reorder favorites, drag them in the desktop app.

## Stats

```sh
mochi stats               # every workspace
mochi stats my-project    # one workspace
```

Shows total runs, success rates, and the busiest executables. `-n` sets how many top
executables to list, and `-o json` gives machine-readable output. A run you stopped
(Ctrl-C, or **Stop** in the desktop app) counts as canceled rather than failed, and
stays out of success rates and average durations.

The desktop's **Insights** page builds on the same numbers, and
[`mochi ai insights`](/guides/ai) turns them into recommendations.
