Skip to content

disk-hygiene: read config from the config-cascade layers, not ~/.claude #18009

Open

Description

@kyle-sexton

Summary

disk-hygiene still reads its user-global and project config from ~/.claude and .claude/. Move both to the config-cascade layers.

Current behavior

plugins/disk-hygiene/skills/clean/scripts/hygiene.py:

  • :1073-1076

    def standing_policy_paths(project_dir: Path | None) -> list[Path]:
        layers = [Path.home() / ".claude" / "disk-hygiene.json"]
        if project_dir is not None:
            layers.append(project_dir / ".claude" / "disk-hygiene.json")
  • :1172 project_dir / ".claude" / "disk-hygiene.json" (project layer in the overlay path)

Desired behavior

Per the config-cascade layers:

Old path Layer
~/.claude/disk-hygiene.json userConfig: one file-typed option naming the user's policy file, which keeps the overlay's arrays of objects as they are; elevation: uac-prompt stays allowed only from that file or an explicit --policy (owner decision 2026-11-21, Q2 (a))
<project>/.claude/disk-hygiene.json team: <home>/disk-hygiene.yaml, with a personal <home>/disk-hygiene.local.yaml

Standing-policy loading reads the contract layers; a file at an old path keeps being read during a dual-read window (see the acceptance criteria) and is reported with a warning. The canonical location list (docs/contracts/config-cascade/locations.md) lands in the docs/config-locations pull request.

Key interfaces

  • standing_policy_paths and the overlay-path project layer
  • The layer provenance the audit reports

Acceptance criteria

  • The resolver reads the config-cascade layers (the layers).
  • Dual-read window: while an old-path file exists, it is still read and its values still apply where no new-layer file supplies that layer; each run prints one warning naming the old file and the new location to move it to. No setting in an old file is silently dropped.
  • Migration ends in one home, never two (owner 2026-11-21: "we don't have dual approaches, and that stuff gets cleaned up"): setup (check/apply) names each old file it finds and, after a preview and a yes, moves it to the new location, sets the userConfig option to it, checks the policy resolves the same, then deletes the old file. The dual-read warning names that setup command.
  • Removing the old-path read is a separate later change, made only once no old file is reported.
  • Tests cover: new layer only; old file only (values apply, warning printed); both present (new wins, warning names both).

Out of scope

The killswitch, deep-inventory and destructive-guard code that reads Claude Code's own ~/.claude state, and other plugins' resolvers (one issue each).

Activity

  1. added
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Nov 21, 2026
  2. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Nov 21, 2026
  3. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor

    Size: Medium
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none
    Blast radius: disk-hygiene's clean skill resolver (hygiene.py standing-policy and overlay paths), its tests, and anyone running that skill with an old-path config file.
    Reversible: yes; revert the change, and old files are left in place so nothing is lost.
    Open questions: none
    Understood: move disk-hygiene's standing-policy config reads from ~/.claude/disk-hygiene.json and /.claude/disk-hygiene.json to the config-cascade layers. Old files stay readable during a dual-read window with one warning per run. The acceptance criteria are exact and name the tests. No duplicate or merged fix found. Sibling issues cover other plugins' resolvers.

    Automated triage. A maintainer reviews it.

  4. removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Nov 21, 2026
  5. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"85d5254daf4c2268d18e46e8c3fc223c75eaf97e57fb27e9b25c035afdb64f93","body_sha256":"a2b3f13f63c5162884f7eb9ffd51656169198cbecc5f75012ae34a507a4708f4"}

  6. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: its body was edited after it was deferred, so the admission it was deferred from judged an older body. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  7. removed
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Nov 21, 2026
  8. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"85d5254daf4c2268d18e46e8c3fc223c75eaf97e57fb27e9b25c035afdb64f93","body_sha256":"8c2487331f520e92805626cdb092897f65214660872ce10857ed68145edc3193"}

  9. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor
    No description provided.
  10. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped partway through this issue and needs a person.

    Reason: design

    Why, in the run's own words:

    design-change: the issue moves ~/.claude/disk-hygiene.json into userConfig, but nothing says how a disk-hygiene policy overlay fits userConfig. The overlay's additional_hints and rules are arrays of objects. userConfig types are only string, number, boolean, directory and file (string arrays via multiple), with no object type. That choice also decides which channel may opt into elevation: uac-prompt, today allowed only from the user-global file or an explicit --policy. Options: (a) one file-typed userConfig option naming a user overlay file, which brings back a user-global file under another name; (b) one string option holding the overlay as JSON, which the clean skill passes as ${user_config.*} through the model or the engine reads from pluginConfigs in user settings as killswitch_config.py does; (c) separate options for the scalar and list fields (elevation, disabled_hint_ids, additional_protected_path_globs), with additional_hints and rules no longer read at the user layer, which drops settings once the dual-read window closes. Which shape, and which channel may set elevation, needs an owner decision before any edit. The team/personal half is settled (<home>/disk-hygiene.yaml plus .local.yaml, a schema at plugins/disk-hygiene/schemas/disk-hygiene.schema.json, home resolved through the pointer region, and a YAML reader the stdlib-only engine does not ship yet) and can be built in the same run once (a), (b) or (c) is chosen.

    What the run says it did not do:

    • The whole issue: resolver move to the config-cascade layers, dual-read warning, setup check/apply copy offer, and tests. All are blocked on the userConfig representation decision above.
    • tidy, review, verify and checks pipeline steps: skipped because nothing changed

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44954922879

    To retry, set Work status to agent-ready again (clearing the needs-human hold).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    needs-human

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions