Complete Setup Walkthrough

Two-Part Setup: You + Claude

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.

PART 1: You Do (Manual) - ~20 min
PART 2: Claude Does - ~5 min

PART 1: You Do This (Manual Steps)

These steps require human interaction - browser logins, admin permissions, clicking buttons. Claude cannot do these for you.

Step 1: Install Software (~10 min)

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
Important: Restart PowerShell

After all installations complete, close PowerShell and open a new PowerShell 7 window. This ensures all commands are available.

Step 2: Authenticate with GitHub (~5 min)

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:

  • GitHub.com > HTTPS > Login with a web browser

A browser opens - log in and authorize. Then verify:

gh auth status    # Should show "Logged in to github.com"

Step 3: Install & Authenticate Claude (~3 min)

# 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.

Step 4: Generate GitHub Token (~2 min)

  1. Go to github.com/settings/tokens
  2. Click "Generate new token (classic)"
  3. Name: "Claude Code"
  4. Select scopes: repo (full control)
  5. Click "Generate token"
  6. Copy the token immediately (you won't see it again!)
Save Your Token!

Keep the token somewhere safe temporarily. You'll paste it into a config file in Part 2.

Part 1 Complete!

You've finished all the manual steps. Now Claude can automate the rest!

PART 2: Claude Does This For You

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.

Prompt 1: Verify System Setup ~30 sec
Check my system setup: verify that Node.js, Python, Git, and PowerShell 7 are installed correctly. Show me the version of each.

What happens: Claude runs version checks and confirms all prerequisites are installed.

Prompt 2: Configure Git ~1 min
Configure my git with these settings:
- Name: [REPLACE WITH YOUR NAME]
- Email: [REPLACE WITH YOUR EMAIL]
- Credential helper: manager
- Default branch: main
- Enable LFS
- Set http.postBuffer to 1GB for large files

What happens: Claude runs all the git config commands for you.

Prompt 3: Create CLAUDE.md ~30 sec
Create a starter CLAUDE.md file at ~/.claude/CLAUDE.md with these rules:
- Python-first approach (always prefer Python scripts)
- No emoji or Unicode special characters
- Never commit credentials to git
- Windows/PowerShell environment
- Temperature 0 for deterministic output
- Say "I don't know" rather than guess

What happens: Claude creates your global instructions file.

Prompt 4: Configure Settings ~30 sec
Update my ~/.claude/settings.json to use the sonnet model with always_thinking enabled.

What happens: Claude updates your model preferences.

Prompt 5: Set Up Credentials File ~30 sec
Create a user-config.json template at ~/.claude/user-config.json for storing my GitHub credentials. Use placeholder values and tell me where to paste my actual token.

What happens: Claude creates the credentials file structure. You'll need to manually add your GitHub token (from Part 1, Step 4).

Prompt 6: Set Up Global Gitignore ~30 sec
Create a global gitignore file at ~/.gitignore_global that excludes .claude/ and CLAUDE.md from all repositories, then configure git to use it.

What happens: Claude creates the gitignore and configures git to use it globally.

Prompt 7: Install Python Dependencies ~30 sec
Install the requests Python package which is needed for the verification tools.

What happens: Claude runs pip install for you.

Prompt 8: Test Git Integration ~1 min
Create a ~/Projects folder, clone the octocat/Hello-World repository into it, and verify the clone worked by showing the contents.

What happens: Claude creates your projects folder and clones a test repo.

Prompt 9: Final Verification ~1 min
Run a complete setup verification:
1. Check all config files exist (~/.claude/CLAUDE.md, settings.json, user-config.json)
2. Verify git is configured correctly (show user.name, user.email, credential.helper)
3. Confirm global gitignore is set up
4. Show a summary of what's ready and what might need attention

What happens: Claude runs a comprehensive check and reports any issues.

Setup Complete!

After running all 9 prompts, your Claude Code CLI is fully configured. You're now ready to:

  • Clone and work on any repository
  • Use Claude to help with coding tasks
  • Commit and push changes to GitHub
  • Let Claude automate repetitive tasks

Remember: Add your actual GitHub token to ~/.claude/user-config.json (from Part 1, Step 4).

Common Setup Issues

"winget" is not recognized

Windows Package Manager (winget) comes with Windows 10 (1709+) and Windows 11. If it's not available:

  1. Open Microsoft Store
  2. Search for "App Installer"
  3. Install or update it
  4. Restart PowerShell
"npm" is not recognized

Node.js wasn't added to your PATH. Try:

  1. Close all PowerShell windows
  2. Open a new PowerShell window
  3. Try npm --version again

If still not working, reinstall Node.js and select "Add to PATH" during installation.

gh auth login fails

If browser authentication fails:

  1. Try selecting "Paste an authentication token" instead of browser
  2. Go to github.com/settings/tokens
  3. Generate a new token with repo and read:org scopes
  4. Paste the token when prompted
Claude authentication fails

If you can't authenticate with Anthropic:

  1. Make sure you have an Anthropic account at console.anthropic.com
  2. Check that your account is in good standing
  3. Try clearing browser cookies and authenticating again
  4. If using a corporate network, check if Anthropic domains are blocked

Tips & Tricks for Power Users

Level Up Your Claude CLI Experience

These tips are extracted from real-world usage patterns. They'll help you get the most out of Claude Code from day one.

First 5 Minutes: Essential Settings

Configure these settings immediately after installation for the best experience:

1Enable "Dangerously Permit" for Trusted Projects

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.

2Enable "Always Thinking" Mode

Add this to your ~/.claude/settings.json:

{
  "alwaysThinkingEnabled": true
}

Effect: Claude uses deep reasoning on every response. Better analysis, fewer mistakes.

3Use Plan Mode First

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.

Prompt Patterns: Magic Words That Work

These phrases trigger specific Claude behaviors:

PhraseEffectExample
ultrathinkForces deep analysis and extended reasoning"Ultrathink: why is this test failing?"
plan firstShows plan before executing"Plan first: refactor the auth module"
execute autonomouslyRuns all tasks without asking questions"Execute autonomously: run all tests and fix failures"
verify with searchFact-checks claims via web search"Verify with search: is this the correct API endpoint?"
quality over speedTakes time for excellent results"Quality over speed: review this code thoroughly"
say I don't knowAdmits uncertainty instead of guessing"Say I don't know if you're unsure about the answer"
Pro Tip: Combine Them

"Ultrathink, plan first: implement user authentication with JWT tokens"

Workflow Optimization

Python-First Approach

Before doing anything manually, ask: "Can Python do this?"

TaskManual WayPython-First Way
Rename 50 filesClick, rename, repeat..."Write a Python script to rename these files"
Process CSV dataOpen Excel, filter, export..."Python script to filter and transform this CSV"
Generate reportCopy-paste into template..."Python script to generate this report from data"

Context Management

Keep your sessions efficient with these commands:

CommandWhen to UseEffect
/install-github-appFirst time setupInstalls GitHub integration for Claude
/initStart of every sessionLoads project context from CLAUDE.md
/compactWhen context is getting fullSummarizes conversation, frees up tokens
/init then /compactLong sessions (~20k tokens)Refresh and continue efficiently

First Commands After Setup

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.

Cloning Project Repositories

Example for the Implied Risk Premia project:

clone the repo http://github.com/Digital-AI-Finance/implied-risk-premia

Autonomous Execution Mode

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.

Quality Control

Anti-Hallucination Prompts

Prevent Claude from making things up:

PatternExample 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%"

Professional Output Rules

Add these to your CLAUDE.md for consistent output:

RuleReason
No emojisProfessional, terminal-friendly output
ASCII onlyWorks in all terminals and editors
Plain alternativesUse Y/N, ->, * instead of fancy Unicode
Temperature 0Deterministic, reproducible results

Quick Reference Card

What You WantWhat to Say
Deep analysisultrathink
See plan before actionplan first
No questions, just do itexecute autonomously
Verify factsverify with search
Admit uncertaintysay I don't know if unsure
Skip confirmations--dangerously-skip-permissions
Refresh context/init then /compact

Claude Code CLI Setup Guide

Purpose

This document provides comprehensive onboarding instructions for setting up Claude Code CLI with full Git integration, verification tools, and academic workflow support.

1. Overview & Prerequisites

What is Claude Code CLI?

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.

Prerequisites

RequirementVersionStatusPurpose
Windows10/11RequiredOperating system
PowerShell7.0+RequiredShell environment
Node.js18+RequiredClaude CLI runtime
Python3.8+RequiredVerification tools
Git2.30+RequiredVersion control
Git LFS3.0+OptionalLarge file support

Installation

1Install Claude Code CLI

npm install -g @anthropic-ai/claude-code

2First Run

# 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.

3Verify Installation

claude --version
claude --help

2. Directory Structure (~/.claude/)

After installation, Claude Code creates a configuration directory at C:\Users\{USERNAME}\.claude\ containing all settings, credentials, and tools.

~/.claude/ # Root configuration directory +-- CLAUDE.md # Global instructions (635 lines) - CRITICAL +-- settings.json # Model & plugin configuration +-- user-config.json # Credentials - SENSITIVE, NEVER COMMIT +-- agent_instructions.md # Agent behavior framework (485 lines) +-- statusline.ps1 # PowerShell status line script +-- history.jsonl # Session history log (11,697+ lines) +-- stats-cache.json # Usage statistics | +-- tools/ # Verification & validation tools (~50 MB) | +-- beamer_validation/ # LaTeX slide validation (9 scripts) | +-- hallucination_checks/ # Anti-hallucination tools (14 scripts) | +-- templates/ # Project templates | +-- research-page-template.md | +-- academic-primer-template/ | +-- agents/ # Agent definitions (6 agents) | +-- academic-beamer-slides.md | +-- nlp-academic-writer.md | +-- python-architect.md | +-- slr-finance-writer.md | +-- plugins/ # Plugin management & cache +-- projects/ # Project-specific metadata +-- debug/ # Debug logs (~376 MB) - prune periodically +-- plans/ # Session planning documents +-- file-history/ # File edit history per session
Storage Note

The debug/ directory can grow to 300+ MB over time. Periodically clean old debug logs to free disk space.

Key Files Summary

FileSizePurposeCommit to Git?
CLAUDE.md~25 KBGlobal instructions for all projectsNO - keep local
settings.json~2 KBModel and plugin settingsNO - user-specific
user-config.json~1 KBAPI tokens and credentialsNEVER
history.jsonl~3 MBComplete session historyNO - personal data

3. Global Configuration (CLAUDE.md)

The CLAUDE.md file at ~/.claude/CLAUDE.md contains global instructions that apply to ALL projects. This is the most important configuration file.

Key Rules

Rule 1: Python-First Approach

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.

Rule 2: One Python Script Per Chart

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
Rule 3: One Figure Per Chart

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).

