diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index 27bb778..d6181ab 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -1522,3 +1522,10 @@ Supersedes [[BDR-030]]. - **Alternatives rejected**: raise cleanupPeriodDays (reverses secret hygiene); cron job (machinery, background claude); labels committed (client names on Gitea); one joint gate (prompt waits on rare tool channel); Stop-hook cited flag (BDR-125). - **Deviations from spec (user-gated 2026-11-07)**: reader in lib/ not mods/ (plugin validate/test scope); miss causes no-overlap|overlap only; labels.tsv without cited; noisy/promotion lines carry repo tag. - **Reference**: feature/memory-feedback 21483dc..b44b19f; contract .claude/tasks/contracts/2026-11-06-memory-feedback-4d-1825.md. See [[BDR-125]], [[BDR-137]], [[BDR-100]]. + +## BDR-141 — claude.ai-synced skills off via global skillOverrides, not sync flag or profiles [accepted] (2026-11-09) +- **Decision**: claude.ai-synced skills (19: docx, pptx, xlsx, pdf, docs, computer-use, cv-*, veille-emploi…) turned off by top-level `skillOverrides` {name: "off"} in tracked user settings.json. Global so plain `claude` (no profile = full, user rule 2026-11-09) gets it. Project re-enables one: `{"skillOverrides":{"":"on"}}` in `.claude/settings.local.json` (per-key merge proven). Budget stays 50000. +- **Why**: measured `/context` full headless 32.2k → 28.5k (Skills 16.2k → 12.5k); budget 50000 paid mostly synced skills (0.5k → 3.7k), our 44 skills keep descriptions even at default budget. Synced skills irrelevant in coding sessions. +- **Alternatives rejected**: `syncClaudeAiSkills: false` (moves synced skills to `~/.claude/skills/.trash/`, not reversible per project); skillOverrides in profile fragments (session without profile reads no fragment); lower budget (40000 = 50000 once synced off, no gain). +- **Also 2026-11-09**: user removed Higgsfield + unused claude.ai connectors at account level → MCP instr 2.4k → 0.77k on full; profile `deniedMcpServers` now dead (cleanup queued). Full headless 32.2k → 26.9k total. +- **Amends** [[BDR-134]] "nothing global": account-level noise cut globally, packs/profiles untouched. Ref: feature/claude-ai-skills-off 47438f4, contract .claude/tasks/contracts/2026-11-09-claude-ai-skills-off-1253.md. See [[BDR-125]]. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 0d5824c..d314d24 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -706,3 +706,6 @@ rules: ## 2026-11-08 - 2026-11-08: 4d memory feedback built on feature/memory-feedback (8 tasks SDD; plan r1 FATAL(7) → r2 → confirm FATAL(4) → r3; final review I1 locals + I2 per-trigger n; gate 2 hardening x2: checkDir fail-closed, items.json validated, safe repo path). make test green, GATE 0 MET, security PASS 0 findings; live record zenquality cands 11 ms 1408. BDR-140, LRN-267/268. Merged on user signal before GATE 1; live run + verifier after. - 2026-11-08: /hotfix comm warning: uutils sort locale vs comm byte order in memory-commit _partial_stages; LC_ALL=C both, test red-before (sorted order) then 21/21; security PASS; 54bdfeb. LRN-269. + +## 2026-11-09 +- 2026-11-09: BDR-125 residual measured: 30.2k→40k = Skills +6.2k (budget paid claude.ai-synced skills) + System tools (unattributable). /feat claude-ai-skills-off: global skillOverrides 19 off, 47438f4 + 07406ce; GATE 0 MET, verifier ECARTS(1)→CONFORME, security PASS. User removed claude.ai connectors. BDR-141, LRN-270/271. Merge on signal; next: dead deniedMcpServers cleanup. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index f66ff27..9d1bc46 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -1996,3 +1996,13 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s - **Pattern**: uutils coreutils 0.10.0 (Ubuntu 26.04 default `sort`/`comm`): `sort` collates by locale (en_US.UTF-8: `.claude/tasks/contracts/x` before `.claude/tasks/TODO.md`), `comm` expects byte order → `comm: file N is not in sorted order`, rc 1, common lines can be missed. Fix: `LC_ALL=C` on every link (`LC_ALL=C sort` + `LC_ALL=C comm`/`join`). Test discriminates only with `LC_ALL=en_US.UTF-8`; `LC_ALL=''` makes uutils fall back to byte order (bug hidden). - **Context**: `lib/memory-commit.sh` `_partial_stages`, warning seen on a memory commit; fix 54bdfeb, test in lib/tests/run-deterministic.sh. - **Future use**: any `sort | comm|join|uniq` pipeline in shell libs: pin C locale on both sides; grep `comm -`/`join -` in review. + +## LRN-270 — /context measurement facts CLI 2.1.319: headless free but defers built-ins, MCP deny is a union, skillOverrides merges per key (2026-11-09) +- **Pattern**: `/context` measurement facts, CLI 2.1.319: `claude -p "/context" --output-format json` = 0 tokens, ~4 s, loads claude.ai connectors (contradicts phase 5 fact LRN-248 on 2.1.316), BUT defers nearly all built-in tools → headless total ≈ interactive − ~7.7k (System tools row absent). `/context all` lists MCP, agents, skills per item; System tools never per item. `deniedMcpServers` = union across scopes: `--settings` with `[]` or `allowedMcpServers` cannot lift a lower-scope deny. `skillOverrides` reaches claude.ai-synced and built-in skills (not plugin skills), merges per key across scopes (user off + local "on" → 1 back). `ENABLE_TOOL_SEARCH=true` = default (no change); `false` → full 181k (MCP inline). +- **Context**: 2026-11-09 BDR-125 residual measure 30.2k → 40k. Tool-search-threshold hypothesis for dev System tools 11.3k vs full 7.7k disproved (true changes nothing interactive; Higgsfield deny on full keeps 7.7k); cause = some pack off, unattributable via /context. +- **Future use**: headless `/context` for A/B deltas (free, overlay via `--settings`); interactive for System tools totals; plan control runs must discriminate (count all synced = 1, not just "docx present": wholesale replace would also pass). + +## LRN-271 — gates.sh make test oracle needs GATES_TIMEOUT=600 and bun on PATH (2026-11-09) +- **Pattern**: contract CHECK running `make test` here → NOT-MET `timeout=120s` under gates.sh default, and red memory/memory-feedback suites when `bun` not on PATH. Run gate as `GATES_TIMEOUT=600 PATH="$HOME/.bun/bin:$PATH" bash ~/.claude/lib/gates.sh run `. +- **Context**: /feat claude-ai-skills-off 2026-11-09: feater reported criterion 3 red (bun), first GATE 0 NOT-MET on timeout though suite green (rc 0, all suites green). +- **Future use**: every contract with a `make test` oracle in this repo: brief executor + gate run with both env vars; consider default timeout per contract. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 8e5841c..a308e1c 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -108,7 +108,10 @@ Shared rules for every phase: - If built, scope = `prompt.compose` section deltas for doctrine a carrier already re-delivers (jit-marked, never deleted; mod off = full text; ledger in `$.state`, reset on compact/clear) + `mcp_instructions_delta` for connectors irrelevant in a coding repo. Shared infra (jit-marker subtraction, `$.state` ledger) lives here or in 4c, whichever ships first. - Dropped by the re-challenge: skill listing filter + routing.json `contexts` + census (phase 5 packs + the budget env already give 0 name-only); routing-hint classifier (no measured miss outside code intents the phase 2 guard catches; the "Skill routing" table lines move into our own skills' `description:`, ≤3 lines for vendored aliases stay in CLAUDE.global.md, done in phase 1 cleanup); agent listing rewrite (phase 1 diet); higgsfield deltas (phase 0/5); project fingerprint. `prompt.attachment` kinds (`skill_listing`, `agent_listing_delta`…) exist in the 2.1.306 types but not in the docs text: re-verify at build time. -- [ ] Measure: under profile `dev` System tools rise to 11.5k vs 7.6k on `full` (23 MCP tools vs 180): likely the deferred tool-search threshold no longer trips and tool definitions inline; dev saves 1.6k total instead of ~5k. Check the CLI threshold (ENABLE_TOOL_SEARCH / auto threshold) before tuning the dev profile. +- [x] Measure the 30.2k → 40k rise (2026-11-09, LRN-270): Skills +6.2k = budget 50000 paying mostly claude.ai-synced skills; System tools rise not attributable (`/context all` has no per-tool row). Tool-search threshold hypothesis disproved (`ENABLE_TOOL_SEARCH=true` changes nothing; Higgsfield deny on full keeps 7.7k). L1 shipped: feature/claude-ai-skills-off 47438f4 + 07406ce (BDR-141), full headless 32.2k → 28.5k; user removed Higgsfield + unused claude.ai connectors (full 26.9k headless). Merge on user signal. + - [ ] Cleanup run: the 5 profiles' `deniedMcpServers` (audit, dev, minimal, qa, seo) target connectors removed at claude.ai on 2026-11-09: drop them + citers (lib/profiles/README.md:5,11, skills/profile/SKILL.md:26,61, CHANGELOG known-limit line 62); keep the generic profile.sh mechanism (tested with fictional connectors). 8 files of deletions: /ship-feature by rule, or /feat on user OK. + - [ ] Open: dev System tools 11.3k vs full 7.7k (interactive) comes from some pack being off, not MCP; unattributable via `/context`. Bisect by toggling one pack at a time interactively if it matters. + - [ ] Follow-up candidate (accepted risk): doctor residue check covers `enabledPlugins` only; a UI write into user-scope `skillOverrides` would dirty tracked settings.json unseen. - [ ] **Phase 4b-4d, memory v2 capture, read, feedback** (shrunk 2026-10-25 to the measured channels) - Measured recall (5 real FR prompts, 22 relevant entries): BM25 full text 9/22, haiku rerank of lexical top-30 14/22 (~8.5k chars). Error 4-gram match on real errors: BLK-030/031/034 exact, no false positive; 5 of 7 real errors of 2026-10-23 had NO entry: capture is the weak link. diff --git a/.claude/tasks/contracts/2026-11-09-claude-ai-skills-off-1253.md b/.claude/tasks/contracts/2026-11-09-claude-ai-skills-off-1253.md new file mode 100644 index 0000000..dfce89a --- /dev/null +++ b/.claude/tasks/contracts/2026-11-09-claude-ai-skills-off-1253.md @@ -0,0 +1,31 @@ +# CONTRACT — claude-ai-skills-off +- date: 2026-11-09 | flow: feat | branch: feature/claude-ai-skills-off +- status: active + +## REQUEST (verbatim — IMMUTABLE) +L1 context diet (user-approved 2026-11-09): global `skillOverrides` in tracked settings.json (= ~/.claude/settings.json) setting the 19 claude.ai-synced skills to "off": docs, pptx, google-workspace, xlsx, computer-use, docx, built-in-browser, chrome-browser, prompt-engineer, anthropic-skills:deep-research, veille-emploi, pdf, morning, skill-creator, dossier-location, import-memory, saas-concil, cv-rewriter, cv-diagnoser. Global so a plain `claude` (no profile = full, user requirement) gets it too. Measured: −3.7k tokens (full 32.2k→28.5k headless); proven from a settings.local.json scope (scratchpad scope-probe: 0 synced skills listed). A project re-enables one with "on" in its settings.local.json. SLASH_COMMAND_TOOL_CHAR_BUDGET stays 50000. Not in scope: Higgsfield connectors (user removes them on claude.ai; dead deniedMcpServers cleanup is a later run). Docs: CHANGELOG Unreleased, lib/profiles/README.md or SETTINGS.md where settings env/listing budget is described. Raw measures: /home/bchanot/.cache/claude-tmp/claude-1000/-home-bchanot-Documents-claude/b681969c-a00d-4b27-8e53-ded169faf56f/scratchpad/ctx/. + +User words (2026-11-09, conversation): "ok pour l1 et l3"; "j'avais dit qu'on doit avoir par defaut le profile full. donc il faudrait si on lance claude tout court, que ca prenne full comme profil". + +## CLARIFICATIONS +Q: where does skillOverrides live (profile fragments vs global settings.json)? / A: global — a plain `claude` must behave as full; fragments are not read without a profile. [gated 2026-11-09] +Q: Higgsfield claude.ai connectors? / A: user removes them on claude.ai; out of this run. [gated 2026-11-09] +Q: doc target (REQUEST names lib/profiles/README.md or SETTINGS.md)? / A: README.md § Settings and permissions (the settings hierarchy lives there; no other doc but CHANGELOG describes the listing budget); delegated — default taken by the orchestrator after the correctness challenge. [gated 2026-11-09] + +## ACCEPTANCE CRITERIA +1. `settings.json` gains a top-level `skillOverrides` object holding exactly the 19 names of the REQUEST, each `"off"`; every other top-level key is byte-identical in value to `develop`; the file stays valid JSON. + CHECK: cd /home/bchanot/Documents/claude && want='["anthropic-skills:deep-research","built-in-browser","chrome-browser","computer-use","cv-diagnoser","cv-rewriter","docs","docx","dossier-location","google-workspace","import-memory","morning","pdf","pptx","prompt-engineer","saas-concil","skill-creator","veille-emploi","xlsx"]' && [ "$(jq -c '.skillOverrides|keys' settings.json)" = "$want" ] && [ "$(jq -c '[.skillOverrides[]]|unique' settings.json)" = '["off"]' ] && [ "$(jq -S -c 'del(.skillOverrides)' settings.json)" = "$(git show develop:settings.json | jq -S -c .)" ] && echo SKILLOVERRIDES-OK + EXPECT: SKILLOVERRIDES-OK + EVIDENCE: MET exit=0 marker-found :: SKILLOVERRIDES-OK +2. Live effect: a headless `/context` at the repo root (output holds the `| Skills |` row) lists no `claude.ai sync` skill; positive control and per-key merge proof: from a scratch project whose `.claude/settings.local.json` is `{"skillOverrides":{"docx":"on"}}`, a headless `/context` lists exactly ONE `claude.ai sync` skill and it is `docx` (a wholesale replace of the user map would list 19). + CHECK: cd /home/bchanot/Documents/claude && a=$(timeout 120 claude -p "/context" --output-format json /dev/null | jq -r .result) && printf '%s\n' "$a" | grep -q '^| Skills |' && [ "$(printf '%s\n' "$a" | grep -c 'claude.ai sync')" = 0 ] && P=/home/bchanot/.cache/claude-tmp/claude-1000/-home-bchanot-Documents-claude/b681969c-a00d-4b27-8e53-ded169faf56f/scratchpad/ctx/merge-probe && mkdir -p "$P/.claude" && (cd "$P" && git init -q) && printf '{"skillOverrides":{"docx":"on"}}\n' > "$P/.claude/settings.local.json" && b=$(cd "$P" && timeout 120 claude -p "/context" --output-format json /dev/null | jq -r .result) && printf '%s\n' "$b" | grep -q '^| Skills |' && [ "$(printf '%s\n' "$b" | grep -c 'claude.ai sync')" = 1 ] && [ "$(printf '%s\n' "$b" | grep -c '^| docx | claude.ai sync')" = 1 ] && echo SYNC-OFF-OK + EXPECT: SYNC-OFF-OK + EVIDENCE: MET exit=0 marker-found :: SYNC-OFF-OK +3. The repo suite stays green. + CHECK: cd /home/bchanot/Documents/claude && make test 2>&1 | tail -3 | grep -q 'all suites green' && echo SUITE-OK + EXPECT: SUITE-OK + EVIDENCE: MET exit=0 marker-found :: SUITE-OK +4. README.md § "Settings and permissions" says, in a short paragraph, that `settings.json` turns the claude.ai-synced skills off through `skillOverrides` (why: listing cost, measured on the full profile 2026-11-09: 32.2k → 28.5k headless), that the list is by name (a skill synced later stays listed until its name is added; a same-named skill elsewhere is hidden too), and that a project re-enables one with `"": "on"` under `skillOverrides` in its `.claude/settings.local.json`; no hardcoded skill count. CHANGELOG.md `[Unreleased]` `### Changed` gains one bullet with the same facts, the measured figures, the CLI version measured (2.1.319) and "check `claude --version` on another machine before pulling". No em-dash in the new prose. + +## FILE SCOPE +settings.json, README.md (§ Settings and permissions only), CHANGELOG.md ([Unreleased] only) diff --git a/.claude/tasks/plans/2026-11-09-claude-ai-skills-off-1253.md b/.claude/tasks/plans/2026-11-09-claude-ai-skills-off-1253.md new file mode 100644 index 0000000..58a9b77 --- /dev/null +++ b/.claude/tasks/plans/2026-11-09-claude-ai-skills-off-1253.md @@ -0,0 +1,38 @@ +# PLAN — claude-ai-skills-off (/feat, 2026-11-09) — r2 after challenge + +Contract: `.claude/tasks/contracts/2026-11-09-claude-ai-skills-off-1253.md` + +## Goal +Cut the claude.ai-synced skills from the skill listing of every Claude Code +session (profile or not), −3.7k tokens measured on full, with a per-project +way back. + +## Facts (measured 2026-11-09, CLI 2.1.319, raw in scratchpad ctx/) +- `/context` headless full: Skills 16.2k, of which `claude.ai sync` 3.7k (19 items). +- `--settings` overlay `skillOverrides` {19 names: "off"} → Skills 12.5k, total 32.2k → 28.5k. +- Same object in a scratch project's `.claude/settings.local.json` → 0 synced skills listed: works from a settings file scope. +- Docs: values on | name-only | user-invocable-only | off; plugin skills unaffected. `syncClaudeAiSkills: false` rejected (moves synced skills to `~/.claude/skills/.trash/`). +- `~/.claude/settings.json` is a symlink to this repo's `settings.json`: the edit is live for every running session the moment it lands. +- `### Changed` already exists under CHANGELOG `[Unreleased]` (CHANGELOG.md:36-65). + +## PLAN + [ ] settings.json — ONE Edit-tool call on `/home/bchanot/Documents/claude/settings.json` (never a shell redirect, never the `~/.claude/settings.json` path, never `mv`): replace the `env` block's closing ` },` that precedes ` "attribution"` (settings.json:6-7) with ` },` + a new ` "skillOverrides": { … },` block, the 19 names in alphabetical order, each `"off"`, 2-space indent like the file, trailing comma before `"attribution"`. Then `jq empty settings.json` must exit 0. + [ ] README.md § "Settings and permissions" (~317-340) — one short paragraph after the "DENY always wins" line: settings.json turns the claude.ai-synced skills off via `skillOverrides` (listing cost measured on the full profile 2026-11-09: 32.2k → 28.5k tokens headless); the list is by name, so a skill synced later stays listed until its name is added, and a same-named skill elsewhere is hidden too; a project re-enables one with `{"skillOverrides": {"": "on"}}` in its `.claude/settings.local.json`. No hardcoded count, no em-dash. + [ ] CHANGELOG.md — append one bullet at the end of `[Unreleased]` `### Changed` (before the next `###`/`##` heading): same facts, Skills 16.2k → 12.5k and total 32.2k → 28.5k (headless, full, CLI 2.1.319), budget unchanged (40000 and 50000 give the same listing once the synced skills are off), `syncClaudeAiSkills: false` not used (moves files to .trash), check `claude --version` on another machine before pulling. + +## Edge cases +- Newly synced claude.ai skill: listed until named (README says so). +- Prefixed names (`anthropic-skills:deep-research`) keyed exactly as `/context` prints them. +- Per-key merge across scopes (user map + project "on"): proven by contract criterion 2 from a real `.claude/settings.local.json`; if it fails (wholesale replace), STOP: the README re-enable sentence is false. + +## Tests +No new test file: no census covers settings.json beyond push-guard deny locks (untouched). Oracles: contract criteria 1-3 (`gates.sh`). + +## Accepted risks (challenge 2026-11-09) +- An older CLI on another machine: behavior with `skillOverrides` unverified (CHANGELOG names the check). +- A UI write into user-scope `skillOverrides` would dirty this tracked file; doctor's residue check covers `enabledPlugins` only. Follow-up candidate, not this run. + +## Disposition +- honors BDR-134 (packs and profiles untouched); the global key is the same kind as the global `env` budget BDR-134 set; user asked that a plain `claude` behave as full. +- honors LRN-088 / LRN-175: measured per-item cost first; the cut frees context because the budget sits above the natural listing on full. +- honors BDR-125 subtract-only spirit: nothing deleted, `"on"` restores per project.