unflatten_session
Restores a flattened session to its original pre-flatten state by re-inlining tool results from the backup, then removes the backup.
Instructions
Reverse a flatten: re-inline every flattened tool result (text and images) back into the session JSONL from the backup, restoring the session to its pre-flatten state, then delete the backup so nothing is left behind.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| claude_dir | No | Absolute path (or ~/...) to the Claude config dir whose sessions to target — the dir holding projects/, e.g. ~/.claude-2 for a second profile. Default: $CLAUDE_CONFIG_DIR if set (so a server running inside an alternate profile targets it), else ~/.claude. | |
| session_id | Yes | Session UUID, "last", or "current" (the live session) | |
| project_dir | No | Absolute path to project. Default: the project the CLI runs in (cwd) |