Skip to content

claude-trace --index hangs indefinitely when summarizing conversations #46

@peak-flow

Description

@peak-flow

Description

The --index command hangs when trying to call Claude CLI to generate conversation summaries.

Steps to Reproduce

  1. Have existing .claude-trace/*.jsonl log files from previous Claude CLI sessions
  2. Run claude-trace --index to generate summaries
  3. Process hangs indefinitely at "Calling Claude CLI for summarization..."

Root Cause

In apps/claude-trace/src/index-generator.ts line 239-241, the code spawns the Claude CLI process with stdin set to "pipe":

const child = spawn("claude", ["-p", prompt], {
    stdio: ["pipe", "pipe", "pipe"],
});

When stdin is set to "pipe", the Claude CLI waits for input on stdin even though the prompt is passed as a command-line argument, resulting in an indefinite hang.

Fix

Change stdin from "pipe" to "ignore":

const child = spawn("claude", ["-p", prompt], {
    stdio: ["ignore", "pipe", "pipe"], // ignore stdin, pipe stdout/stderr
});

Testing

After this change, claude-trace --index completes successfully and generates the summary files and index.html.

Environment

  • OS: macOS Sequoia 15.6.1
  • Machine: MacBook Pro (M2 Max)
  • Shell: zsh
  • Node.js: v22.20.0
  • npm: 10.9.3
  • Claude CLI: 2.0.14 (Claude Code)
  • Claude CLI Location: /opt/homebrew/bin/claude

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions