# Memo

> Browse past Claude Code sessions as an HTML viewer — the Bash scripts Claude ran, why it ran them (description + thinking), and whether each worked or failed, grouped by session. Can also list sessions in the terminal and produce a compact markdown digest of one past session to load as context into the current session. Use when the user wants to find/recover a command from an earlier session, review what was run, see which scripts failed, list their past sessions, or pull a past session's context into this one. Triggers — "what did claude run", "find that script from earlier", "show my claude history", "which commands failed", "list my sessions", "load that session", "recall the session where I set up X", "summarize my last session".

- Skill: `samidghim/memo` (Agent Skill)
- Install (CLI): `npx skillmds@latest add samidghim/memo`
- Raw SKILL.md: https://api.skillmd.com/api/skills/samidghim/memo/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: SamiDghim (https://skillmd.com/u/samidghim)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/samidghim/memo

---


# Memo Viewer

Reads the local Claude Code transcripts in `~/.claude/projects/` — every session's
Bash commands, reasons, thinking, pass/fail status, and cost, plus the skills/subagents
each session used.

## Commands at a glance

| Command | Use when the user wants to… | Output |
|---|---|---|
| `memo` (`generate`) | browse history visually | HTML page (opens in browser) |
| `memo list` | see *which* sessions exist | terminal listing — return the text |
| `memo digest` | recall / carry a past session into this one | markdown primer — return the text |

Pick the one matching intent; details for each below. All three accept the same
scoping flags (`--here`, `--project`, `--days`, `--failed-only`, `--limit`, `--source`).
Run from the user's current directory; default to `--here` to scope to their project.

## How to run

**Run from the user's current directory (do not `cd` elsewhere).** By default,
scope to the project the user is currently in with `--here` — it keeps only
sessions whose working directory is the current project (or a subdirectory):

```bash
memo --open --here
```

If `memo` isn't on `PATH`, the module form works from any directory once the
package is pip-installed:

```bash
python3 -m memo --open --here
```

> `--here` keys on the **current directory** — so it must run from the user's
> project root (where their Claude Code session is working), not from memo's own
> repo. That's why there's no `cd` above.

### Narrowing

`--here` is the default scoping. Combine or replace it as the user asks:

- **All projects** (not just the current one) → drop `--here`: `memo --open`
- A different/named project → `--here <DIR>` or `--project <substring-of-cwd>` (e.g. `--project quizlab`)
- Only sessions with failures → `--failed-only`
- Recent activity only → `--days <N>` (e.g. `--days 7`)
- Most recent N only → `--limit <N>`
- A specific AI tool → `--source claude|copilot|codex|gemini|cursor` (repeatable; default: all)
- Custom output path → `--out <path>` (default `dist/index.html`)

Example — "failed commands from the last week in this project":

```bash
memo --open --here --failed-only --days 7
```

## After running

Report the output path and the session/command counts the tool prints. The page
opens in the browser with live search, source/project filters, a "failed only"
toggle, expandable sessions, a 💰 Cost page, and per-project skills/subagents.
The tool does all the parsing — do not parse the JSONL yourself.

Note: Claude's `thinking` text is only sometimes persisted in transcripts; when it is
cached/absent the viewer omits it (the per-command `description` is the reliable "why").

## List — see the sessions for this project

When the user wants to *see which* past sessions exist (rather than open the HTML),
use the `list` subcommand. It prints one newest-first row per session — short id,
date, command/fail counts, and title — straight to the terminal. Return that text;
don't open a browser.

```bash
# Sessions for the current project:
memo list --here

# Across all projects, last 7 days, failures only:
memo list --failed-only --days 7
```

Each row leads with a short session-id prefix that `memo digest <prefix>` accepts,
so `list` then `digest` is the natural pair: list to find the session, digest to
pull it into the current conversation.

## Digest — load a past session into this one

When the user wants to *recall* or *carry over* what happened in an earlier session
(not browse the HTML), use the `digest` subcommand. It prints a compact markdown
primer — goal, key decisions, the commands that ran (and which failed), and files
touched — small enough to drop straight into the current conversation as context.
The subcommand's output is the primer; return it to the user / read it into context
rather than opening a browser.

```bash
# Most recent session in the current project:
memo digest --here --last

# A specific session by a substring of its title (newest match wins).
# Put the selector FIRST, before --here, so it isn't read as --here's directory:
memo digest "auth refactor" --here

# A specific session by id, across all projects:
memo digest 0c1f2e3a-....
```

All `generate` filters apply (`--here`, `--project`, `--days`, `--source`, …) to
narrow which sessions are candidates. Add `--out <path>` to write the markdown to a
file instead of stdout.

> Gotcha: `--here` takes an optional directory, so `memo digest --here "auth"` reads
> `"auth"` as the directory. Always pass the title selector *before* `--here` (or use
> `--project <substr>` instead, which has no such ambiguity).

This complements — it does not replace — Claude Code's native `claude --resume <id>`:
resume re-enters the whole old conversation (and its full context); a digest is a
small one-time snapshot you pull into a *different* session.

