<!-- History and undo — Delta MCP docs · https://www.mcpdelta.com/docs/cli-history · updated 2026-10-07 -->

> Read the journal of what Delta MCP did, undo a task by its id and see what Delta MCP did in place of your AI, from a terminal.

# History and undo

Read the journal of what Delta MCP did, undo a task by its id and see what Delta MCP did in place of your AI, from a terminal.

Every change your AI makes through Delta MCP is kept as a task. The journal also records switches, kept shortcuts and connector updates. Three commands read that history from a terminal: `journal` lists what happened, `undo` puts a task back, and `gain` adds it up. The app shows the same in [Activity and Undo](https://www.mcpdelta.com/docs/activity-and-undo).

## Read the journal

```
# the last 20 entries
mcpdelta  journal
# the last 50
mcpdelta  journal  50
```

Entries come oldest first, so the newest is at the bottom. Each line gives the date and time in UTC, the type, the id of the task when there is one, a summary, and the AI app that asked:

```
2026-10-07 09:12:41  read    reads of a program · 2 reads · claude-code
2026-10-07 09:12:44  apply   d_a1b2c3 3 change(s) · claude-code
2026-10-07 09:15:02  apply   d_a1b2c3 undo of d_a1b2c3
```

The types written today are `read`, `apply`, `refuse` (a change that was not made), `switch` (moving connectors, written in French in this version), `keep` (a shortcut kept) and `update` (a connector updated). An empty journal prints `The journal is empty.`

The journal only ever grows. Each entry is linked to the one before by a hash, so an edited or removed line shows. The command does not check that chain: not yet. Values of fields named like a secret, or marked secret by the server, are hidden before an entry is written.

## Undo a task

```
# put back what the task d_a1b2c3 changed
mcpdelta  undo  d_a1b2c3
```

The id is on the task’s `apply` line in the journal, and in Activity in the app. The command prints one line per service:

```
Undo d_a1b2c3
✓ tickets: 3 object(s) back as they were (read back ✓)
✓ 1 creation(s) deleted by their inverse (not read back)
! 2 call(s) made as is can't be undone: the service offers no inverse for them.
```

Objects are written back as they were, then read back. An object that changed since is refused, never overwritten. What the task created is deleted by the connector’s own inverse tool when it has one. A call with no inverse is reported, never guessed. A task already undone says so and changes nothing.

Your command counts as your click for putting objects back. Deleting what the task created follows the connector’s mode. Under `ask` and `ask-final`, a card opens on your screen on a Mac, or a page in your browser elsewhere, and the command waits about 40 seconds for your answer. Under `readonly` the undo is refused.

`undo` exits with 1 when its output contains `✗`, or when the id is unknown or has nothing to undo. A refused undo, or one still waiting for your answer, exits with 0 and changes nothing. In a script, read the output.

## See what Delta MCP did

```
# the last 7 days
mcpdelta  gain
# the last 30 days
mcpdelta  gain  30
# since the beginning (tout, as in the French help; all works too)
mcpdelta  gain  tout
```

The first block is measured on this machine:

```
Last 7 days, measured on this machine:
  Programs your AI ran through Delta MCP: N (M stopped on an error)
  Shortcuts run again without AI: N
  Server calls made by Delta MCP: N
  Server answers read by Delta MCP: ≈ N tokens (measured; this is not a saving)
  By app: Claude Code N calls · Cursor N calls
```

A second block, `Modeled (never added to what is measured)`, estimates the tool definitions an app would load without Delta MCP. It is a ceiling: an app that loads them on demand loads fewer. The last line gives the estimate used for tokens. The tokens-saved figure of the app is not in the command: not yet.
