From 81dbc4bc160497d245608163bade319fc3f099cd Mon Sep 17 00:00:00 2001 From: mantarayDigital Date: Thu, 8 Jan 2026 07:19:51 +0200 Subject: [PATCH] fix: Update start.sh to use correct Claude CLI auth detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous credential check looked for ~/.claude/.credentials.json, which no longer exists in recent versions of Claude CLI. This caused the script to incorrectly prompt users to login even when they were already authenticated. Changes: - Remove check for non-existent .credentials.json file - Check for ~/.claude directory existence instead - Always remind users about 'claude login' since we can't verify auth status without making an API call - If ~/.claude doesn't exist, pause and warn (but allow continuing) - Add explanatory comments about the limitation The new approach is honest about what we can and can't verify: - We CAN check if the CLI is installed (command -v claude) - We CAN check if ~/.claude directory exists (CLI has been run) - We CANNOT verify actual auth status without an API call 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- start.sh | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/start.sh b/start.sh index d90c097..c54caee 100644 --- a/start.sh +++ b/start.sh @@ -20,40 +20,18 @@ fi echo "[OK] Claude CLI found" -# Check if user has credentials -CLAUDE_CREDS="$HOME/.claude/.credentials.json" -if [ -f "$CLAUDE_CREDS" ]; then - echo "[OK] Claude credentials found" +# Note: Claude CLI no longer stores credentials in ~/.claude/.credentials.json +# We can't reliably check auth status without making an API call, so we just +# verify the CLI is installed and remind the user to login if needed +if [ -d "$HOME/.claude" ]; then + echo "[OK] Claude CLI directory found" + echo " (If you're not logged in, run: claude login)" else - echo "[!] Not authenticated with Claude" + echo "[!] Claude CLI not configured" echo "" - echo "You need to run 'claude login' to authenticate." - echo "This will open a browser window to sign in." + echo "Please run 'claude login' to authenticate before continuing." echo "" - read -p "Would you like to run 'claude login' now? (y/n): " LOGIN_CHOICE - - if [[ "$LOGIN_CHOICE" =~ ^[Yy]$ ]]; then - echo "" - echo "Running 'claude login'..." - echo "Complete the login in your browser, then return here." - echo "" - claude login - - # Check if login succeeded - if [ -f "$CLAUDE_CREDS" ]; then - echo "" - echo "[OK] Login successful!" - else - echo "" - echo "[ERROR] Login failed or was cancelled." - echo "Please try again." - exit 1 - fi - else - echo "" - echo "Please run 'claude login' manually, then try again." - exit 1 - fi + read -p "Press Enter to continue anyway, or Ctrl+C to exit..." fi echo ""