Windows Package Manager (winget) comes with Windows 10 (1709+) and Windows 11. If it's not available:
- Open Microsoft Store
- Search for "App Installer"
- Install or update it
- Restart PowerShell
This guide is split into what you must do manually (~20 min) and what Claude can automate for you (~5 min). Total time: ~25 minutes.
These steps require human interaction - browser logins, admin permissions, clicking buttons. Claude cannot do these for you.
Open PowerShell as Administrator and run all these commands:
# Install all prerequisites (run each line)
winget install Microsoft.PowerShell
winget install OpenJS.NodeJS.LTS
winget install Python.Python.3.11
winget install Git.Git
winget install GitHub.cli
After all installations complete, close PowerShell and open a new PowerShell 7 window. This ensures all commands are available.
If you don't have a GitHub account, create one at github.com/signup first.
# Authenticate GitHub CLI (opens browser)
gh auth login
When prompted, select:
A browser opens - log in and authorize. Then verify:
gh auth status # Should show "Logged in to github.com"
# Install Claude Code CLI
npm install -g @anthropic-ai/claude-code
# First run - opens browser for Anthropic login
cd ~
claude
A browser opens to Anthropic's login page. Log in (or create account), authorize, then return to terminal. Type /exit to quit.
repo (full control)Keep the token somewhere safe temporarily. You'll paste it into a config file in Part 2.
You've finished all the manual steps. Now Claude can automate the rest!
Now launch Claude (claude) and copy-paste these prompts. Claude will configure everything automatically!
How to use: Click the copy button on each prompt, paste into Claude, and let it run. Wait for each to complete before moving to the next.
After running all 9 prompts, your Claude Code CLI is fully configured. You're now ready to:
Remember: Add your actual GitHub token to ~/.claude/user-config.json (from Part 1, Step 4).
Windows Package Manager (winget) comes with Windows 10 (1709+) and Windows 11. If it's not available:
Node.js wasn't added to your PATH. Try:
npm --version againIf still not working, reinstall Node.js and select "Add to PATH" during installation.
If browser authentication fails:
repo and read:org scopesIf you can't authenticate with Anthropic:
These tips are extracted from real-world usage patterns. They'll help you get the most out of Claude Code from day one.
Configure these settings immediately after installation for the best experience:
Skip confirmation prompts when working in trusted directories. Launch Claude with:
claude --dangerously-skip-permissions
When to use: Personal projects, repos you trust completely. Saves 10+ confirmations per session.
Add this to your ~/.claude/settings.json:
{
"alwaysThinkingEnabled": true
}
Effect: Claude uses deep reasoning on every response. Better analysis, fewer mistakes.
For any complex task, ask Claude to plan before executing:
"Plan first: [your complex task here]"
Effect: Claude shows you the plan, you approve, then it executes. Prevents wasted work.
These phrases trigger specific Claude behaviors:
| Phrase | Effect | Example |
|---|---|---|
ultrathink | Forces deep analysis and extended reasoning | "Ultrathink: why is this test failing?" |
plan first | Shows plan before executing | "Plan first: refactor the auth module" |
execute autonomously | Runs all tasks without asking questions | "Execute autonomously: run all tests and fix failures" |
verify with search | Fact-checks claims via web search | "Verify with search: is this the correct API endpoint?" |
quality over speed | Takes time for excellent results | "Quality over speed: review this code thoroughly" |
say I don't know | Admits uncertainty instead of guessing | "Say I don't know if you're unsure about the answer" |
"Ultrathink, plan first: implement user authentication with JWT tokens"
Before doing anything manually, ask: "Can Python do this?"
| Task | Manual Way | Python-First Way |
|---|---|---|
| Rename 50 files | Click, rename, repeat... | "Write a Python script to rename these files" |
| Process CSV data | Open Excel, filter, export... | "Python script to filter and transform this CSV" |
| Generate report | Copy-paste into template... | "Python script to generate this report from data" |
Keep your sessions efficient with these commands:
| Command | When to Use | Effect |
|---|---|---|
/install-github-app | First time setup | Installs GitHub integration for Claude |
/init | Start of every session | Loads project context from CLAUDE.md |
/compact | When context is getting full | Summarizes conversation, frees up tokens |
/init then /compact | Long sessions (~20k tokens) | Refresh and continue efficiently |
Run these commands in order when starting with a new project:
/install-github-app
/init
Plan Modus Einschalten
Note: "Plan Modus Einschalten" activates plan mode for complex tasks - Claude will show you the plan before executing.
Example for the Implied Risk Premia project:
clone the repo http://github.com/Digital-AI-Finance/implied-risk-premia
For batch tasks, use these trigger phrases:
# Run all tasks without questions
"Execute autonomously: run all chart scripts and fix any errors"
# Complete everything in one go
"Complete without asking: format all Python files and run tests"
# Batch processing
"Run all tasks: generate all PDFs in the slides folder"
Behavior: Claude makes reasonable decisions, runs sequentially, handles errors, reports completion.
Prevent Claude from making things up:
| Pattern | Example Prompt |
|---|---|
| Read before claiming | "Read the file first, then describe what it does" |
| Verify before citing | "Search to verify this claim before including it" |
| Check existence | "Confirm this library exists before importing it" |
| Admit uncertainty | "Say 'I'm not certain' if confidence is below 80%" |
Add these to your CLAUDE.md for consistent output:
| Rule | Reason |
|---|---|
| No emojis | Professional, terminal-friendly output |
| ASCII only | Works in all terminals and editors |
| Plain alternatives | Use Y/N, ->, * instead of fancy Unicode |
| Temperature 0 | Deterministic, reproducible results |
| What You Want | What to Say |
|---|---|
| Deep analysis | ultrathink |
| See plan before action | plan first |
| No questions, just do it | execute autonomously |
| Verify facts | verify with search |
| Admit uncertainty | say I don't know if unsure |
| Skip confirmations | --dangerously-skip-permissions |
| Refresh context | /init then /compact |
This document provides comprehensive onboarding instructions for setting up Claude Code CLI with full Git integration, verification tools, and academic workflow support.
Claude Code is Anthropic's official command-line interface for Claude AI. It provides an interactive terminal experience for software engineering tasks, code generation, file manipulation, and complex multi-step workflows.
| Requirement | Version | Status | Purpose |
|---|---|---|---|
| Windows | 10/11 | Required | Operating system |
| PowerShell | 7.0+ | Required | Shell environment |
| Node.js | 18+ | Required | Claude CLI runtime |
| Python | 3.8+ | Required | Verification tools |
| Git | 2.30+ | Required | Version control |
| Git LFS | 3.0+ | Optional | Large file support |
npm install -g @anthropic-ai/claude-code
# Navigate to any project directory
cd C:\path\to\your\project
# Launch Claude Code
claude
On first run, Claude will prompt for authentication and create the ~/.claude/ configuration directory.
claude --version
claude --help
After installation, Claude Code creates a configuration directory at C:\Users\{USERNAME}\.claude\ containing all settings, credentials, and tools.
The debug/ directory can grow to 300+ MB over time. Periodically clean old debug logs to free disk space.
| File | Size | Purpose | Commit to Git? |
|---|---|---|---|
CLAUDE.md | ~25 KB | Global instructions for all projects | NO - keep local |
settings.json | ~2 KB | Model and plugin settings | NO - user-specific |
user-config.json | ~1 KB | API tokens and credentials | NEVER |
history.jsonl | ~3 MB | Complete session history | NO - personal data |
The CLAUDE.md file at ~/.claude/CLAUDE.md contains global instructions that apply to ALL projects. This is the most important configuration file.
ALWAYS check first if any task can be done via a Python script. If YES, generate and run the Python script. This applies to file operations, data processing, automation, and analysis.
Each visualization MUST have its own dedicated folder with its own chart.py that generates chart.pdf. NEVER combine multiple charts into a single script.
project/
+-- 01_concept_name/
| +-- chart.py # Single figure, figsize=(10,6)
| +-- chart.pdf # Generated output
+-- 02_another_chart/
+-- chart.py
+-- chart.pdf
Each chart.pdf MUST contain exactly ONE figure. NO subplots like plt.subplots(2,2). If content requires multiple views, split into separate folders (01a, 01b, 01c).
NEVER allow "Overfull \vbox" or "Overfull \hbox" warnings. If content causes overflow:
DEFAULT: NO NEW FILES. Always prefer editing existing files. Before creating any new file, check if functionality can go in existing file and ask for explicit approval.
VERIFY before claiming. Never fabricate.
| Never Use | Use Instead |
|---|---|
| Emoji characters | Plain text |
| Unicode checkmarks | Y/N or [x] |
| Unicode arrows | -> |
| Fancy symbols | ASCII equivalents |
Additional rules for academic/research workflows:
The settings.json file controls model selection, plugins, and IDE behavior.
{
"model": "opus",
"always_thinking": true,
"statusline": {
"enabled": true,
"script": "~/.claude/statusline.ps1"
},
"plugins": {
// All plugins disabled by default
}
}
| Model | ID | Use Case |
|---|---|---|
| Opus | claude-opus-4-5-20251101 | Complex tasks, deep reasoning (default) |
| Sonnet | claude-sonnet-4-5-20251101 | Balanced performance/cost |
| Haiku | claude-haiku-4-5-20251001 | Quick, simple tasks |
The status line displays context information in the Claude Code interface:
Organization | Email | Directory | Model: opus
Powered by statusline.ps1 which extracts git config, email domain, and current directory.
50+ plugins available but ALL DISABLED by default for stability. Available plugins include:
Configure Git for optimal integration with Claude Code and large file handling.
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
# Use Git Credential Manager (Windows)
git config --global credential.helper manager
This stores credentials securely in Windows Credential Manager.
# Increase buffer for large files (1 GB)
git config --global http.postBuffer 1073741824
# Optimize for slow connections
git config --global http.lowSpeedTime 999999
# Install Git LFS
git lfs install
# Track large file types in your repo
git lfs track "*.pdf"
git lfs track "*.xlsx"
# View all global settings
git config --global --list
# Expected output includes:
# user.name=Your Name
# user.email=your.email@example.com
# credential.helper=manager
# http.postbuffer=1073741824
# Claude Code files (always ignore)
.claude/
CLAUDE.md
# Python
__pycache__/
*.pyc
.venv/
# LaTeX auxiliary files
*.aux
*.log
*.out
*.toc
*.nav
*.snm
The GitHub CLI enables seamless interaction with GitHub repositories, issues, and pull requests.
# Via winget (recommended)
winget install GitHub.cli
# Or via Chocolatey
choco install gh
# Verify installation
gh --version
gh auth login
Select the following options when prompted:
gh auth status
Expected output:
github.com
- Logged in to github.com as USERNAME
- Git operations protocol: https
- Token: ghp_****
- Token scopes: admin:org, repo, workflow, ...
# Set HTTPS as default protocol
gh config set git_protocol https
# Enable prompts
gh config set prompt enabled
| Scope | Purpose |
|---|---|
repo | Full control of private repositories |
admin:org | Organization management |
workflow | GitHub Actions workflows |
write:packages | Package publishing |
read:org | Read organization data |
# Clone a repository
gh repo clone owner/repo
# Create a pull request
gh pr create --title "Title" --body "Description"
# List open issues
gh issue list
# View PR status
gh pr status
# Create a new repo
gh repo create my-repo --private
For GitLab integration (e.g., git.fhgr.ch), use the python-gitlab CLI.
pip install python-gitlab
Create ~/.python-gitlab.cfg with the following content:
[global]
default = fhgr
timeout = 30
[fhgr]
url = https://git.fhgr.ch
private_token = YOUR_GITLAB_TOKEN_HERE
api_version = 4
[gitlab]
url = https://gitlab.com
private_token = YOUR_GITLAB_COM_TOKEN_HERE
api_version = 4
api, read_repository, write_repository# Check CLI location
where gitlab
# Expected: C:\Users\...\anaconda3\Scripts\gitlab.exe
# List projects
gitlab project list
# List project pipelines
gitlab project-pipeline list --project-id 123
# List issues
gitlab project-issue list --project-id 123
# List merge requests
gitlab project-merge-request list --project-id 123
# List wiki pages
gitlab project-wiki list --project-id 123
For Digital-AI-Finance projects:
Push to FHGR GitLab first. GitHub mirror updates automatically.
All API tokens and credentials are stored centrally in ~/.claude/user-config.json.
This file contains sensitive tokens. NEVER commit to git, share, or expose publicly.
{
"github": {
"token": "ghp_xxxxxxxxxxxxxxxxxxxx",
"username": "your-username",
"organizations": ["Digital-AI-Finance"]
},
"gitlab": {
"fhgr": {
"token": "glpat-xxxxxxxxxxxxxxxxxxxx",
"url": "https://git.fhgr.ch",
"groups": ["digital-finance"]
}
},
"zenodo": {
"token": "xxxxxxxxxxxxxxxxxxxx",
"url": "https://zenodo.org"
},
"cloudflare": {
"account_id": "xxxxxxxxxxxxxxxxxxxx",
"api_token": "xxxxxxxxxxxxxxxxxxxx"
}
}
~/.claude/user-config.json in a text editor| Practice | Implementation |
|---|---|
| File permissions | Restrict to user-only read/write |
| Token rotation | Rotate tokens every 90 days |
| Minimal scopes | Request only necessary permissions |
| Audit access | Review token usage in platform settings |
| Separate tokens | Use different tokens for different services |
# PowerShell - restrict to current user only
$path = "$env:USERPROFILE\.claude\user-config.json"
$acl = Get-Acl $path
$acl.SetAccessRuleProtection($true, $false)
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
$env:USERNAME, "FullControl", "Allow"
)
$acl.SetAccessRule($rule)
Set-Acl $path $acl
Custom tools to prevent hallucinations and validate content before finalizing.
Location: ~/.claude/tools/beamer_validation/
Purpose: Validate LaTeX Beamer presentations for errors, broken references, and missing files.
# Full validation (requires internet)
python ~/.claude/tools/beamer_validation/validate_beamer.py slides.tex
# Quick validation (offline only)
python ~/.claude/tools/beamer_validation/validate_beamer.py slides.tex --quick
# Skip specific checks
python validate_beamer.py slides.tex --skip-urls --skip-citations
| Script | What It Checks | Internet? |
|---|---|---|
check_slide_refs.py | \ref{}, \label{}, "slide X" text refs | No |
check_figure_exists.py | \includegraphics file existence | No |
check_bib_usage.py | \cite{} matches .bib entries | No |
check_notation.py | Math symbol consistency | No |
check_undefined_terms.py | Jargon defined before use | No |
verify_dois.py | DOI validation via doi.org | Yes |
verify_citations.py | CrossRef/OpenAlex lookup | Yes |
check_urls.py | URL reachability | Yes |
Location: ~/.claude/tools/hallucination_checks/
# Verify Python imports exist on PyPI
python ~/.claude/tools/hallucination_checks/code/verify_imports.py script.py
# Verify npm packages exist
python ~/.claude/tools/hallucination_checks/code/verify_npm.py package.json
# Test regex patterns
python ~/.claude/tools/hallucination_checks/code/verify_regex.py "\d{3}-\d{4}" "123-4567"
# Verify math calculations
python ~/.claude/tools/hallucination_checks/data/verify_calculations.py "sqrt(16) + 2^3" "12"
# Verify statistical claims
python ~/.claude/tools/hallucination_checks/data/verify_statistics.py --data "1,2,3,4,5" --claim "mean=3"
# Verify GitHub repo exists
python ~/.claude/tools/hallucination_checks/api/verify_github.py pytorch/pytorch
# Verify arXiv paper ID
python ~/.claude/tools/hallucination_checks/api/verify_arxiv.py 2301.00001
# Verify ORCID
python ~/.claude/tools/hallucination_checks/api/verify_orcid.py 0000-0002-1825-0097
# Search Semantic Scholar
python ~/.claude/tools/hallucination_checks/api/verify_semantic_scholar.py --search "attention is all you need"
# Verify HuggingFace model
python ~/.claude/tools/hallucination_checks/api/verify_huggingface.py --model bert-base-uncased
# Verify ISBN
python ~/.claude/tools/hallucination_checks/api/verify_isbn.py 978-0-13-468599-1
# Verify Wikipedia article/claim
python ~/.claude/tools/hallucination_checks/facts/verify_wikipedia.py "Alan Turing" --claim "born in 1912"
All tools use consistent output prefixes:
[OK] - Verification passed
[FAIL] - Verification failed
[WARN] - Warning (partial match)
[SKIP] - Check skipped
pip install requests>=2.28.0
Location: ~/.claude/templates/research-page-template.md
Generates single-file HTML research project pages with:
Location: ~/.claude/templates/academic-primer-template/
Full academic paper scaffold with:
| Agent | Purpose |
|---|---|
academic-beamer-slides.md | Create LaTeX Beamer presentations |
nlp-academic-writer.md | Write NLP academic content |
python-architect.md | Design Python project architecture |
slr-finance-writer.md | Systematic literature reviews (finance) |
# At session start
/init
# When context reaches ~20k tokens remaining
/init then /compact
This ensures continuity and prevents context overflow in long sessions.
/init at the start of every new session/compact to summarize and continueUse the TodoWrite tool to track complex tasks:
# Claude will create todos like:
- [ ] Research existing implementation
- [ ] Design solution
- [ ] Implement changes
- [ ] Write tests
- [ ] Update documentation
When committing changes, Claude follows this protocol:
git status - Check untracked filesgit diff - Review changesgit log --oneline -5 - Check commit stylegit add -A - Stage changesgit commit -m "message" - Commit with descriptive messagegit push - Push to remote (only when requested)Short summary of changes (50 chars max)
- Bullet point details if needed
- Another detail
[Generated with Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Error: git: 'credential-manager' is not a git command
Solution: Install Git Credential Manager:
winget install Git.Git
# Or reinstall Git and select "Git Credential Manager" during setup
Error: API rate limit exceeded for IP address
Solution: Authenticate with gh auth login to get 5000 requests/hour instead of 60.
Error: Overfull \hbox or Overfull \vbox
Solution:
0.55\textwidth instead of 0.75\small or \footnotesize for textError: [FAIL] package_name - Not found on PyPI
Solution: The package may have a different PyPI name. Common mappings:
import PIL -> PyPI: Pillowimport cv2 -> PyPI: opencv-pythonimport sklearn -> PyPI: scikit-learnError: Connection refused or SSL certificate error
Solution: Check your ~/.python-gitlab.cfg:
Full debug logs are stored at ~/.claude/debug/. Each session creates a UUID-named .txt file with complete logs.
# View recent debug logs
Get-ChildItem ~/.claude/debug/*.txt | Sort-Object LastWriteTime -Descending | Select-Object -First 5
# Clean up old logs (older than 30 days)
Get-ChildItem ~/.claude/debug/*.txt | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-30)} | Remove-Item
/helpclaude # Start Claude Code in current directory
claude --version # Check version
/init # Initialize session
/compact # Compact context
/help # Show help
git status # Check working tree status
git diff # Show unstaged changes
git add -A # Stage all changes
git commit -m "message" # Commit with message
git push origin main # Push to remote
git log --oneline -10 # Recent commits
gh auth status # Check authentication
gh repo clone owner/repo # Clone repository
gh pr create # Create pull request
gh pr list # List pull requests
gh issue list # List issues
gitlab project list # List projects
gitlab project-pipeline list --project-id ID # List pipelines
gitlab project-issue list --project-id ID # List issues
gitlab project-merge-request list --project-id ID # List MRs
# Beamer validation
python ~/.claude/tools/beamer_validation/validate_beamer.py slides.tex
# Import verification
python ~/.claude/tools/hallucination_checks/code/verify_imports.py script.py
# GitHub verification
python ~/.claude/tools/hallucination_checks/api/verify_github.py owner/repo
# arXiv verification
python ~/.claude/tools/hallucination_checks/api/verify_arxiv.py 2301.00001