Skip to content

feat: resolve Claude Code plugins from settings and pass to Agent SDK#1677

Open
42tg wants to merge 1 commit intopingdotgg:mainfrom
42tg:feat/claude-plugins-resolution
Open

feat: resolve Claude Code plugins from settings and pass to Agent SDK#1677
42tg wants to merge 1 commit intopingdotgg:mainfrom
42tg:feat/claude-plugins-resolution

Conversation

@42tg
Copy link
Copy Markdown

@42tg 42tg commented Apr 2, 2026

Summary

  • Parse Claude Code plugin definitions from server settings (MCP servers, permissions)
  • Resolve plugin configs and pass them to the Claude Agent SDK adapter
  • Add @t3tools/shared/claude-plugins subpath export with plugin resolution logic
  • Add server-side plan mode tool enforcement in Claude adapter

Test plan

  • Configure an MCP server in settings and verify it's passed to Claude sessions
  • Verify plan mode enforces tool restrictions correctly

Note

Medium Risk
Introduces filesystem-driven plugin resolution and passes local plugin paths into the Claude runtime, which can change execution behavior and is sensitive to misconfiguration or unexpected local state.

Overview
Claude Agent sessions now automatically load Claude Code plugins enabled in .claude/settings*.json by resolving each enabled plugin key to its local cache directory under ~/.claude/plugins/cache and passing those paths to the Agent SDK via ClaudeQueryOptions.plugins.

This adds a new @t3tools/shared/claude-plugins export with filesystem-based settings parsing and cache version selection (skipping missing/orphaned versions), and wires it into ClaudeAdapter at session start (using cwd when provided).

Written by Cursor Bugbot for commit 7aec532. This will update automatically on new commits. Configure here.

Note

Resolve Claude Code plugins from settings and pass them to the Agent SDK

  • Adds a new claude-plugins module that reads enabledPlugins from user, project, and local Claude settings files, merges them in priority order, and resolves each to a concrete filesystem path under ~/.claude/plugins/cache/.
  • The active plugin version is determined by finding the newest non-orphaned subdirectory in the cache.
  • ClaudeAdapter now calls resolveEnabledPlugins before building ClaudeQueryOptions and passes resolved plugins as local SDK plugin descriptors via the plugins field.

Macroscope summarized 7aec532.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 26d94f8e-26db-4d04-bf53-76449bbc4227

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@42tg 42tg force-pushed the feat/claude-plugins-resolution branch from 114316c to 7aec532 Compare April 2, 2026 10:39
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 2, 2026

Approvability

Verdict: Needs human review

This PR introduces a new feature that enables plugin loading by reading settings files and passing resolved plugin paths to the Claude Agent SDK. Since this activates new runtime behavior (loading external plugin code that wasn't previously being passed to the SDK), human review is recommended.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant