GitHub sees a raw curl request with just a bare token, their security systems might flag it as suspicious, especially if there were previous authentication issues (like from Claude Code). The CLI also manages token refresh and might be using a slightly different auth flow under the hood, even though it's technically the same PAT. Try mimicking GitHub CLI's exact headers with curl - including User-Agent