anthropics / anthropics/claude-code-action

Broken CLAUDE_WORKING_DIR support

Open
#315 0 comments 10 reactions 0 assignees View on GitHub
bug p1
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

**Describe the bug**
The claude-code-action supports setting `CLAUDE_WORKING_DIR` to switch to a different directory before running claude. This is important for monorepos or repositories with nested CLAUDE.md files, to ensure the CI job picks up all the relevant context.

This worked by explicitly cd'ing to `$CLAUDE_WORKING_DIR` before running claude. This code still exists in the base action: https://github.com/anthropics/claude-code-action/blob/main/base-action/action.yml#L124-L128

However, after the changes in https://github.com/anthropics/claude-code-action/pull/285 the working directory is onl set in the "inner" action, but not when running the "outer" action, resulting in claude being run from the top-level directory always.

I believe the cd to `$CLAUDE_WORKING_DIR` should be moved from the base action to the outer action to fix this.

**Expected behavior**
Claude should run in `$CLAUDE_WORKING_DIR`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.