Move the Claude Code internals from --help beside the modules relying on them

This commit is contained in:
2026-09-28 16:52:30 +02:00
parent 1be6ae8187
commit 44cf712dc8
8 changed files with 8 additions and 14 deletions
+2
View File
@@ -27,6 +27,7 @@ def session_for(root, paths):
def transcript_file(session):
# Where Claude Code 2.1.282 writes a session's transcript.
hit = glob.glob(os.path.join(glob.escape(str(session.projects)), "*", f"{session.id}.jsonl"))
return hit[0] if hit else ""
@@ -35,6 +36,7 @@ def delete_session(session):
path = transcript_file(session)
if not path:
return
# Claude Code 2.1.282 also keeps a <id>/ folder and <id>.superseded-*/ and <id>.orphaned-*.jsonl siblings.
for sibling in glob.glob(glob.escape(path.removesuffix(".jsonl")) + "*"):
try:
shutil.rmtree(sibling) if os.path.isdir(sibling) else os.remove(sibling)