Rename Paths.projects and Session.projects to claude_code_transcripts #125

Manually merged
lilleman merged 2 commits from transcript-dir-name into rebuild 2026-09-29 10:39:52 +02:00
4 changed files with 9 additions and 10 deletions
+3 -3
View File
@@ -23,9 +23,9 @@ def locations(home):
return home / ".claude.json", home / ".claude" / "cache" / "model-catalog", home / ".claude" / "projects"
# <projects>/-home-me-code-log/<session id>.jsonl
def transcript_path(projects, session_id):
hit = glob.glob(os.path.join(glob.escape(str(projects)), "*", f"{session_id}.jsonl"))
# <claude_code_transcripts>/-home-me-code-log/<session id>.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 ""
+3 -3
View File
@@ -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):
+3 -3
View File
@@ -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,
)
-1
View File
@@ -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.