add D-76: ClaudeConfig as clide's Claude config surface
Extends D-75's accepted CC-internals coupling from the transcript/team schema to the config layout: a builtin-owned ClaudeConfig service is the app-wide source of truth for skills, commands, settings, and permissions (global + local, layered), watched and refreshable. Built-in slash commands come from a stream-json probe cached per claude version id. Kernel stays Claude-agnostic — Claude is a non-disableable extension but still an extension. Implemented by T-151..T-154. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,7 @@ You might also want, project-permitting:
|
||||
- [D-73: MCP transport for /ide is SSE over HTTP](decisions/architecture.md#d-73-mcp-transport-for-ide-is-sse-over-http) — _architecture_
|
||||
- [D-74: IPC command schema is co-registered with the handler, validated at dispatch](decisions/architecture.md#d-74-ipc-command-schema-is-co-registered-with-the-handler-validated-at-dispatch) — _architecture_
|
||||
- [D-75: Claude rendered natively from transcripts; terminal retained as general tool only](decisions/architecture.md#d-75-claude-rendered-natively-from-transcripts-terminal-retained-as-general-tool-only) — _architecture_
|
||||
- [D-76: ClaudeConfig — Claude's config surface is clide's app settings (builtin-owned, watched, probe-cached per version)](decisions/architecture.md#d-76-claudeconfig--claudes-config-surface-is-clides-app-settings-builtin-owned-watched-probe-cached-per-version) — _architecture_
|
||||
|
||||
## Open questions
|
||||
|
||||
|
||||
@@ -306,3 +306,13 @@ Core, rendering, IPC, kernel, panel manager.
|
||||
- **Raised by:** 2026-05-22 — native Claude integration epic (T-132); user set Claude-centric > CLI-first ordering.
|
||||
|
||||
---
|
||||
|
||||
### D-76: ClaudeConfig — Claude's config surface is clide's app settings (builtin-owned, watched, probe-cached per version)
|
||||
- **Date:** 2026-05-23
|
||||
- **Decision:** A single `ClaudeConfig` service in `lib/builtin/claude/` is the app-wide source of truth for Claude Code's environment: skills (`<scope>/skills/*/SKILL.md`), custom slash commands (`<scope>/commands/*.md`), `settings.json`, and permission rules (allow/deny/ask) — read from both the **global** scope (`~/.claude/`) and the **local** repo scope (`.claude/`), layered local-over-global (same ordering discipline as [D-4](#d-4-ignore-file-strategy)'s `ignore_files:`). It exposes typed, listenable views and is refreshed by `FileWatcher` (`lib/src/files/watcher.dart`) on both directories plus an explicit refresh. **Built-in** slash commands (not on disk) are obtained by a one-shot `claude --output-format stream-json` probe whose result is **cached keyed on the resolved claude version id**, so additions/deprecations are re-captured on upgrade; a small static list is the fallback when the probe is unavailable. The service is **builtin-owned, not a kernel service** — Claude is a non-disableable extension but still an extension, so the kernel stays Claude-agnostic and there is one ownership pattern. Consumers (composer slash typeahead, the status pane, later the team/permission surfaces) read from `ClaudeConfig`; none re-scan the filesystem or re-derive the command list.
|
||||
- **Rationale:** (a) Claude is clide's primary citizen, so its on-disk config *is* clide's settings surface — centralizing it removes per-feature filesystem scans and keeps one cache + one watcher. (b) Reuse: the slash list, skills, and permission/model defaults are needed by more than one surface (typeahead + status pane at minimum); a singleton avoids divergent copies. (c) Probe-and-cache-per-version honors "the CLI owns command/skill discovery" (the IDE enumerates from the CLI rather than reimplementing resolution) while bounding the cost of the extra process to once per version. (d) Builtin ownership preserves the kernel/extension boundary — the kernel does not learn about Claude — at the cost of Claude not being a kernel-level "setting", which is acceptable since nothing generic needs it.
|
||||
- **Cost:** Extends the version-drifting CC coupling already accepted in [D-75](#d-75-claude-rendered-natively-from-transcripts-terminal-retained-as-general-tool-only) from the transcript/team schema to the **config layout** (skills/commands dir conventions, `settings.json` shape, permission-rule shape, the stream-json init `slash_commands` payload). Mitigated the same way: all of it lives behind `ClaudeConfig`; the slash-command probe is version-keyed; on a parse miss the service degrades to whatever it could read (and the static built-in fallback) rather than failing. The probe assumes `claude --output-format stream-json` emits an init message listing `slash_commands` — to be confirmed empirically against the pinned version before the typeahead depends on it.
|
||||
- **Cross-reference:** [D-75](#d-75-claude-rendered-natively-from-transcripts-terminal-retained-as-general-tool-only) (native rendering + accepted CC-internals coupling — this extends it to config), [D-1](#d-1-cli-first-not-mcp) (CLI owns command/skill resolution; clide enumerates, never reimplements), [D-4](#d-4-ignore-file-strategy) (global/local layering discipline), [D-3](#d-3-pql-as-supporter-tool-clide-wraps-never-duplicates) (wrap-don't-duplicate analogue for Claude config).
|
||||
- **Raised by:** 2026-05-23 — slash-command typeahead work surfaced that clide has no command/skill enumeration today; user directed a top-level builtin-owned config object reused across surfaces, probe-cached per claude version.
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user