Rule 4: LaTeX/Beamer Zero Overflow (CRITICAL)

NEVER allow "Overfull \vbox" or "Overfull \hbox" warnings. If content causes overflow:

  • Reduce bullet points (max 3-4 per slide)
  • Use smaller chart (0.65\textwidth instead of 0.75)
  • Split content across multiple slides
  • Use \small or \footnotesize for dense content
Rule 5: File Creation Governance

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.

Rule 6: Anti-Hallucination Protocol

VERIFY before claiming. Never fabricate.

  • NEVER describe file contents without using Read tool first
  • ALL statistics, facts, dates MUST be verified via WebSearch
  • Verify APIs/endpoints are real before writing code that calls them
  • Say "I don't know" rather than guess

Character Restrictions

Never UseUse Instead
Emoji charactersPlain text
Unicode checkmarksY/N or [x]
Unicode arrows->
Fancy symbolsASCII equivalents

Academic Extensions

Additional rules for academic/research workflows:

  • Reproducibility: Full pipeline Python scripts with pinned versions
  • Chart Style: Matplotlib/Seaborn, grayscale-friendly, B&W print safe
  • Beamer: Madrid theme, 8pt font, chart-heavy, minimal bullets
  • Citations: BibTeX + natbib, verify ALL citations
  • Versioning: YYYYMMDD_HHMM_ prefix for all .tex outputs

