Repository navigation
Conversation
Claude Code, Codex and Pi each declared their default home's skills directory (~/.claude/skills, ~/.codex/skills, ~/.pi/agent/skills) as a static user root and also resolved the configured home's directory. The listing scans both, so with CLAUDE_CONFIG_DIR, CODEX_HOME or PI_CODING_AGENT_DIR set, the composer, Skills page and `bb skill list` offered skills from a directory the agent no longer reads. The resolvers now own those roots (Pi's resolver always answers its agent dir) and the declarations keep only home-independent roots such as ~/.agents/skills. The native-roots goldens no longer expect the stale default-home skills for moved homes. Fixes #3926 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Listing a project's provider skills and commands asks the provider's host entry to resolve its native roots, but the plugin host call always resolved machine environment with projectId null. A project-scoped CLAUDE_CONFIG_DIR, CODEX_HOME or PI_CODING_AGENT_DIR therefore reached the project's turns and terminals but not the composer's / menu, the Skills page, `bb project commands` or `bb skill list`. The project command workspace now carries its project id, plugin host calls take an explicit projectId (null for calls a plugin makes itself), and the native-roots cache is keyed by project. Fixes #3925 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The usage and health check read ~/.claude/.credentials.json, ~/.claude.json and the "Claude Code-credentials" Keychain item no matter where CLAUDE_CONFIG_DIR pointed, so a signed-in profile reported "expired" whenever the default profile held a stale token. With CLAUDE_CONFIG_DIR set, Claude Code stores its login under "Claude Code-credentials-<first 8 hex of sha256(CLAUDE_CONFIG_DIR)>", <dir>/.credentials.json and <dir>/.claude.json; the check now reads exactly those. The Claude config directory is resolved once, by the SDK's experimental_resolveClaudeConfigDir (previously private to experimental_resolveClaudePluginRoots). Session forks and skill filtering used two other copies with different rules (no trim, no ~, relative to cwd; skill filtering ignored the session's env); both are deleted. The credential test's execFile mock now uses Node's callback signature, so its Keychain cases exercise the Keychain path. Fixes #3607 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lugin Host workers share process.env across overlapping calls, so a project-scoped native-root resolve could read another project's CLAUDE_CONFIG_DIR or CODEX_HOME. Host calls now carry their exact environment as context.experimental_env, and the Claude, Codex, Pi and ACP resolvers plus Codex helper inference read it. Provider-path lookups no longer fail global skill install, status or the server-move check when one plugin is missing or broken; that plugin's paths are left out and logged. Install wakes a suspended machine before asking, and each flow shares one deadline across the lookup and the daemon command. A CLAUDE_CONFIG_DIR or CODEX_HOME relative to each session's cwd contributes no machine-wide path. Absolute-path checks move into the wire schemas, Pi reuses one stored-path resolver, and stale Claude bridge imports are removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/swing-2b-provider-config-folders-thr_s3wyu7n866
branch
from
October 28, 2026 22:11
f8ec96e to
01792e6
Compare
Collaborator
Author
|
Closing in favour of a smaller fix inside the Claude Code plugin only (no protocol bump, no SDK changes). The provider-paths plumbing and project-env listing (#3925) are out of scope.
|
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Each provider's config folder (
CLAUDE_CONFIG_DIR,CODEX_HOME,PI_CODING_AGENT_DIR) was worked out in several places that disagreed: Claude's alone four ways with three behaviours,resolveCodexHomethree times. Core also computed provider folders itself (the daemon installed bb's skills into~/.claude/skillsregardless ofCLAUDE_CONFIG_DIR; server move resolvedCODEX_HOME). So a relocated profile listed the default folder's skills too (#3926), project-scoped settings were ignored when listing skills and commands (#3925), the usage check reported a signed-in account as expired (#3607), and a relativeCLAUDE_CONFIG_DIRmade fork look in the wrong place.What changed
src/config-home.tsof the Claude Code, Codex and Pi plugins, resolved with the environment of the process being configured. Claude paths follow the Claude SDK's semantics (relative to the workspace cwd, no~expansion); Pi keeps its~expansion.internal_DO_NOT_USE_providerPathsHostContract): both consumers enumerate registered providers advertisinginternal_DO_NOT_USE_resolvesProviderPaths, call each plugin once, and combine/deduplicate its paths. Today Claude contributes writable skill install roots and Codex contributes credential files; the other lists are empty, preserving current destinations. Core names no providers. Server move still only checks and warns; it does not copy credentials. Documented indocs/api_to_audit.mdwith its only callers.process.envacross overlapping calls (the first call's values win), so each host call now also receives its exact environment ascontext.experimental_env(SDK, documented in the Plugin Guide anddocs/api_to_audit.md). The Claude, Codex, Pi and ACP resolvers and Codex helper inference read it, so overlapping projects can't read each other's profile.CLAUDE_CONFIG_DIR/CODEX_HOMErelative to each session's cwd contributes no machine-wide path. Absolute-path checks live in the wire schemas..claude/.codex/.pi/agentpaths outside the owning plugin. Four allowlisted entries, each with a reason: ACP's single local Claude compatibility copy for Grok/omp (ACP is forkable and can't import another plugin; its omp Codex/Pi copies are excluded explicitly), Claude's legacy~/.claude/local/claudeexecutable, and Grok's fixed~/.claude/pluginsregistry.HOST_DAEMON_PROTOCOL_VERSION257 → 259 (258 is taken by Share one question-form translator for ACP and Codex and support optional questions #6476). Plugin SDK 0.6.99.Visible behaviour changes
.agents/skillsroots remain.~expansion; empty means cwd, unset means~/.claude.CLAUDE_CONFIG_DIR; copies in an old profile are left alone.How you verified
experimental_env. Server tests cover install going through when one provider plugin fails, and a suspended machine waking (both fail on the previous head). There are contract tests rejecting relative provider paths, and plugin tests for relative profiles. Typecheck passes across all 86 affected packages. Tests pass for the contract, SDK, Claude/Codex/Pi/ACP plugins, the daemon plugin-host/global-skill/server-move suites, 21 affected server files (128 tests), and the purity guard.The Codex app-server environment change (#4960) is in #6479, not here.
Fixes #3926
Fixes #3925
Fixes #3607
🤖 Generated with Claude Code