Group loop_claude's modules into claude_code, claude_runs and project, and move the findings document beside larv-review

This commit is contained in:
2026-09-28 21:28:41 +02:00
parent 6a1a1d9027
commit 998cc3ac85
26 changed files with 39 additions and 35 deletions
+40
View File
@@ -0,0 +1,40 @@
import dataclasses
import os
import pathlib
import shutil
import sys
import uuid
from loop_claude.project.checkout import project_name
from loop_claude.claude_code.formats import session_files, transcript_path
NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec")
@dataclasses.dataclass(frozen=True)
class Session:
id: uuid.UUID
name: str
projects: pathlib.Path
def session_for(root, 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_name(root, paths.code)} loop-claude"
return Session(uuid.uuid5(NAMESPACE, name), name, paths.projects)
def transcript_file(session):
return transcript_path(session.projects, session.id)
def delete_session(session):
path = transcript_file(session)
if not path:
return
for sibling in session_files(path):
try:
shutil.rmtree(sibling) if os.path.isdir(sibling) else os.remove(sibling)
except OSError as failure:
print(f"could not remove {sibling}: {failure}", file=sys.stderr)