Skip to content

feat: add per-repo disable via cache sentinel (ADR 0020)#44

Open
bcanfield wants to merge 1 commit into
mainfrom
claude/plugin-disable-per-repo-igk9mv
Open

feat: add per-repo disable via cache sentinel (ADR 0020)#44
bcanfield wants to merge 1 commit into
mainfrom
claude/plugin-disable-per-repo-igk9mv

Conversation

@bcanfield

Copy link
Copy Markdown
Owner

Adds a per-repo on/off switch for debt-ops that lives in the plugin cache, not the working tree. Users can now silence debt-ops for a single repo without uninstalling globally.

Summary

Implements ADR 0020: a disabled sentinel file in each repo's cache dir (<cache>/cache/<repo_hash>/disabled). When present, all hooks idle silently — no session inject, no write-time feedback, no stop nudge. The flag is per-machine (not committed), so each developer flips it independently.

Changes

  • New skill: disable (all adapters)

    • Claude Code: /debt-ops:disable (hidden from npx skills via metadata.internal: true)
    • Codex/Copilot/portable: $debt-ops-disable / debt-ops-disable
    • Backed by toggle.py — creates or removes the sentinel, prints confirmation
    • Explicit-request only; never auto-invokes
  • Hook updates (all adapters)

    • Added repo_disabled(cache_dir) helper to check for sentinel
    • Early return (exit 0) in session-start.py, stop.py, feedback.py, drop.py if disabled
    • Preserves per-adapter deltas (cache-base env vars, cwd handling, hook I/O envelopes)
  • Documentation

    • ADR 0020: rationale, trade-offs (per-machine vs. committed), alternatives ruled out
    • SKILL.md for each adapter with call examples and "don't" guidance
    • Updated CLAUDE.md to note seven scripts (was six)

Implementation notes

  • toggle.py resolves cache the same way register.py does, ensuring consistency
  • Sentinel check happens immediately after cache-dir resolution, before any work
  • No changes to working tree — flag lives entirely in plugin cache
  • Explicitly-invoked skills (e.g., /debt-ops:add) still work while disabled; only automatic hook behaviors are silenced

https://claude.ai/code/session_01Av3q7T4rbXaj7MuPPAjLif

Adds a way to turn debt-ops off for a single repo without uninstalling
globally or putting a file in the working tree.

The off-state lives as a `disabled` sentinel in the plugin's existing
per-repo cache (`<cache>/cache/<repo_hash>/disabled`). Every hook already
resolves git root -> cache_dir, so each now checks `repo_disabled(cache_dir)`
there and idles silently when the marker is present — no session inject, no
write-time feedback, no stop nudge.

Flip it with the new `/debt-ops:disable` skill (`$debt-ops-disable` on
Codex/Copilot/portable), backed by `toggle.py`, which creates/removes the
sentinel and prints the resulting state. Run again to re-enable.

Trade-off (per ADR 0020): the marker is per-machine, not committed, so it
keeps the working tree clean at the cost of being per-developer rather than
team-wide.

- Hooks honor the sentinel across all adapters (claude/codex/copilot)
- New disable skill + toggle.py duplicated across all four skill sets
- ADR 0020 records the decision; CLAUDE.md parity lists + README updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants