fix(agents): claude reports what still carries the uuid (Issue #31)

claude had no residual_artifacts, so a purge always printed `residual: none`.
It now reports names holding the uuid under ~/.claude (projects excluded),
in projects two levels deep, in the tmp roots, plus the owned jobs dir and
session files. Shared files (history.jsonl, ~/.claude.json) are not
reported: they always mention every session. scan_names goes to base.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Opus 5.5 committed 2026-10-15 15:16:06 +00:00
1 parent 9ccd3c1835
commit 366da3b3d6
2 files changed
+51 -1

No files matched your search

+16
View File
@@ -91,6 +91,22 @@ def _plausible_id(uuid: str) -> bool:
return isinstance(uuid, str) and bool(uuid.strip(".")) and not any(s in uuid for s in ("/", "..", "*"))
def scan_names(root: str, uuid: str, skip=()) -> list:
"""Paths under `root` whose name carries `uuid` (Issue #31). A matched
directory is reported whole and not descended; `skip` dirs are not walked."""
if not _plausible_id(uuid) or not os.path.isdir(root):
return []
skip_real = {os.path.realpath(s) for s in skip if s}
found = []
for dirpath, dirnames, filenames in os.walk(root):
for name in dirnames + filenames:
if uuid in name:
found.append(os.path.join(dirpath, name))
dirnames[:] = [d for d in dirnames if uuid not in d
and not (skip_real and os.path.realpath(os.path.join(dirpath, d)) in skip_real)]
return sorted(found)
class SpawnSpec:
def __init__(self, agent_name: str, session_name: str, command: str, env: Optional[Dict[str, str]] = None):
self.agent_name = agent_name