Repository navigation
Conversation
… MCP, hooks and plugins per workspace Adds a read-only right-sidebar panel that lists what an agent will load for the active worktree, on the host that runs it: instruction files (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules, .cursor/rules, copilot instructions; user + workspace + ancestor scope), discovered skills grouped by source, MCP config files with their servers, Claude hook settings and plugin enable/disable decisions. Every row names the agents that read it. Discovery reuses the skill discovery target resolution (native host / WSL, local IPC or runtime RPC), so the same panel works for WSL projects and remote runtimes. Home-scope MCP files (~/.claude.json, ~/.cursor/mcp.json, ~/.gemini/settings.json) go through the shared MCP inspector. Co-Authored-By: Claude Fable 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review. 📝 WalkthroughWalkthroughAdds filesystem discovery and inspection for instruction files, MCP configurations, Claude hooks, and plugins. Exposes inspection through native, WSL, IPC, RPC, preload, and runtime clients. Adds shared report types and target handling. Adds a right-sidebar agent-context panel with workspace filtering, grouped context sections, loading and error states, localization, navigation, and tests. Merge Risk: ⚪ Minimal · up to This read-only change adds workspace agent-context visibility without a supplied correctness, security, availability, or deployment risk; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (3)
src/main/agent-context/agent-context-inspection.ts (1)
58-65: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value
countRuleFilesignores nested rule files.
readdirruns withoutrecursive: true, so rules stored in subdirectories of.cursor/rules/or.github/instructions/are not counted. Both vendors support nested rule folders. The displayed count can therefore be lower than the real one, and a directory that only holds subfolders reportsentryCount: 0.Consider a bounded recursive walk if the count must match agent behavior.
src/main/agent-context/agent-context-inspection.test.ts (1)
122-131: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winThe ancestor test does not verify the home-directory boundary, and both assertions are weak.
nestedsitsMAX_ANCESTOR_LEVELS + 3levels belowhomeDir. The walk therefore stops at the level cap before it ever reacheshomeDir, so thedir === homeDirbreak inbuildInstructionFileSourcesis never exercised.Both assertions also pass without the production logic:
- Line 129 uses
toBeLessThanOrEqual, so it passes for any count, including zero.- Line 130 checks the prefix
join(homeDir, 'CLAUDE'). Ancestor paths always contain an intermediate segment (<home>/d0/.../CLAUDE.md), so no path can match that prefix even if the home break is removed.Split the case: assert the exact cap count, then use a shallow
cwdto assert that the walk stops athomeDir.💚 Proposed test rework
- it('stops the ancestor walk at the home directory and at the level cap', () => { - const nested = join( - homeDir, - ...Array.from({ length: MAX_ANCESTOR_LEVELS + 3 }, (_, i) => `d${i}`) - ) - const sources = buildInstructionFileSources({ homeDir, cwd: nested }) - const ancestors = sources.filter((source) => source.scope === 'ancestor') - expect(ancestors.length).toBeLessThanOrEqual(MAX_ANCESTOR_LEVELS * 2) - expect(ancestors.every((source) => !source.path.startsWith(join(homeDir, 'CLAUDE')))).toBe(true) - }) + it('caps the ancestor walk at MAX_ANCESTOR_LEVELS', () => { + const nested = join( + homeDir, + ...Array.from({ length: MAX_ANCESTOR_LEVELS + 3 }, (_, i) => `d${i}`) + ) + const sources = buildInstructionFileSources({ homeDir, cwd: nested }) + const ancestors = sources.filter((source) => source.scope === 'ancestor') + expect(ancestors).toHaveLength(MAX_ANCESTOR_LEVELS * 2) + }) + + it('stops the ancestor walk at the home directory', () => { + const sources = buildInstructionFileSources({ homeDir, cwd: join(homeDir, 'a', 'b') }) + const ancestorDirs = sources + .filter((source) => source.scope === 'ancestor') + .map((source) => dirname(source.path)) + expect(ancestorDirs).toEqual([join(homeDir, 'a'), join(homeDir, 'a')]) + })Add
dirnameto thenode:pathimport.src/renderer/src/components/right-sidebar/WorkspaceContextPanel.tsx (1)
111-135: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse shadcn primitives and design tokens instead of raw controls and arbitrary sizes.
The refresh control (Lines 111-122) is a plain
<button>, and the "show missing" toggle (Lines 124-135) uses a raw<input type="checkbox">. The file also uses arbitrary Tailwind bracket sizes such astext-[11px](Line 124) andtext-[10px](Line 159, Line 219, and elsewhere) instead of documented type-scale tokens.Use the shadcn
ButtonandCheckboxprimitives fromsrc/renderer/src/components/ui/and replace the arbitrary font-size classes with documented tokens fromsrc/renderer/src/assets/main.css.As per path instructions: "All renderer UI work must follow
docs/STYLEGUIDE.md, use tokens fromsrc/renderer/src/assets/main.css, and use shadcn primitives fromsrc/renderer/src/components/ui/; do not invent documented colors, font sizes, or shadow tiers."Source: Path instructions
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b6572863-7795-47ec-8433-2f2b81ab8484
📒 Files selected for processing (26)
src/main/agent-context/agent-context-inspection.test.tssrc/main/agent-context/agent-context-inspection.tssrc/main/agent-context/agent-context-sources.tssrc/main/agent-context/agent-context-target.tssrc/main/ipc/agent-context.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/runtime/rpc/methods/agent-context.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/index.tssrc/preload/api-types.tssrc/preload/api/agent-context-api.tssrc/preload/index.tssrc/renderer/src/components/right-sidebar/WorkspaceContextPanel.test.tsxsrc/renderer/src/components/right-sidebar/WorkspaceContextPanel.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/right-sidebar/use-right-sidebar-activity-items.tssrc/renderer/src/components/right-sidebar/use-workspace-agent-context.tssrc/renderer/src/components/right-sidebar/workspace-context-model.tssrc/renderer/src/components/right-sidebar/workspace-context-rows.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/runtime/runtime-agent-context-client.tssrc/renderer/src/store/right-sidebar-route.tssrc/renderer/src/web/web-preload-api.tssrc/shared/agent-context.tssrc/shared/ui-chrome-types.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.
…oject scope, Codex config.toml and OpenCode - Filter strip (All · Instructions · Skills · MCP · Hooks · Plugins) focuses the panel on one kind; MCP/hooks/plugins bodies move to workspace-context-sections.tsx to keep the panel under the line cap. - ~/.claude.json now also reports projects.<cwd>.mcpServers (claude mcp add local scope), merged with the user-level servers. - Codex config.toml [mcp_servers.<name>] tables (user + project) via a minimal table reader; OpenCode opencode.json mcp (user + project). - MCP/settings source tables split into agent-config-file-sources.ts. Co-Authored-By: Claude Fable 5 <[email protected]>
…, keyed report per target, POSIX case, empty-state guard, web bridge forwards workspace identity only - readBoundedText swallows open/read errors so one EACCES file cannot fail the whole report; rule-file counting is recursive. - Report state is keyed to the discovery target: a workspace switch never shows or opens files from the previous workspace's report. - Path containment folds case only for Windows drive/UNC paths. - Instructions empty state waits for the report like the other sections. - Web preload shim forwards only cwd/worktreeId (never projectRuntime). - Refresh/checkbox use shadcn Button/Checkbox; ancestor tests assert the exact cap and the home-directory boundary; web bridge test added. Co-Authored-By: Claude Fable 5 <[email protected]>
…es it AgentCombobox (compact, 'All agents' when unset) lists only agents that read at least one row or own a skill root here; choosing one narrows every section. Skills map to agents through the discovery sources' owner (shared roots read by all), so ~/.grok/skills shows for Grok, not Claude. Co-Authored-By: Claude Fable 5 <[email protected]>
…ds and row meta, overflow-x-hidden on the scroll container Co-Authored-By: Claude Fable 5 <[email protected]>
…ession History pattern), Workspace/User/All scope, empty-location toggle moved into the menu
…er for agents and scope; Codex TOML reads multi-line arrays and env tables; hook drops its lint disable — tests for TOML reader, WSL target and stale-report guard
…ntime-aware target resolver, skills scanned at the worktree cwd; persisted view options module (not yet wired)
…— host label in the header, SSH/unresolved-runtime states, persisted view options (disabled-agent set, scope, section, empty-location toggle), 'hidden by filter' empty copy, present-only agent list Host is a fact of the workspace, not a lens: the header names it (runtime env / SSH target / local, plus WSL distro) instead of offering a picker.
…-context tab persists; ~/.claude.json narrowed to its MCP objects (no size-limit 'invalid'), project-local servers shadow user ones; AGENTS.md ancestors only for Codex-family up to the git root, Claude walks to home (case-insensitive on Windows); .vscode/mcp.json and project .gemini/settings.json; empty .cursor/rules is checked-but-empty; RPC, source-table and access-path routing tests
…tive path, home configs / plugin settings / skill files as authorized external files on local workspaces (WSL through the UNC mount); non-local workspaces keep only worktree opens
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/right-sidebar/WorkspaceContextPanel.test.tsx (1)
334-357: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a test for the authorization-rejection path.
This test covers only the success path of
openWorkspaceContextPath. The rejection path insrc/renderer/src/components/right-sidebar/workspace-context-open.ts(Lines 74-86) suppresses the open and shows a toast. That branch is security-relevant and is not covered. MakeauthorizeExternalPathreject in one test, then assert thattestState.openFilestays empty.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 02d3260f-76b0-4d7c-9871-5f95802adc9f
📒 Files selected for processing (30)
src/main/agent-context/agent-config-file-sources.tssrc/main/agent-context/agent-context-inspection.test.tssrc/main/agent-context/agent-context-inspection.tssrc/main/agent-context/agent-context-sources.tssrc/main/agent-context/agent-context-target.test.tssrc/main/agent-context/codex-mcp-toml.test.tssrc/main/agent-context/codex-mcp-toml.tssrc/main/agent-context/json-mcp-file.tssrc/main/persistence-right-sidebar-tab.test.tssrc/main/persistence/applying-settings/ui-selection-normalization.tssrc/main/runtime/rpc/methods/agent-context.test.tssrc/renderer/src/components/right-sidebar/AiVaultPanelControls.tsxsrc/renderer/src/components/right-sidebar/WorkspaceContextPanel.test.tsxsrc/renderer/src/components/right-sidebar/WorkspaceContextPanel.tsxsrc/renderer/src/components/right-sidebar/sidebar-scope-toggle.tssrc/renderer/src/components/right-sidebar/use-workspace-agent-context.test.tsxsrc/renderer/src/components/right-sidebar/use-workspace-agent-context.tssrc/renderer/src/components/right-sidebar/workspace-context-controls.tsxsrc/renderer/src/components/right-sidebar/workspace-context-header.tsxsrc/renderer/src/components/right-sidebar/workspace-context-model.tssrc/renderer/src/components/right-sidebar/workspace-context-open.test.tssrc/renderer/src/components/right-sidebar/workspace-context-open.tssrc/renderer/src/components/right-sidebar/workspace-context-rows.tsxsrc/renderer/src/components/right-sidebar/workspace-context-sections.tsxsrc/renderer/src/components/right-sidebar/workspace-context-target.tssrc/renderer/src/components/right-sidebar/workspace-context-view-options.test.tssrc/renderer/src/components/right-sidebar/workspace-context-view-options.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/web/web-preload-api-ui.test.tssrc/renderer/src/web/web-preload-api.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- src/renderer/src/web/web-preload-api.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/components/right-sidebar/workspace-context-rows.tsx
- src/renderer/src/components/right-sidebar/use-workspace-agent-context.ts
- src/main/agent-context/agent-context-inspection.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.
…nner mocked, panel test drives the reject branch and asserts the warning toast Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
ELI5
A new Agent context tab in the right sidebar shows, for the workspace you have open, everything the coding agents will load when they start: which
CLAUDE.md/AGENTS.md/GEMINI.md/ Cursor / Copilot instruction files apply (and from where), which skills are found, which MCP servers are configured, which hooks fire, and which plugins are on or off — with each row tagged by the agent(s) that read it. It can be narrowed by agent, by Workspace/User scope and by section (the same controls Session History has), says which host it read on, and every row opens in the editor. Read-only; nothing is changed on disk.What Changed
src/main/agent-context/: a source table (agent-context-sources.ts: per-agent instruction files at user / workspace / ancestor scope;agent-config-file-sources.ts: MCP config files and Claude settings files) and an inspector (agent-context-inspection.ts) returning anAgentContextReport.CLAUDE.md+CLAUDE.local.mdup to the home dir (Windows paths compared case-insensitively); Codex / OpenCode / Amp / Pi readAGENTS.mdfrom parents only up to the git root (nearest.git, file or dir); Cursor / Copilot read the workspace root only. Walk capped at 8 levels..mcp.json,.cursor/mcp.json,.vscode/mcp.json(servers),.claude/mcp.json,.codex/config.toml,opencode.json,.gemini/settings.json; user~/.claude.json,~/.cursor/mcp.json,~/.gemini/settings.json,~/.codex/config.toml,~/.config/opencode/opencode.json. JSON files use the sharedinspectMcpConfigContent;~/.claude.json(Claude's whole client state, routinely > 256 KiB) is parsed and only itsmcpServers/projects[cwd].mcpServersobjects are handed to the shared inspector, local names shadowing user ones (json-mcp-file.ts). Codex TOML gets a small reader for[mcp_servers.*]tables incl. multi-lineargsandenvsub-tables (codex-mcp-toml.ts).hooksandenabledPlugins(user → project → local, later file wins). A.cursor/rules/folder with no rule files is checked-but-empty, not "0 rules present".resolveSkillDiscoveryTarget, so native-host vs WSL is decided exactly as for skills; WSL reads go through the\\wsl.localhostmount with POSIX display paths.agentContext:inspectIPC +agentContext.inspectruntime RPC method + web-preload shim +runtime-agent-context-client.ts(local → IPC, environment → RPC, forwarding{cwd, worktreeId}only — same rule asdiscoverSkillsForRuntimeTarget). Skills are discovered at the worktree's cwd, so linked worktrees see their own checked-in skills.WorkspaceContextPanel(right-sidebar tabagent-context, persisted across restarts) with:use-workspace-agent-context.ts+workspace-context-target.ts: the report is read on the host that runs the workspace's agents (local / WSL project runtime / remote runtime env); SSH workspaces get an explicit "not available" state, an unresolved runtime an empty state; results are keyed to the target so a workspace switch never shows the previous one's files.Local Linux,Local Windows · WSL Ubuntu, runtime env name, SSH target id) — a fact of the workspace, not a picker.workspace-context-controls.tsx, mirroringAiVaultPanelControls): agent checkboxes (only agents that load something here are offered), Select all / Clear, "show locations that were checked but empty", Reset view. Scope switch Workspace / User / All (sharedsidebar-scope-toggle.tsclasses). Section strip All / Instructions / Skills / MCP / Hooks / Plugins. All persisted per client in localStorage (workspace-context-view-options.ts,disabledAgentsmodel like Session History's).workspace-context-open.ts): worktree files by relative path; files outside the worktree (home configs, plugin settings, home/pluginSKILL.md, MCP configs) viaauthorizeExternalPath+openFilewith local ownership pinned — the same pipeline as the tab-bar absolute-path open and Session History's View log — offered only when the workspace is local (createTabEntryAllowAbsolutePathsSelector); WSL paths mapped through the UNC mount.en.jsonkeys underauto.components.rightSidebar.WorkspaceContextPanel.*andauto.components.right.sidebar.index.agentContext.Why
Across several agents in one workspace there is no way to see what each will actually load; the answer is spread over
~/.claude,~/.codex,~/.gemini,~/.config/opencodeand the repo, under different vendor rules. This is the census that #13601 (enable/disable controls) needs underneath it, and it is useful on its own for "why is the agent ignoring my rule / which AGENTS.md won?". Read-only first: writes into vendor config files are a design decision for maintainers; enumeration is not.Linked Issue
Fixes #14874
Visual Proof
Before: no such tab (the activity bar ends at Checks/Ports). After, dark mode, on a workspace with Claude, Codex, Gemini, OpenCode, Cursor and Copilot configured (Linux, dev build under WSLg):
MCP section,
~/.claude.jsonopened in the editor from its row:Testing
pnpm devon Linux (WSL2/WSLg) and the Windows dev build against a WSL project: opened this repo, verified instruction files/sizes, skills, MCP files (incl. Codex TOML and the large~/.claude.json), hooks, plugins; agent / scope / section filters and their persistence across tab switches; opening worktree rows and home rows (~/.claude.json,~/.codex/config.toml) in the editor. Not exercised by hand: a remote runtime environment (rides the existing skill-discovery RPC plumbing; covered by the RPC method test).src/main/agent-context/agent-context-inspection.test.ts(per-agent rows incl. the git-root ancestor policy, empty rules dir, hooks/plugin precedence, MCP home+project via the shared inspector, oversized~/.claude.json, local-shadows-user, access-path routing for WSL,buildMcpFileSourcesmapping),agent-context-target.test.ts,codex-mcp-toml.test.ts,src/main/runtime/rpc/methods/agent-context.test.ts,persistence-right-sidebar-tab.test.ts; renderer:WorkspaceContextPanel.test.tsx(host label, SSH/unresolved states, filters, hidden-by-filter copy, view-option persistence across remount, relative + external opens, no external opens off-local),use-workspace-agent-context.test.tsx,workspace-context-view-options.test.ts,workspace-context-open.test.ts.AI Disclosure
Built with Claude Code (Claude Fable 5), reviewed and driven by the author.
Review
node:path(posix for WSL targets); the WSL branch is Windows-only by construction (resolveSkillDiscoveryTargetthrows otherwise). No shortcuts added.border-border/text-muted-foreground.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — lint/typecheck/test as above;pnpm buildleft to CIAuthor