Repository navigation
Conversation
Claude Code declares --add-dir <directories...>, so the flag can repeat and the space form takes several words. parseCliArgs kept one value per flag, so launches passed only the last directory and skill discovery scanned only that one. Read every value with claudeLaunchArgDirectories and send them through the SDK's additionalDirectories. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused fix that preserves the default Claude path while correctly forwarding every explicitly configured --add-dir directory and discovering skills from those locations. The production change is localized and covered by targeted tests, with no schema, deployment, or static-analysis configuration impact. You can add or adjust custom eligibility rules. Learn more. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
…y-in-l Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
The
claudeCLI declares--add-dir <directories...>. The flag can repeat, and its space form takes several directories: the CLI's own example isclaude --add-dir ../apps ../lib. If you put that in Settings → Providers → Claude → Launch arguments, T3 keeps only one directory.The cause is
parseCliArgs, which stores one value per flag. A repeated--add-dirkeeps only its last value, and the extra words of the space form become positionals that nothing reads. Two things break:.claude/skillsare missing from the$and/menus.The SDK's
extraArgsis aRecord<string, string | null>, so it can't carry a second--add-dirvalue anyway.Change
claudeLaunchArgDirectories(inClaudeSkills.ts) reads every--add-dirvalue the way the CLI does: repeated flags, the=form, and each word after the flag until the next option or--. It uses the existingtokenizeCliArgs, so quoting works as before.discoverClaudeSkillsscans each of those directories, with the same relative-path rule as before.makeClaudeQueryOptionstakesadd-dirout ofextraArgs, the same way it already handlesappend-system-prompt. It adds the directories to the SDK's typedadditionalDirectoriesafter the cwd and the attachments directory. The SDK sends each entry as its own--add-dirargument, and relative paths still resolve against the session cwd.A bare
--add-dirwith no directory after it now adds nothing.Size: +39/−16 production lines in two files. Tests: two new launch-arg rows in the existing discovery test and one new
makeClaudeQueryOptionstest.Scope and approval
This is a focused bug fix for an existing setting. No issue covers the multi-directory case. #20156 reported that skills from
--add-dirwere missing from the menus, and #20167 fixed that for one directory. This PR extends the same path to every directory the CLI accepts. Two open PRs touch nearby lines. #21336 makesparseCliArgsstop at--, and the new helper also stops there. #22864 handles--settings, and its diff still applies cleanly on this branch.Verification
New tests against main's source, then on the branch:
I ran the real app on Linux, using production builds of
mainand this branch (vp buildfor web,vp packfor server). Each run had fresh state and its own HOME. Claude was the realclaudeCLI binary, version 2.1.306.ANTHROPIC_BASE_URLpointed it at a local Messages API stub, with a placeholder key, so no account was used. Both builds used the same launch arguments, and each of the two directories held one skill:Typing
$in a Claude thread:Next I sent a message. While the turn ran I read the
--add-dirarguments of the running Claude process, and I also read the environment block Claude sent to the stub. On main,../shared-bis missing from both. On the branch, both directories reach Claude.Other checks on the branch:
ClaudeSkills.test.tsandClaudeAdapterV2.test.ts: 228 passed. The existing--add-dir missing --add-dir "<dir>"row still passes.layerinClaudeAdapterV2.ts, is already on main.Not checked:
--allowedToolsand--disallowedToolslose extra words through the same parser. That is a separate change.Prior PRs
#20167 by @ScottN-PV made skill discovery read
--add-dirfrom launch args, for issue #20156 by @Young-caveman. This PR keeps that discovery path and reads every directory instead of one.Production fix, tests, PR description and images written with Claude Opus 5.5 in T3 Code Nightly.
🤖 Generated with Claude Opus 5.5 in T3 Code Nightly