From f602b94aff4e99ece84752aee57c42eeb35b4009 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 29 Sep 2026 10:38:47 +0200 Subject: [PATCH] Name the field claude_code_transcripts and build Session by keyword --- bin/loop_claude/claude_code/formats.py | 6 +++--- bin/loop_claude/claude_code/session.py | 6 +++--- bin/loop_claude/paths.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/loop_claude/claude_code/formats.py b/bin/loop_claude/claude_code/formats.py index 5b91ab24..635bf494 100644 --- a/bin/loop_claude/claude_code/formats.py +++ b/bin/loop_claude/claude_code/formats.py @@ -23,9 +23,9 @@ def locations(home): return home / ".claude.json", home / ".claude" / "cache" / "model-catalog", home / ".claude" / "projects" -# /-home-me-code-log/.jsonl -def transcript_path(claude_transcripts, session_id): - hit = glob.glob(os.path.join(glob.escape(str(claude_transcripts)), "*", f"{session_id}.jsonl")) +# /-home-me-code-log/.jsonl +def transcript_path(claude_code_transcripts, session_id): + hit = glob.glob(os.path.join(glob.escape(str(claude_code_transcripts)), "*", f"{session_id}.jsonl")) return hit[0] if hit else "" diff --git a/bin/loop_claude/claude_code/session.py b/bin/loop_claude/claude_code/session.py index 2b87dfeb..2ffe5d8b 100644 --- a/bin/loop_claude/claude_code/session.py +++ b/bin/loop_claude/claude_code/session.py @@ -13,7 +13,7 @@ NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec") @dataclasses.dataclass(frozen=True) class Session: id: uuid.UUID - claude_transcripts: pathlib.Path + claude_code_transcripts: pathlib.Path name: str @@ -21,11 +21,11 @@ def session_for(project, paths): """Exists while its transcript does.""" # "A " is the human's cue in the session picker that the session is the loop's. name = f"A {project} loop-claude" - return Session(uuid.uuid5(NAMESPACE, name), paths.claude_transcripts, name) + return Session(id=uuid.uuid5(NAMESPACE, name), claude_code_transcripts=paths.claude_code_transcripts, name=name) def transcript_file(session): - return transcript_path(session.claude_transcripts, session.id) + return transcript_path(session.claude_code_transcripts, session.id) def delete_session(session): diff --git a/bin/loop_claude/paths.py b/bin/loop_claude/paths.py index 6e0995f3..6f670603 100644 --- a/bin/loop_claude/paths.py +++ b/bin/loop_claude/paths.py @@ -7,8 +7,8 @@ from loop_claude.claude_code.formats import locations @dataclasses.dataclass(frozen=True) class Paths: archive: pathlib.Path + claude_code_transcripts: pathlib.Path claude_json: pathlib.Path - claude_transcripts: pathlib.Path code: pathlib.Path model_catalog: pathlib.Path models_file: pathlib.Path @@ -16,11 +16,11 @@ class Paths: def paths_from(home, env): claude = home / ".claude" - claude_json, model_catalog, claude_transcripts = locations(home) + claude_json, model_catalog, claude_code_transcripts = locations(home) return Paths( archive=pathlib.Path(env["LOOP_CLAUDE_TRANSCRIPTS"]).expanduser() if env.get("LOOP_CLAUDE_TRANSCRIPTS") else claude / "loop-claude-transcripts", + claude_code_transcripts=claude_code_transcripts, claude_json=claude_json, - claude_transcripts=claude_transcripts, code=home / "code", model_catalog=model_catalog, models_file=claude / "loop-claude-models.json",