From 3005c85ceec25f193627ec91e61f8aa8dd8e8e22 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Thu, 14 Aug 2025 15:10:13 -0700 Subject: [PATCH] Fix: Use CLAUDE_WORKING_DIR to correctly locate subagent files The previous fix was looking in the wrong directory. Now uses CLAUDE_WORKING_DIR environment variable which points to the repository being processed, ensuring subagent files are found correctly. --- base-action/src/setup-claude-code-settings.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base-action/src/setup-claude-code-settings.ts b/base-action/src/setup-claude-code-settings.ts index a341a4f..74acef7 100644 --- a/base-action/src/setup-claude-code-settings.ts +++ b/base-action/src/setup-claude-code-settings.ts @@ -81,7 +81,9 @@ export async function setupClaudeCodeSettings( } // Copy subagent files from repository to Claude's agents directory - const repoAgentsDir = `${process.cwd()}/.claude/agents`; + // CLAUDE_WORKING_DIR is set by the action to point to the repo being processed + const workingDir = process.env.CLAUDE_WORKING_DIR || process.cwd(); + const repoAgentsDir = `${workingDir}/.claude/agents`; const targetAgentsDir = `${home}/.claude/agents`; try {