Skip to content

Conversation

@saba-ch
Copy link

@saba-ch saba-ch commented Jan 26, 2026

Use pinned version npx @anthropic-ai/claude-code@2.1.17 instead of global claude command. fixes: #56

Use pinned version npx @anthropic-ai/claude-code@2.1.17 instead of global claude command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@greptile-apps
Copy link

greptile-apps bot commented Jan 26, 2026

Greptile Overview

Greptile Summary

This PR updates ralph.sh to use npx @anthropic-ai/claude-code@2.1.17 instead of the global claude command, ensuring version consistency across environments.

Key Changes:

  • Replaced claude with npx @anthropic-ai/claude-code@2.1.17 on line 95
  • Pins Claude Code to version 2.1.17, preventing version drift between environments
  • Eliminates the need for global installation of @anthropic-ai/claude-code

Benefits:

  • Guarantees all users run the same version of Claude Code
  • Simplifies setup (no global install required)
  • Makes the script more portable and reproducible

Note: The README.md still lists global installation as a prerequisite and should be updated to reflect this change.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a straightforward improvement that replaces a global command with a pinned npx version. The modification is minimal (single line change), well-scoped, and directly addresses issue API Error: 400 due to tool use concurrency issues. #56 about version consistency. No logic changes or breaking modifications were made.
  • No files require special attention. The only follow-up needed is updating README.md to remove the outdated global installation prerequisite.

Important Files Changed

Filename Overview
ralph.sh Changed from global claude command to pinned npx @anthropic-ai/claude-code@2.1.17 for version consistency

Sequence Diagram

sequenceDiagram
    participant User
    participant ralph.sh
    participant npx
    participant claude-code
    participant CLAUDE.md

    User->>ralph.sh: Execute ./ralph.sh --tool claude
    ralph.sh->>ralph.sh: Parse arguments (TOOL=claude)
    ralph.sh->>ralph.sh: Initialize iteration loop
    
    loop Each iteration (max MAX_ITERATIONS)
        ralph.sh->>ralph.sh: Check TOOL == "claude"
        ralph.sh->>npx: npx @anthropic-ai/claude-code@2.1.17
        Note over npx: Downloads/uses pinned version 2.1.17
        npx->>claude-code: Launch claude-code@2.1.17
        claude-code->>CLAUDE.md: Read instructions via stdin
        CLAUDE.md-->>claude-code: Agent instructions
        claude-code->>claude-code: Execute autonomous coding tasks
        claude-code-->>ralph.sh: Return OUTPUT with logs
        ralph.sh->>ralph.sh: Check for completion signal
        alt Tasks complete
            ralph.sh->>User: Exit with success
        else Tasks incomplete
            ralph.sh->>ralph.sh: Continue to next iteration
        end
    end
    
    ralph.sh->>User: Exit (max iterations or complete)
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

else
# Claude Code: use --dangerously-skip-permissions for autonomous operation, --print for output
OUTPUT=$(claude --dangerously-skip-permissions --print < "$SCRIPT_DIR/CLAUDE.md" 2>&1 | tee /dev/stderr) || true
OUTPUT=$(npx @anthropic-ai/claude-code@2.1.17 --dangerously-skip-permissions --print < "$SCRIPT_DIR/CLAUDE.md" 2>&1 | tee /dev/stderr) || true
Copy link

Choose a reason for hiding this comment

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

Check that README.md is updated - it still mentions npm install -g @anthropic-ai/claude-code as a prerequisite (line 15), but global installation is no longer required since this uses npx with a pinned version.

Prompt To Fix With AI
This is a comment left during a code review.
Path: ralph.sh
Line: 95:95

Comment:
Check that `README.md` is updated - it still mentions `npm install -g @anthropic-ai/claude-code` as a prerequisite (line 15), but global installation is no longer required since this uses `npx` with a pinned version.

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Error: 400 due to tool use concurrency issues.

1 participant