Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,4 @@ jobs:
repo: ${{ github.repository }}
pr-number: ${{ github.event.pull_request.number || github.event.issue.number }}
github-token: ${{ secrets.GITHUB_TOKEN }}
review-result: ${{ needs.review.result }}
19 changes: 19 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,36 @@ jobs:
with:
repository: shellhub-io/claude
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
fetch-depth: 1
path: claude

- name: Setup workspace context
run: |
"$GITHUB_WORKSPACE/claude/workspace.sh" sync -w "$GITHUB_WORKSPACE" --project shellhub

- name: Verify the workspace config is readable
run: |
for file in \
"$GITHUB_WORKSPACE/claude/CLAUDE.md" \
"$GITHUB_WORKSPACE/claude/shellhub/CLAUDE.md" \
"$GITHUB_WORKSPACE/claude/.claude/rules/code-style.md" \
"$GITHUB_WORKSPACE/claude/.claude/skills/code-review/SKILL.md"; do
if [[ ! -f "$file" ]]; then
echo "::error::Workspace config not found at $file"
exit 1
fi
done

- name: Run Claude
timeout-minutes: 60
uses: anthropics/claude-code-action@8251c103ac8c1d761882c86aba1412c7f583c844 # v1
env:
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: "1"
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
trigger_phrase: "@claude"
claude_args: |
--add-dir ${{ github.workspace }}/claude

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standards (judgement call) — writing-for-agents: "Check every line for relevance: does it still bear on what the document does? A line loses relevance by never bearing on the task … or by going stale as the behaviour or world it describes changes."

This line plus CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 loads claude/CLAUDE.md — the workspace-root memory that the step right above deliberately does not install here. workspace.sh:145-151 picks the project file instead when --project is set:

# In CI, we link the project-specific CLAUDE.md (e.g., claude/shellhub/CLAUDE.md)
# instead of the root one, since the workspace root IS the project checkout.
local claude_md="$SCRIPT_DIR/CLAUDE.md"
if [[ -n "${sync_project:-}" ]]; then
    claude_md="$SCRIPT_DIR/$sync_project/CLAUDE.md"
fi

The env var reaches every added dir, so --add-dir .../claude brings that file back through a side channel. Its Projects table is the part that has gone stale for this job's layout — the checkout at line 62 has no path:, so the workspace root is the shellhub checkout, while cloud/ and claude/ are nested under it:

Row In this job
ShellHub → shellhub/ wrong — no such directory
Cloud → cloud/, Claude → claude/ correct
Connect → connect/, Docs → docs/, Team → team/ not checked out

So the session gets the lead row asserting a path that does not exist, sitting next to claude/shellhub/CLAUDE.md, which correctly assumes root-as-checkout. Concrete cost: an @claude run that takes the table at face value goes looking under shellhub/ for files that are at the root.

Worth noting the obvious fix is not dropping this line. On PR runs restoreConfigFromBase wipes the root .claude/ before the session starts, so --add-dir .../claude is exactly what delivers the rules and skills — remove it and you reopen the bug. The stale table is a claude/CLAUDE.md problem, so the fix belongs in shellhub-io/claude#65: scope that table, or note that in CI the workspace root is the project checkout.

--add-dir ${{ github.workspace }}/claude/shellhub
Loading