Skip to content

code-metrics: read config from the config-cascade layers, not ~/.claude #18001

Description

@kyle-sexton

Summary

code-metrics still reads its user-global and personal config from ~/.claude and .claude/. Move both to the config-cascade layers.

Current behavior

plugins/code-metrics/scripts/resolve-config.py:247-252:

def layer_paths(home: str, root: str, stem: str) -> list[tuple[str, str]]:
    return [
        ("user-global", os.path.join(home, ".claude", f"{stem}.yaml")),
        ("team", os.path.join(root, ".claude", f"{stem}.yaml")),
        ("local", os.path.join(root, ".claude", f"{stem}.local.yaml")),
    ]

surface_layer_paths (:255-263) replaces only the team entry with docs/conventions/code-metrics.yaml, so the user-global and personal old paths stay live. scripts/dispatch.sh, skills/setup/scripts/setup-apply.py and skills/setup/scripts/setup-check.sh name the same paths.

Desired behavior

Per the config-cascade layers:

Old path Layer
~/.claude/code-metrics.yaml userConfig (no user-global file layer)
<repo>/.claude/code-metrics.local.yaml personal: <home>/code-metrics.local.yaml

The resolver, dispatch.sh and setup read and write 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

  • layer_paths and surface_layer_paths, and the per-value provenance the resolver prints
  • setup-apply.py and setup-check.sh paths

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.
  • setup-check.sh and setup-apply.py name each old file they find; apply offers to copy its keys into the new location after a preview and a yes, leaving the old file in place.
  • Removing the old-path read is a separate later change, made only once no old file is reported.
  • The plugin's tests (dispatch.test.sh, setup-check.test.sh, test_setup_apply.py, audit-size.test.sh) cover: new layer only; old file only (values apply, warning printed); both present (new wins, warning names both).

Out of scope

Other plugins' resolvers (one issue each).

Activity

  1. added
    agent-ready
    on Nov 21, 2026
  2. added
    needs-triage
    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: the code-metrics plugin's resolver, dispatch.sh, setup scripts and their tests; anyone running code-metrics with config files.
    Reversible: yes; revert the change, since the old paths keep being read during the dual-read window.
    Open questions: none
    I understood this as moving code-metrics config reads and writes to the config-cascade layers. Old-path files would still be read and warned about, and setup would offer to copy their keys to the new location. The issue has exact acceptance criteria. Other plugins have similar open issues (for example #18001's siblings for overengineering, ai-slop and bugs), but the issue scopes them out and they are not duplicates. No merged pull request already fixes this.

    Automated triage. A maintainer reviews it.

  4. removed
    needs-triage
    on Nov 21, 2026
  5. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"23d0b26bfed7e2ecd697a2f40dd619f438b0ba23a85b8307fef5959d38c7ccf1","body_sha256":"28a0af68febbbadf45673c93b9209d0448df4151523a5746c4c98c7b505b2c41"}

  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-ready
    on Nov 21, 2026
  8. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"23d0b26bfed7e2ecd697a2f40dd619f438b0ba23a85b8307fef5959d38c7ccf1","body_sha256":"49b0dac0e501d9600e44566377bc45d0bf44a7e40154eb5ea90eae5b990c7ae5"}

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

    @melodic-automation-lanes
    Contributor

    This records a re-fire of an earlier stop, not a new one. The start gate stopped run 44952330685, the work-resolve-issue run that agent-ready started, before any model turn, because the GITHUB_TOKEN budget was under its start-gate share, or the window was projected to have under its start-project share of the header's limit left by the run's expected end (github-token start-gate, start-project and start-run-minutes in rate-limits.json; the run's start-gate notice names which); that run ended at 2026-11-21T21:37:20Z. work-unblock has now removed and added agent-ready back to start a fresh run. A budget stop is the lanes' load, not a fault in this issue: it never counts toward limits.limit-stops-per-issue or the kill-switch wait.

  10. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor
    No description provided.
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-triage

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions