Installation Guide

This guide provides step-by-step instructions for installing and configuring Claude in both Linux and Windows Subsystem for Linux (WSL) environments.

Linux Installation

Prerequisites

  • Python 3.8 or higher

  • pip package manager

  • git

Steps

  1. Create a virtual environment:

python3 -m venv claude-env
source claude-env/bin/activate
  1. Install Claude CLI:

pip install anthropic
  1. Set up your API key:

export ANTHROPIC_API_KEY='your-api-key'
  1. Add to your ~/.bashrc or ~/.zshrc for persistence:

echo 'export ANTHROPIC_API_KEY="your-api-key"' >> ~/.bashrc
source ~/.bashrc

WSL Installation

Prerequisites

  • WSL2 installed and configured

  • Ubuntu or Debian-based distribution

  • Python 3.8 or higher

Steps

  1. Update WSL system:

  1. Install Python dependencies:

  1. Follow the same steps as Linux installation above.

Claude Desktop Application

For a graphical interface to Claude:

  1. Install Node.js dependencies:

  1. Clone and build the desktop application:

  1. Start the application:

Role Configuration and Project Initialization

Setting Up Project Roles

Claude can be configured with different roles for various project contexts. Here's how to set up roles:

  1. Create a claude-config.json in your project root:

  1. Initialize Claude with a specific role:

Initializing Claude for Existing Projects

To initialize Claude for an existing codebase:

  1. Create a project context file:

  1. Initialize Claude with project context:

  1. Usage example:

Best Practices for Role Configuration

  1. Role Separation

    • Keep roles focused and specific

    • Define clear boundaries between roles

    • Use appropriate temperature settings for each role

  2. Context Management

    • Regularly update project context

    • Keep system messages concise but informative

    • Include relevant project-specific guidelines

  3. Version Control

    • Track role configurations in version control

    • Document role changes and their purposes

    • Use environment variables for sensitive settings

Best Practices

  1. API Key Security

    • Never commit API keys to version control

    • Use environment variables or secure key management

    • Rotate keys periodically

  2. Virtual Environment

    • Always use virtual environments for isolation

    • Keep dependencies updated

    • Use requirements.txt for project dependencies

  3. Error Handling

Troubleshooting

Common issues and solutions:

  1. API Key Issues

    • Verify key is correctly set in environment

    • Check key permissions and quotas

    • Ensure no whitespace in key string

  2. Installation Errors

    • Update pip: pip install --upgrade pip

    • Check Python version compatibility

    • Verify system dependencies

  3. WSL-Specific Issues

    • Enable WSL2: wsl --set-version Ubuntu

    • Check WSL integration in VS Code

    • Verify network connectivity

Resources

Last updated