Move the Claude Code internals from --help beside the modules relying on them
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user