You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin currently enforces its context ceiling with plugins/dev-team/hooks/context_ceiling_guard.py, a PreToolUse hook that measures transcript occupancy and, once it crosses 40% of the context window (capped at 350K, ADR 0038), blocks Skill invocations and warns on Agent dispatches until the model runs /handoff to write a structured memory/ progress file. This hook approximates a capability the Claude Code harness already owns natively: auto-compact, tunable via CLAUDE_AUTOCOMPACT_PCT_OVERRIDE (documented in ADR 0016 but never enabled by the plugin itself).
That hook-forced handoff is being replaced. Instead of a plugin-side hook forcing a handoff document, /dev-team:setup will configure the target repo's own .claude/settings.json to set the harness-native autocompact percentage directly — default 40%, project-configurable — and context_ceiling_guard.py is removed. Because this makes /setup load-bearing for a repo's context-management behavior, a lightweight, non-blocking check should recommend running /setup when a repo shows no sign it has been run.
Architecture Specification
Removeplugins/dev-team/hooks/context_ceiling_guard.py, its registration in plugins/dev-team/settings.json, and its dedicated test file tests/hooks/test_context_ceiling_guard.py.
/setup gains a step that writes CLAUDE_AUTOCOMPACT_PCT_OVERRIDE (the harness's own env var) into the target project's .claude/settings.jsonenv block, defaulting to 40, with the value itself configurable (prompt or flag) rather than hardcoded. Must merge into existing env entries, not overwrite them.
New setup-detection check: a SessionStart hook, following the existing best-effort .claude/ensure_npm_ci.py / .claude/ensure_code_graph_tools.py pattern, checks whether the project's .claude/settings.json already sets CLAUDE_AUTOCOMPACT_PCT_OVERRIDE. If absent, it prints a one-line recommendation to run /dev-team:setup. Advisory only — never blocks session start.
/handoff skill is retained as a manually-invocable tool (continue/fork modes). Only the hook that force-triggered it is removed; it's dropped from context_ceiling_guard.py's recovery-skill allowlist because that allowlist no longer exists.
ADR impact: this reverses ADR 0016's "harness auto-compact remains the backstop; the plugin does not lower it by default" stance, and the blocking rationale behind fix(hooks): context ceiling guard defaults to warn, so the 40% ceiling never blocks #2000. Superseding ADR 0016 (and touching ADR 0038/0039, which are guard-specific) is expected implementation work in /plan, not spec content here.
Docs to update: docs/context-management.md, knowledge/agent-registry.md, CLAUDE.md's "Context Ceiling" principle, and any skill referencing the guard as a live mechanism (context-loading-protocol, handoff).
Acceptance Criteria
Running /dev-team:setup on a repo writes CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=40 (or the operator-configured value) into that repo's .claude/settings.json, without clobbering pre-existing unrelated env entries.
The percentage is configurable at setup time — a prompt or flag overrides the 40 default and that value is what lands in settings.json.
context_ceiling_guard.py, its hook registration, and its dedicated test file are deleted; no other shipped hook or skill references it as a live mechanism (historical mentions in ADRs/CHANGELOG may remain).
/handoff remains manually invocable and is no longer described anywhere as a hook-forced/blocked recovery path.
A SessionStart check detects a repo with no CLAUDE_AUTOCOMPACT_PCT_OVERRIDE in .claude/settings.json and prints a recommendation to run /dev-team:setup; it never blocks session start and never fires once the key is present.
The full pytest gate (scripts/ci-local.sh) passes with the guard's tests removed, and no orphaned reference trips scripts/check_md_references.py or the knowledge-index-currency check.
Ambiguity Log
Decision
Classification
Resolved By
Rationale / Answer
What happens to context_ceiling_guard.py's blocking behavior (kept as warn-only vs. removed entirely)
requires-stakeholder-input
human
Remove the hook entirely — rely solely on harness-native autocompact, no plugin-side context signal.
Whether this supersedes ADR 0016 / #2000's data-backed blocking rationale (76+ sessions ran past 500K under warn-only, 18 past 900K)
requires-stakeholder-input
human
Yes — explicit in the request. An ADR superseding 0016 is implementation work for /plan, not this spec.
Configuration mechanism for the percentage
inferable
inference
Matches the plugin's existing DEV_TEAM_*-style env-knob convention and the harness's own already-documented CLAUDE_AUTOCOMPACT_PCT_OVERRIDE (ADR 0016); no other knob exists for this today.
Setup-detection signal and hook type
inferable
inference
Matches the existing SessionStart "ensure_*" best-effort pattern already in the project (ensure_npm_ci.py, ensure_code_graph_tools.py); presence of the settings.json key is the natural completion signal.
Whether /handoff the skill is removed or just its forced trigger
inferable
inference
The request targets "the hook to force it," not the skill itself; manual /handoff still has value for fork mode and deliberate summarization independent of the ceiling.
Whether the guard's 350K absolute cap (ADR 0038) carries over
inferable
inference
The harness's CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is percentage-only with no absolute-cap concept; dropped along with the hook rather than reimplemented.
Consistency Gate
Intent is unambiguous
Every behavior/goal maps to an acceptance criterion
Architecture constrains without over-engineering
Terminology consistent across artifacts
No contradictions between artifacts
Every gap/ambiguity finding is logged — inferable with rationale or resolved by human
Intent Description
The plugin currently enforces its context ceiling with
plugins/dev-team/hooks/context_ceiling_guard.py, a PreToolUse hook that measures transcript occupancy and, once it crosses 40% of the context window (capped at 350K, ADR 0038), blocksSkillinvocations and warns onAgentdispatches until the model runs/handoffto write a structuredmemory/progress file. This hook approximates a capability the Claude Code harness already owns natively: auto-compact, tunable viaCLAUDE_AUTOCOMPACT_PCT_OVERRIDE(documented in ADR 0016 but never enabled by the plugin itself).That hook-forced handoff is being replaced. Instead of a plugin-side hook forcing a handoff document,
/dev-team:setupwill configure the target repo's own.claude/settings.jsonto set the harness-native autocompact percentage directly — default 40%, project-configurable — andcontext_ceiling_guard.pyis removed. Because this makes/setupload-bearing for a repo's context-management behavior, a lightweight, non-blocking check should recommend running/setupwhen a repo shows no sign it has been run.Architecture Specification
plugins/dev-team/hooks/context_ceiling_guard.py, its registration inplugins/dev-team/settings.json, and its dedicated test filetests/hooks/test_context_ceiling_guard.py./setupgains a step that writesCLAUDE_AUTOCOMPACT_PCT_OVERRIDE(the harness's own env var) into the target project's.claude/settings.jsonenvblock, defaulting to40, with the value itself configurable (prompt or flag) rather than hardcoded. Must merge into existingenventries, not overwrite them..claude/ensure_npm_ci.py/.claude/ensure_code_graph_tools.pypattern, checks whether the project's.claude/settings.jsonalready setsCLAUDE_AUTOCOMPACT_PCT_OVERRIDE. If absent, it prints a one-line recommendation to run/dev-team:setup. Advisory only — never blocks session start./handoffskill is retained as a manually-invocable tool (continue/fork modes). Only the hook that force-triggered it is removed; it's dropped fromcontext_ceiling_guard.py's recovery-skill allowlist because that allowlist no longer exists./plan, not spec content here.docs/context-management.md,knowledge/agent-registry.md, CLAUDE.md's "Context Ceiling" principle, and any skill referencing the guard as a live mechanism (context-loading-protocol,handoff).Acceptance Criteria
/dev-team:setupon a repo writesCLAUDE_AUTOCOMPACT_PCT_OVERRIDE=40(or the operator-configured value) into that repo's.claude/settings.json, without clobbering pre-existing unrelatedenventries.settings.json.context_ceiling_guard.py, its hook registration, and its dedicated test file are deleted; no other shipped hook or skill references it as a live mechanism (historical mentions in ADRs/CHANGELOG may remain)./handoffremains manually invocable and is no longer described anywhere as a hook-forced/blocked recovery path.CLAUDE_AUTOCOMPACT_PCT_OVERRIDEin.claude/settings.jsonand prints a recommendation to run/dev-team:setup; it never blocks session start and never fires once the key is present.scripts/ci-local.sh) passes with the guard's tests removed, and no orphaned reference tripsscripts/check_md_references.pyor the knowledge-index-currency check.Ambiguity Log
context_ceiling_guard.py's blocking behavior (kept as warn-only vs. removed entirely)requires-stakeholder-inputrequires-stakeholder-input/plan, not this spec.inferableDEV_TEAM_*-style env-knob convention and the harness's own already-documentedCLAUDE_AUTOCOMPACT_PCT_OVERRIDE(ADR 0016); no other knob exists for this today.inferableensure_npm_ci.py,ensure_code_graph_tools.py); presence of the settings.json key is the natural completion signal./handoffthe skill is removed or just its forced triggerinferable/handoffstill has value for fork mode and deliberate summarization independent of the ceiling.inferableCLAUDE_AUTOCOMPACT_PCT_OVERRIDEis percentage-only with no absolute-cap concept; dropped along with the hook rather than reimplemented.Consistency Gate
🤖 Generated with Claude Code