Claude Code (CLI) on Cornell's AI Gateway

Summary

Install Claude Code and point it at Cornell's AI gateway. Mac & PC.

Body

Claude Code (CLI) — Mac & PC

This guide installs Claude Code, the command-line version of Claude, and connects it to Cornell's AI gateway.

Before you start, have your prerequisites ready — especially your personal key. See Using Claude on Cornell's AI Gateway — Start Here if you haven't gotten one yet.

Follow only the column for your computer.


Step 1 — Install Claude Code

⚠️ You may be prompted for admin permission. On a PC, approve with your local administrator account. On a Mac, open Self Service and grant temporary admin rights first.

🍎 Mac

Open the Terminal app (press Cmd + Space, type "Terminal", press Enter), then paste this and press Enter:

curl -fsSL https://claude.ai/install.sh | bash

macOS Terminal showing the install command finishing successfully

🪟 PC

Open PowerShell (press the Start button, type "PowerShell", press Enter), then paste this and press Enter:

irm https://claude.ai/install.ps1 | iex

Windows PowerShell showing the install command finishing successfully

💡 Windows note: you do not need to install Git or "Git for Windows" first. Claude Code runs on Windows on its own (it uses PowerShell for any shell commands). Git for Windows is optional — add it later only if you'll have Claude run Bash-style commands.

When it finishes, close and reopen your Terminal / PowerShell window so the claude command is recognized.


Step 2 — Add your Cornell gateway settings

Claude Code reads its settings from a file called settings.json in your home folder. You'll create it once.

🍎 Mac

In Terminal, paste this and press Enter to open the file in a simple editor:

mkdir -p ~/.claude && nano ~/.claude/settings.json

🪟 PC

In PowerShell, paste this and press Enter:

mkdir "$env:USERPROFILE\.claude" -Force; notepad "$env:USERPROFILE\.claude\settings.json"

(If Notepad asks whether to create a new file, click Yes.)

Both — paste this in, then replace the key

Copy the entire block below into the file. Change only the PASTE-YOUR-KEY-HERE part — replace it with your personal key (it looks like sk-…).

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.ai.it.cornell.edu",
    "ANTHROPIC_AUTH_TOKEN": "PASTE-YOUR-KEY-HERE",
    "ANTHROPIC_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY": "1",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
  }
}

settings.json open in an editor with the key value highlighted

Save and close:

  • Mac (nano): press Ctrl + O, then Enter to save, then Ctrl + X to exit.
  • PC (Notepad): File → Save, then close the window.

What these settings do: the first lines point Claude at Cornell's gateway and your key. The last two lines turn off optional telemetry, auto-updates, and experimental features. Full explanation: Privacy — What We Turned Off and Why.


Step 3 — Start Claude and confirm it works

In your Terminal / PowerShell window, type:

claude

Ask it something simple, like Say hello. If it replies, you're connected. 🎉

To see the Cornell models, type /model and press Enter — you should see claude-sonnet-4-6, claude-opus-4-8, and claude-haiku-4-5.

claude running, with the /model picker showing the three Cornell models


How do I know it worked?

  • Claude answered your prompt without asking you to log in to a personal account.
  • /model lists the three Cornell models.
  • Optional: run claude doctor for a configuration health check.

If anything failed, see Claude on Cornell's Gateway — Troubleshooting.


Want Claude inside VSCode too? You're already set up — just add the extension. See Claude Code in VSCode on Cornell's AI Gateway.

Details

Details

Article ID: 8241
Created
Tue 6/23/26 10:59 AM
Modified
Wed 6/24/26 11:56 AM

Related Articles

Related Articles (2)

Set up the point-and-click Claude Desktop app in Cowork third-party-inference mode through Cornell's gateway.
Pick your path (CLI, VSCode, or Desktop) and gather the gateway address, your key, and the model names.