Expand description
Inventory enumeration: turn the fixed target-root list into hashed
PathEntry rows.
§Target roots
Hard-coded list in target_roots. Two classes:
- Home-rooted — Claude Code config / skills / agents / plugins
under
crate::Paths::user_homejoined with.claude/, and<user_home>/.claude.json. - Project-rooted —
.claude/settings.json,.mcp.json, dependency manifests + lockfiles,.envresolved relative to the current working directory.
Missing targets are silently skipped (no error). Directories are walked
recursively, with SKIP_DIRS / SKIP_FILES noise filtered out.
Symlinks are not followed.
§~/.claude.json decomposition
path_entries treats local_config as a special category and splits
the JSON into virtual fragments keyed by <file>#<json-path> for the
three security-relevant blocks (mcpServers, hooks, permissions,
both top-level and per-project under projects.<p>.<key>). This
prevents unrelated background writes (session counters, cache, last-used
timestamps) from appearing as “modified” in the diff. If the file is
present but unparseable, the entry falls back to a single full-file
hash; if no watched block is present, a single #(no-watched-block)
sentinel entry is emitted so creation / deletion is still tracked.
Structs§
- Path
Entry - One hashed file or virtual JSON fragment.