4. Settings Configuration (settings.json)

The settings.json file controls model selection, plugins, and IDE behavior.

Current Configuration

{
  "model": "opus",
  "always_thinking": true,
  "statusline": {
    "enabled": true,
    "script": "~/.claude/statusline.ps1"
  },
  "plugins": {
    // All plugins disabled by default
  }
}

Model Options

ModelIDUse Case
Opusclaude-opus-4-5-20251101Complex tasks, deep reasoning (default)
Sonnetclaude-sonnet-4-5-20251101Balanced performance/cost
Haikuclaude-haiku-4-5-20251001Quick, simple tasks

Status Line

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.

Plugin Management

50+ plugins available but ALL DISABLED by default for stability. Available plugins include:

  • GitHub integration
  • Code review tools
  • Slack, Vercel, Firebase integrations
  • LSP servers (pyright, rust-analyzer, etc.)

5. Git Global Setup

Configure Git for optimal integration with Claude Code and large file handling.

1Set Identity

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

2Configure Credential Helper

# Use Git Credential Manager (Windows)
git config --global credential.helper manager

This stores credentials securely in Windows Credential Manager.

3Enable Large File Handling

# Increase buffer for large files (1 GB)
git config --global http.postBuffer 1073741824

# Optimize for slow connections
git config --global http.lowSpeedTime 999999

