#!/usr/bin/env bun /** * ============================================================ * PROOF: Anthropic is specifically blocking "OpenCode" * in Claude Code OAuth system prompts * ============================================================ * * Video covering this script here: https://www.youtube.com/watch?v=G9YX6StP2-M * * This script demonstrates that Anthropic has specifically blocked * the phrase "You are OpenCode" in system prompts when using Claude's * OAuth tokens (Pro/Max subscription), while allowing other identity * statements like "You are Cursor", "You are Pi", etc. * * OpenCode (https://opencode.ai) is an open-source AI coding assistant. * * SETUP: * mkdir test-anthropic && cd test-anthropic * bun init -y * bun add @openauthjs/openauth * # Copy this file as opencode.ts * bun opencode.ts * * REQUIREMENTS: * - Bun runtime (https://bun.sh) * - Claude Pro or Max subscription * * HOW IT WORKS: * 1. Authenticates via OAuth using your Claude Pro/Max account * 2. Tests various system prompts against the Claude API * 3. Shows which prompts are blocked vs allowed * * FINDINGS: * - First system block MUST be exactly: * "You are Claude Code, Anthropic's official CLI for Claude." * - Second block can contain almost anything EXCEPT: * "You are OpenCode" or "You are opencode" * - Other identity statements work fine (Cursor, Pi, Droid, etc.) * * This appears to be targeted blocking of a specific competitor. */ import * as readline from "node:readline"; import { generatePKCE } from "@openauthjs/openauth/pkce"; const CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e"; const CC_HEADER = "You are Claude Code, Anthropic's official CLI for Claude."; const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); function prompt(question: string): Promise<string> { return new Promise((resolve) => { rl.question(question, (answer) => { resolve(answer); }); }); } // ============ OAuth Functions ============ async function authorize() { const pkce = await...
First seen: 2026-01-15 01:13
Last seen: 2026-01-15 03:14