Repository navigation
Description
The workflow
I run one bb with ~20 enabled plugins and use it for very different kinds of work: bb development, agency/orchestration, SEO, and client work. Plugins are installed and enabled app-wide, which is right for their UI, services and CLI. But every enabled plugin also enters every agent session on every project: its instructions, its dynamic tools, its skills.
For some work I want a plugin to be enabled globally but absent from the agent sessions of one project, or of one sub-directory inside a project. Example: in a Clients/ folder the agent should not see the Agency plugin's delegation instructions, workflow tools or the bb Connect hint. The session there should not know those plugins exist. The plugin keeps running for every other project.
I also maintain a plugin (bb-plugin-project-folders) that organizes projects into nested section folders with inherited per-section rules. It is the natural place for a user to say "in this section, these plugins are off". Today it cannot do that.
What happens today
Observed on bb 0.43.1 (commit 267938526), provider claude-code, macOS.
A fresh thread in a plain project folder receives separate blocks from agency, bb-guide, connect, env-catalog, memory, md-editor, project-folders and workflows, plus their tools and skills. None of these can be removed for that project without disabling the plugin for the whole app.
Session context is assembled in resolveThreadRuntimeCommandConfig, and every contribution is already attributed to a pluginId:
- plugin skill selections: thread-runtime-config.ts#L211-L215
- dynamic tools and their tool-scoped instructions: #L220-L237
- static plugin instructions: #L238-L264
- dynamic instructions from
bb.agents.configure(): #L265-L270
What a plugin can do today:
bb.agents.configure(ctx)returns only that plugin's tools, skills and instructions. A plugin can withhold itself, but it cannot scope another plugin out.- Static instruction providers receive only
{ threadId, projectId }(plugin-agent-contributions.ts#L65-L70). Scoping has to be reimplemented in every plugin, and third-party plugins won't do it. bb plugin disable <id>is app-wide and unloads the plugin's code.
What you would expect
1. Core concept: a plugin can be enabled but out of agent scope for a project
Add a per-project setting: plugins excluded from agent sessions. The plugin stays enabled (UI, services, CLI, schedules keep working), but for threads in that project the runtime config resolver drops everything attributed to the plugin:
- static instructions,
configure()dynamic instructions and tool-scoped instructions; - dynamic tools, including a rejection at invoke time, so a tool name the model remembers or guesses cannot be called;
- plugin skill roots and selections.
The check runs when session config is resolved, not when the thread is created, so changing the setting applies from the next session start for every thread in the project, however it was created.
Possible surface: a "Plugins in agent sessions" list in project settings, and bb plugin scope <id> --project <projectId> --exclude|--include.
This overlaps with the "bonus" in #1255 ("globally installed extensions … individually enabled/disabled per project"), limited to the agent-context layer and without needing repo-scoped extensions first.
2. Extension point: let a plugin supply the scope for a session
Projects are too coarse for directory-based organization: one project folder can contain sections with different needs. Proposed hook, shaped like message.dispatch, a decision rather than a mutation:
bb.experimental_hooks.on("agent.context", (ctx) => {
// ctx: PluginAgentConfigurationContext (thread, project, environment.path, host, provider, origin)
return { excludePluginIds: ["agency", "workflows"] };
});Guardrails I'd expect core to own:
- Decisions only narrow the session. A hook can exclude plugins, never add or rewrite another plugin's contributions.
- The result is visible: thread details (or
bb thread show) lists which plugins were scoped out and by which plugin, so a missing tool is never a mystery. - Core decides which plugins can't be excluded (for example builtin safety plugins such as tool approval). Results from several hooks are combined as a union.
- A throwing or slow hook falls back to the project setting from (1) and logs a warning, like instruction providers do today.
With (1) alone, users get project-level control. With (2), directory/section plugins like project-folders can provide per-section switches with inheritance, and core's filtering stays the only enforcement point.
Context and alternatives
- Each plugin self-gates in its own
configure(). Works only for plugins you control, and static instruction providers don't get the environment path. It doesn't scale to third-party or builtin plugins. - Disable the plugin app-wide. Breaks every other project that needs it.
- Per-thread allowlist at creation. In a local fork we prototyped a thread-create allowlist (
instructionPluginIds/dynamicToolNames/skillIds) for isolated agent launches. It works for its purpose but is the wrong layer here: it is fixed at creation, doesn't cover threads created from the normal composer, and forces allowlisting everything instead of excluding a few plugins. - Related: Plan out how to support repo scoped extensions #1255 (project-scoped extensions), Shrink always-on context (~1.2k tokens/thread) to a 20-token line; load bb-dev context cwd-scoped via update_environment_directory #2709 (always-on context cost; notes that plugin instruction contributions are additive-only), Expose exact-session effective plugin tool-catalog attestation before attempt activation #2608 (effective plugin tool catalog per session; the "scoped out" list would belong there too).
- Out of scope: the provider's own plugins and MCP servers (for example Claude Code
enabledPlugins), which are configured outside bb.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 17, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied and verified: Type Feature, Priority Medium, Effort High, label plugins. All classifications were missing; no existing values were replaced.
This adds plugin scoping behavior and a public policy extension point. Medium priority reflects a meaningful workflow limitation with workarounds; High effort reflects the new policy design, settings, and enforcement surfaces.
No reproduction report or pull request: this is a feature requiring product and architecture decisions, outside the simple bug-fix path.
VKirill commentedon Sep 24, 2026
Superseded by #4233, which covers this request together with #4043 as one session-policy extension point, with a working prototype on a fork and an integration guide.