Skip to content

Windows: projectTranscriptDir mis-encodes cwd (backslash/colon/space) #46

Description

@Reapper-Stack

Bug

On Windows, /cco-overhead (and any command using projectTranscriptDir) reports "No session transcripts found" even when transcripts exist. It looks in a malformed path, e.g.:

Looked in: C:\Users\User\.claude\projects\C:\Program Files\Git

The real transcript folder is ...\projects\C--Program-Files-Git.

Root cause

src/overhead.js:

export function projectTranscriptDir(cwd) {
  return join(homedir(), ".claude", "projects", cwd.replace(/[/.]/g, "-"));
}

The regex only replaces / and .. On Windows the cwd contains \, :, and spaces (e.g. C:\Program Files\Git), which Claude Code's own transcript-folder naming also converts to - (giving C--Program-Files-Git). Since those chars are not replaced, the path stays malformed and no transcripts are found. This also silently breaks the MEMORY.md / CLAUDE.md itemization (same helper), so everything is lumped into the "system prompt/tools/MCP" line.

Fix

Broaden the character class to match Claude Code's folder encoding:

return join(homedir(), ".claude", "projects", cwd.replace(/[/.:\\ ]/g, "-"));

C:\Program Files\Git becomes C--Program-Files-Git. (The helper appears duplicated across other command scripts - worth a shared util fix.)

Workaround

Pass a transcript path directly, which bypasses the folder scan:

node src/overhead.js <path-to-a-session>.jsonl

Env

Windows 11, Claude Code 2.1.198, cco 4.3.0, Node 24.

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