Claude Code is Anthropic’s official command-line interface for Claude, providing direct AI assistance from your terminal for software development, code analysis, and programming tasks.
LLM Model
We are using the GLM model (by Z.AI) instead of Anthropic’s default for Claude Code. The API is served through our own gateway at https://claude.matsci.dev/api.
Installation
System Requirements
OS: macOS 10.15+, Ubuntu 20.04+/Debian 10+, or Windows 10+ (with WSL/Git for Windows)
Hardware: 4GB+ RAM
Software: Node.js 18+ (for NPM installation)
Network: Internet connection required
Standard Installation
macOS Installation
Homebrew (Recommended):
brew install --cask claude-code
curl Script:
curl -fsSL https://claude.ai/install.sh | bash
Linux Installation
curl Script:
curl -fsSL https://claude.ai/install.sh | bash
Homebrew (if available):
brew install --cask claude-code
Windows Installation
PowerShell:
irm https://claude.ai/install.ps1 | iex
Command Prompt:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
NPM Install (All Platforms)
npm install -g @anthropic-ai/claude-code
Authentication Setup
Info
For DENG Group members, the API credentials will be provided by our computer officer. Please contact the computer officer to get your API access credentials.
Environment Variables
For General Use:
Add the following to your ~/.bashrc or ~/.zshrc:
# Claude Code Configurationexport ANTHROPIC_BASE_URL="https://claude.matsci.dev/api"export ANTHROPIC_AUTH_TOKEN="API-KEY"
Warning
Replace API-KEY with the actual API key provided by the computer officer.
SSH Reverse Proxy Tunnel for HPC Servers
Some machines (e.g., Fornax, Orion) cannot directly reach https://claude.matsci.dev due to network restrictions (firewall, no external access, etc.). In that case, you need to set up an SSH reverse proxy tunnel through a machine that has access.
Setup
From the HPC server, create a tunnel to a bastion machine that can reach claude.matsci.dev:
# Run this on the HPC server (e.g., Fornax, Orion)# This forwards local port 13000 → bastion → claude.matsci.dev:443ssh -R 13000:claude.matsci.dev:443 <user>@<bastion-host> -N -f
Then set the environment variable to use localhost:
# Claude Code Configuration for HPC Servers (via tunnel)export ANTHROPIC_BASE_URL="http://localhost:13000/api"export ANTHROPIC_AUTH_TOKEN="API-KEY"
Making the Tunnel Persistent
To keep the tunnel alive across disconnects, add to your ~/.bashrc or use autossh:
# Using autossh (install it first if needed)autossh -M 0 -f -N -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" \ -R 13000:claude.matsci.dev:443 <user>@<bastion-host>
Tip
Contact the computer officer for the bastion host details and your SSH key setup.
Apply Changes
After adding the environment variables, restart your terminal or run:
# For bashsource ~/.bashrc# For zshsource ~/.zshrc
Verification
Verify your installation:
claude --version
Updates
Auto updates are enabled by default
Manual update: claude update
Basic Usage
# Start in your project directorycd /path/to/your/projectclaude
Best Practices
Project Setup
Create CLAUDE.md files for project context and instructions
Be specific in your requests and provide relevant context
Use /clear to manage conversation context when needed
Effective Workflows
Explore, plan, code, commit: Research first, then plan before implementing
Use screenshots for visual feedback and UI development
Iterative development: Start simple and refine gradually
Advanced Features
Git integration: Automatic commit messages and PR assistance
Multi-file operations: Work across your entire codebase
Custom commands: Create slash commands in .claude/commands/
Security
API credentials are provided by the computer officer for group members
Store environment variables securely and never share them
Do not commit credentials or .bashrc/.zshrc files to version control