Skip to content

(Claude) --no-cache writes no session pages, but the index links them #406

Open

Description

@cboos

A directory conversion with --no-cache and no date window writes the combined page and no session page, while the index links each session's page. Every such link is dead.

Reproduce

Two sessions in one project, an all-projects run without the cache:

import os, tempfile
from pathlib import Path
from claude_code_log.converter import process_projects_hierarchy
from test.test_date_filtered_runs import _append, _turn

tmp = Path(tempfile.mkdtemp())
os.environ["CLAUDE_CODE_LOG_CACHE_PATH"] = str(tmp / "cache.db")
mixed = tmp / "projects" / "-mixed"
mixed.mkdir(parents=True)
_append(mixed / "s-day1.jsonl", _turn("s-day1", 0, 1, "ONLY-DAY-ONE"))
_append(mixed / "s-day2.jsonl", _turn("s-day2", 0, 2, "ONLY-DAY-TWO"))
process_projects_hierarchy(tmp / "projects", jobs=1, use_cache=False)
print(sorted(p.name for p in mixed.glob("session-*")))
print("session-s-day1.html" in (tmp / "projects" / "index.html").read_text(encoding="utf-8"))

On main e5301df (2026-11-08) this printed [] and True: no session page, and the index links session-s-day1.html. No cache.db was created. claude-code-log <projects> --no-cache takes the same path.

Cause

_generate_individual_session_files (claude_code_log/converter.py) writes a page only for a session that has a cache row (session_ids & set(session_data.keys())), and it reads the rows from the cache alone. With no cache there are no rows, so it writes no page. The index builds its session list from the messages instead, so it lists every session.

Possible fix

Without a cache, give the writer rows computed from the load (_build_session_data_from_messages), as a date-filtered run does since #403 (_window_session_rows). That changes the output of every --no-cache directory run: session pages are written that were not before, so the run writes more files and takes longer. It needs a test of that, and a check of what the snapshot tests cover.

🤖 Generated with Claude Code

Activity

  1. added
    bugSomething isn't working
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions