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.
This commit is contained in:
km-anthropic
2025-08-14 15:10:13 -07:00
parent 7ccb615087
commit 3005c85cee

View File

@@ -81,7 +81,9 @@ export async function setupClaudeCodeSettings(
} }
// Copy subagent files from repository to Claude's agents directory // 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`; const targetAgentsDir = `${home}/.claude/agents`;
try { try {