4Install and Configure Git LFS

# Install Git LFS
git lfs install

# Track large file types in your repo
git lfs track "*.pdf"
git lfs track "*.xlsx"

5Verify Configuration

# 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

Recommended .gitignore Additions

# Claude Code files (always ignore)
.claude/
CLAUDE.md

# Python
__pycache__/
*.pyc
.venv/

# LaTeX auxiliary files
*.aux
*.log
*.out
*.toc
*.nav
*.snm

6. GitHub CLI (gh) Setup

The GitHub CLI enables seamless interaction with GitHub repositories, issues, and pull requests.

1Install GitHub CLI

# Via winget (recommended)
winget install GitHub.cli

# Or via Chocolatey
choco install gh

# Verify installation
gh --version

2Authenticate with GitHub

gh auth login

Select the following options when prompted:

  • Account: GitHub.com
  • Protocol: HTTPS
  • Authentication: Login with a web browser

3Verify Authentication

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, ...

4Configure Defaults

# Set HTTPS as default protocol
gh config set git_protocol https

# Enable prompts
gh config set prompt enabled

Required Token Scopes

ScopePurpose
repoFull control of private repositories
admin:orgOrganization management
workflowGitHub Actions workflows
write:packagesPackage publishing
read:orgRead organization data

Common GitHub CLI Commands

# 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

7. GitLab CLI Setup

For GitLab integration (e.g., git.fhgr.ch), use the python-gitlab CLI.

1Install python-gitlab

pip install python-gitlab

2Create Configuration File

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

3Generate GitLab Token

  1. Go to GitLab -> Settings -> Access Tokens
  2. Create a new token with scopes: api, read_repository, write_repository
  3. Copy the token to your config file

4Verify Installation

# Check CLI location
where gitlab

# Expected: C:\Users\...\anaconda3\Scripts\gitlab.exe

Common GitLab CLI Commands

# 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

Repository Hierarchy

FHGR GitLab = Primary, GitHub = Mirror

For Digital-AI-Finance projects:

  • PRIMARY (Read-Write): git.fhgr.ch/digital-finance - All development here
  • MIRROR (Read-Only): github.com/Digital-AI-Finance - Auto-synced

Push to FHGR GitLab first. GitHub mirror updates automatically.

8. Credential Management

All API tokens and credentials are stored centrally in ~/.claude/user-config.json.

SECURITY WARNING

This file contains sensitive tokens. NEVER commit to git, share, or expose publicly.

File Structure

{
  "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"
  }
}

Adding New Credentials

  1. Open ~/.claude/user-config.json in a text editor
  2. Add a new key-value pair following the existing structure
  3. Save the file
  4. Restart Claude Code to pick up changes

Security Best Practices

PracticeImplementation
File permissionsRestrict to user-only read/write
Token rotationRotate tokens every 90 days
Minimal scopesRequest only necessary permissions
Audit accessReview token usage in platform settings
Separate tokensUse different tokens for different services

Setting File Permissions (Windows)

# 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

9. Verification Tools

Custom tools to prevent hallucinations and validate content before finalizing.

9.1 Beamer Validation Suite

Location: ~/.claude/tools/beamer_validation/

Purpose: Validate LaTeX Beamer presentations for errors, broken references, and missing files.

Usage

# 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

Available Checks

