Skip to content

CLI Reference

The full command-line interface for claude-code-log. This page is generated directly from the Click command definitions in claude_code_log/cli.py, so it always matches the installed version.

Tip

You can see the same information at any time with claude-code-log --help.

claude-code-log

Convert Claude transcript JSONL files to HTML or Markdown.

INPUT_PATH: Path to a Claude transcript JSONL file, directory containing JSONL files, or project path to convert. If not provided, defaults to ~/.claude/projects/ and --all-projects is used.

Usage:

claude-code-log [OPTIONS] [INPUT_PATH]

Options:

  --version                       Show the version and exit.
  -o, --output PATH               Output destination. With a recognised file
                                  suffix (.html/.md/.markdown/.json) treated
                                  as a single output file; otherwise treated
                                  as a directory root (and now also honoured
                                  for --all-projects, where outputs land at
                                  <output>/<project>/...). Pair with --expand-
                                  paths to project back to the real on-disk
                                  tree.
  --expand-paths                  When set with --output and --all-projects,
                                  expand each project's flat encoded dir name
                                  (e.g. '-home-joe-project-A') back to its
                                  real path under <output>/. Resolves the
                                  encoded name via the cache's recorded `cwd`,
                                  falling back to a peek of the first JSONL
                                  when the cache is empty. Useful for
                                  projecting transcripts into Obsidian-style
                                  Markdown vaults.
  --filter-path TEXT              Restrict --all-projects to projects matching
                                  a path prefix. With --expand-paths, the
                                  prefix is matched against the expanded real
                                  path AND truncated from the destination
                                  (`/home/joe/project/A` with --filter-path
                                  /home/joe lands at <output>/project/A/).
                                  Without --expand-paths, matches the flat
                                  encoded dir name (e.g. '-home-joe' selects
                                  projects starting with '-home-joe-').
  --open-browser                  Open the generated HTML file in the default
                                  browser
  --from-date TEXT                Filter messages from this date/time (e.g.,
                                  "2 hours ago", "yesterday", "2025-06-08")
  --to-date TEXT                  Filter messages up to this date/time (e.g.,
                                  "1 hour ago", "today", "2025-06-08 15:00")
  --all-projects                  Process all projects in ~/.claude/projects/
                                  hierarchy and create linked HTML files
  --no-individual-sessions        Skip generating individual session files
                                  (combined transcript only). Back-compat
                                  alias for --combined only.
  --combined [yes|no|only]        Control combined-vs-individual transcript
                                  generation: 'yes' = both combined and per-
                                  session files (default for --all-projects);
                                  'no' = only per-session files (recommended
                                  for Obsidian / vault use — combined is dead
                                  weight); 'only' = only the combined file (=
                                  --no-individual-sessions). When unset,
                                  defaults to 'no' under --expand-paths
                                  (Obsidian mode), else 'yes'.
  --no-cache                      Disable caching and force reprocessing of
                                  all files
  --clear-cache                   Clear all cache directories before
                                  processing
  --clear-output, --clear-html    Clear generated output files (HTML or
                                  Markdown based on --format) and force
                                  regeneration
  --tui                           Launch interactive TUI for session browsing
                                  and management
  --projects-dir PATH             Custom projects directory (default:
                                  ~/.claude/projects/). Useful for testing.
  -f, --format [html|md|markdown|json]
                                  Output format (default: html). Supports
                                  html, md/markdown, or json.
  --image-export-mode [placeholder|embedded|referenced]
                                  Image export mode: placeholder (mark
                                  position), embedded (base64), referenced
                                  (PNG files). Default: embedded for HTML,
                                  referenced for Markdown.
  --page-size INTEGER             Maximum messages per page for combined
                                  transcript (default: 2000). Sessions are
                                  never split across pages.
  --session-id TEXT               Export a single session by ID (full ID or
                                  prefix). Project path is optional — looks up
                                  the session globally via cache.
  --detail [full|high|low|minimal|user-only]
                                  Detail level for output. full: everything;
                                  high: detailed but cleaned (no system/hook
                                  noise); low: interaction-focused + key
                                  signals; minimal: user + assistant messages
                                  only; user-only: only user prompts and
                                  steering (for feeding to downstream agents,
                                  e.g. building a requirements doc).
  --compact                       Merge consecutive same-category headings in
                                  Markdown output. Markdown-only — a no-op for
                                  HTML.
  --git-link TEMPLATE             URL template for resolving commit SHAs on
                                  forges not in the built-in map (github.com,
                                  gitlab.com, bitbucket.org). Placeholders:
                                  {host}, {path}, {sha}. Example for self-
                                  hosted GitLab: --git-link
                                  'https://{host}/{path}/-/commit/{sha}'. Can
                                  also be set via the CLAUDE_CODE_LOG_GIT_LINK
                                  env var.
  --no-timestamps                 Suppress per-message timestamp lines in
                                  Markdown output (#160). Markdown-only — a
                                  warning is emitted (but not an error) if
                                  combined with --format html / --format json.
  --debug                         Show full traceback on errors.
  --help                          Show this message and exit.