diff --git a/bin/loop_claude/claude_code/formats.py b/bin/loop_claude/claude_code/formats.py index aa79a2a5..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(projects, session_id): - hit = glob.glob(os.path.join(glob.escape(str(projects)), "*", 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 3c9f09e6..2ffe5d8b 100644 --- a/bin/loop_claude/claude_code/session.py +++ b/bin/loop_claude/claude_code/session.py @@ -13,19 +13,19 @@ NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec") @dataclasses.dataclass(frozen=True) class Session: id: uuid.UUID + claude_code_transcripts: pathlib.Path name: str - projects: pathlib.Path 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), name, paths.projects) + return Session(id=uuid.uuid5(NAMESPACE, name), claude_code_transcripts=paths.claude_code_transcripts, name=name) def transcript_file(session): - return transcript_path(session.projects, 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 ba1153bb..6f670603 100644 --- a/bin/loop_claude/paths.py +++ b/bin/loop_claude/paths.py @@ -7,21 +7,21 @@ 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 code: pathlib.Path model_catalog: pathlib.Path models_file: pathlib.Path - projects: pathlib.Path def paths_from(home, env): claude = home / ".claude" - claude_json, model_catalog, projects = 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, code=home / "code", model_catalog=model_catalog, models_file=claude / "loop-claude-models.json", - projects=projects, ) diff --git a/todo.md b/todo.md index 60784561..cf887786 100644 --- a/todo.md +++ b/todo.md @@ -8,7 +8,6 @@ The rebuild lifts every dimension, one chunk per item, until the last item opens The places the panel on `rebuild` at 7f9de5c named (`docs/decisions.md`), capping dimension first: -- **Give `project` one meaning: rename `Paths.projects` and `Session.projects` for Claude Code's transcript directory.** Two seats: it also names the package, the key and `~/.claude.json`'s object. - **Name `human.py` for the exit-2 stops it holds.** One seat looked there for the prompts, which live in `models.py` and `interrupt.py`. - **Score `rebuild` with the four-seat panel at 7.0 or above on every dimension and the overall, none below the last run, and open its PR into main for the human.** ⚠️ Leave that PR ready and unmerged: only the human merges it, after approving the whole rebuild. A dimension under the floor gets its places filed above this item.