ScriptWhat It ChecksInternet?
check_slide_refs.py\ref{}, \label{}, "slide X" text refsNo
check_figure_exists.py\includegraphics file existenceNo
check_bib_usage.py\cite{} matches .bib entriesNo
check_notation.pyMath symbol consistencyNo
check_undefined_terms.pyJargon defined before useNo
verify_dois.pyDOI validation via doi.orgYes
verify_citations.pyCrossRef/OpenAlex lookupYes
check_urls.pyURL reachabilityYes

9.2 Hallucination Checks Suite

Location: ~/.claude/tools/hallucination_checks/

Code Verification

# 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"

Data Verification

# 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"

API Verification

# 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

Fact Verification

# Verify Wikipedia article/claim
python ~/.claude/tools/hallucination_checks/facts/verify_wikipedia.py "Alan Turing" --claim "born in 1912"

Output Format

All tools use consistent output prefixes:

[OK]   - Verification passed
[FAIL] - Verification failed
[WARN] - Warning (partial match)
[SKIP] - Check skipped

Dependencies

pip install requests>=2.28.0

10. Templates & Agents

Available Templates

Research Page Template

Location: ~/.claude/templates/research-page-template.md

Generates single-file HTML research project pages with:

  • Compact sidebar layout (160px fixed left sidebar)
  • OpenAlex integration for publications
  • Team member profiles with ORCIDs
  • Collaboration tracking
  • Responsive design

Academic Primer Template

Location: ~/.claude/templates/academic-primer-template/

Full academic paper scaffold with:

  • LaTeX document structure
  • Bibliography management
  • Figure generation scripts
  • GitHub workflows
  • Docker configuration

Available Agents

AgentPurpose
academic-beamer-slides.mdCreate LaTeX Beamer presentations
nlp-academic-writer.mdWrite NLP academic content
python-architect.mdDesign Python project architecture
slr-finance-writer.mdSystematic literature reviews (finance)

11. Workflow Best Practices

Session Management

# At session start
/init

# When context reaches ~20k tokens remaining
/init then /compact

This ensures continuity and prevents context overflow in long sessions.

Context Management Protocol

  1. Run /init at the start of every new session
  2. Monitor token usage in the status bar
  3. When approaching limit, run /compact to summarize and continue
  4. For very long tasks, break into multiple sessions

Todo Tracking

Use the TodoWrite tool to track complex tasks:

# Claude will create todos like:
- [ ] Research existing implementation
- [ ] Design solution
- [ ] Implement changes
- [ ] Write tests
- [ ] Update documentation

Commit Workflow

When committing changes, Claude follows this protocol:

  1. git status - Check untracked files
  2. git diff - Review changes
  3. git log --oneline -5 - Check commit style
  4. git add -A - Stage changes
  5. git commit -m "message" - Commit with descriptive message
  6. git push - Push to remote (only when requested)

Commit Message Format

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>

12. Troubleshooting

Common Issues

Credential helper not found

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
GitHub API rate limit exceeded

Error: API rate limit exceeded for IP address

Solution: Authenticate with gh auth login to get 5000 requests/hour instead of 60.

LaTeX overflow warnings

Error: Overfull \hbox or Overfull \vbox

Solution:

  • Reduce chart width: 0.55\textwidth instead of 0.75
  • Reduce bullet points: max 3-4 per slide
  • Use \small or \footnotesize for text
  • Split content across multiple slides
Python import verification fails

Error: [FAIL] package_name - Not found on PyPI

Solution: The package may have a different PyPI name. Common mappings:

  • import PIL -> PyPI: Pillow
  • import cv2 -> PyPI: opencv-python
  • import sklearn -> PyPI: scikit-learn
GitLab CLI connection refused

Error: Connection refused or SSL certificate error

Solution: Check your ~/.python-gitlab.cfg:

  • Verify the URL is correct (https://)
  • Verify the token is valid and not expired
  • Check if VPN is required for git.fhgr.ch

Debug Logs

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

Getting Help

Quick Reference - Command Cheatsheet

Claude Code Commands

claude              # Start Claude Code in current directory
claude --version    # Check version
/init               # Initialize session
/compact            # Compact context
/help               # Show help

Git Commands

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

GitHub CLI Commands

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 CLI Commands

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

Verification Tools

# 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