Skip to content

Claude Code

Claude Code is a powerful command-line interface designed specifically for interacting with large language models directly from your terminal. It enables seamless LLM interactions in your daily development workflow.

  • Deep code understanding & editing: Claude Code excels at understanding complex codebases, allowing it to assist with code generation, refactoring, and debugging tasks.
  • Works where developers already work: Integrates directly into your terminal and IDE, enabling you to leverage LLM capabilities without disrupting your existing workflow.
  • Full development workflow support: From writing and testing code to documentation and deployment, Claude Code supports the entire software development lifecycle.
  • Configurability & control: Customize prompts, set context windows, and manage conversation history to tailor the experience to your specific needs.
  • Multi-platform support: Compatible with various operating systems and development environments.
  • Code generation and modification
  • Debugging and bug fixing
  • Automating routine development tasks
  • Prototyping new features
  • Writing and running tests
  • Integrating with existing tools and workflows
  • Creating pull requests from issues
  • Making cross-file and large scope edits
  • Learning and onboarding support

Get Claude Code up and running on your machine with these simple steps.

  1. Install Claude Code:

    macOS, Linux, WSL:

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

    Windows PowerShell:

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

    Windows CMD:

    Terminal window
    curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
  2. Connect to relaxAI:

    Terminal window
    export ANTHROPIC_API_KEY="rak_apikey" >> ~/.zshrc
    export ANTHROPIC_BASE_URL="https://api.relax.ai" >> ~/.zshrc
    export API_TIMEOUT_MS="300000" >> ~/.zshrc
    export ANTHROPIC_DEFAULT_HAIKU_MODEL="GLM-46" >> ~/.zshrc
    export ANTHROPIC_DEFAULT_SONNET_MODEL="GLM-46" >> ~/.zshrc
    export ANTHROPIC_DEFAULT_OPUS_MODEL="GLM-46" >> ~/.zshrc
    export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 >> ~/.zshrc
    export CLAUDE_CODE_DISABLE_ANALYTICS=1 >> ~/.zshrc
    export CLAUDE_CODE_DEFAULT_MODEL="GLM-46" >> ~/.zshrc

    Then, reload your shell configuration:

    Terminal window
    source ~/.zshrc
  3. Verify installation:

    Terminal window
    claude-code --version
  4. Testing the setup:

    Change into a directory with code and run:

    Terminal window
    claude --model GLM-46 "Explain the code in this directory"

Learn about common workflows with Claude Code. Each task includes clear instructions, example commands, and best practices to help you get the most from Claude Code with relaxAI.

Get a quick codebase overview:

When you join a new project and need to understand its structure quickly, follow these steps:

  1. Navigate to the project root directory:

    Terminal window
    cd /path/to/project
  2. Start Claude Code:

    Terminal window
    claude --model GLM-46
  3. Ask for a high-level overview:

    Terminal window
    > give me an overview of this codebase
  4. Dive deeper into specific components:

    Terminal window
    > explain the main architecture patterns used here
    Terminal window
    > what are the key data models?
    Terminal window
    > how is authentication handled?

Find relevant code:

To locate code related to a specific feature or functionality:

  1. Ask Claude to find relevant files:

    Terminal window
    > find the files that handle user authentication
  2. Get context on how components interact:

    Terminal window
    > how do these authentication files work together?
  3. Understand the execution flow:

    Terminal window
    > trace the login process from front-end to database

When you encounter an error message and need to find and fix its source:

  1. Share the error with Claude:

    Terminal window
    > I'm seeing an error when I run npm test
  2. Ask for fix recommendations:

    Terminal window
    > suggest a few ways to fix the @ts-ignore in user.ts
  3. Apply the fix:

    Terminal window
    > update user.ts to add the null check you suggested

Update old code to use modern patterns and practices:

  1. Identify legacy code for refactoring:

    Terminal window
    > find deprecated API usage in our codebase
  2. Get refactoring recommendations:

    Terminal window
    > suggest how to refactor utils.js to use modern JavaScript features
  3. Apply the changes safely:

    Terminal window
    > refactor utils.js to use ES2024 features while maintaining the same behavior
  4. Verify the refactoring:

    Terminal window
    > run tests for the refactored code

Add tests for uncovered code:

  1. Identify untested code:

    Terminal window
    > find functions in NotificationsService.swift that are not covered by tests
  2. Generate test scaffolding:

    Terminal window
    > add tests for the notification service
  3. Add meaningful test cases:

    Terminal window
    > add test cases for edge conditions in the notification service
  4. Run and verify tests:

    Terminal window
    > run the new tests and fix any failures

Claude can generate tests that follow your project’s existing patterns and conventions. When asking for tests, be specific about what behavior you want to verify. For comprehensive coverage, ask Claude to identify edge cases you might have missed.

Create well-documented pull requests for your changes:

  1. Summarize your changes:

    Terminal window
    > summarize the changes I've made to the authentication module
  2. Generate a pull request with Claude:

    Terminal window
    > create a pr
  3. Review and refine:

    Terminal window
    > enhance the PR description with more context about the security improvements
  4. Add testing details:

    Terminal window
    > add information about how these changes were tested

Add or update documentation for your code:

  1. Identify undocumented code:

    Terminal window
    > find functions without proper JSDoc comments in the auth module
  2. Generate documentation:

    Terminal window
    > add JSDoc comments to the undocumented functions in auth.js
  3. Review and enhance:

    Terminal window
    > improve the generated documentation with more context and examples
  4. Verify documentation:

    Terminal window
    > check if the documentation follows our project standards

Work with images in your codebase and get Claude’s help analyzing image content:

  1. Add an image to the conversation using any of these methods:

    • Drag and drop an image into the Claude Code window
    • Copy an image and paste it into the CLI with ctrl+v
    • Provide an image path to Claude: “Analyze this image: /path/to/your/image.png”
  2. Ask Claude to analyze the image:

    Terminal window
    > What does this image show?
    Terminal window
    > Describe the UI elements in this screenshot
    Terminal window
    > Are there any problematic elements in this diagram?
  3. Use images for context:

    Terminal window
    > Here's a screenshot of the error. What's causing it?
    Terminal window
    > This is our current database schema. How should we modify it for the new feature?
  4. Get code suggestions from visual content:

    Terminal window
    > Generate CSS to match this design mockup
    Terminal window
    > What HTML structure would recreate this component?

Use @ to quickly include files or directories without waiting for Claude to read them:

  1. Reference a single file:

    Terminal window
    > Explain the logic in @src/utils/auth.js

    This includes the full content of the file in the conversation.

  2. Reference a directory:

    Terminal window
    > What's the structure of @src/components?

    This provides a directory listing with file information.

  3. Reference multiple files:

    Terminal window
    > Compare @file1.js and @file2.js

Resume a previous session when starting Claude Code:

  • claude --continue --model GLM-46 continues the most recent conversation in the current directory
  • claude --resume --model GLM-46 opens a conversation picker or resumes by name

From inside an active session, use /resume to switch to a different conversation.

Name your sessions:

  1. Name the current session using /rename:

    Terminal window
    > /rename auth-refactor
  2. Resume by name later from the command line:

    Terminal window
    claude --resume auth-refactor --model GLM-46

    Or from inside an active session:

    Terminal window
    > /resume auth-refactor

Add Claude to your verification process:

Add Claude to your build script:

{
"scripts": {
"lint:claude": "claude --model GLM-46 -p 'you are a linter. please look at the changes vs. main and report any issues related to typos. report the filename and line number on one line, and a description of the issue on the second line. do not return any other text.'"
}
}

Pipe data through Claude:

Terminal window
cat build-error.txt | claude --model GLM-46 -p 'concisely explain the root cause of this build error' > output.txt

Control output format:

  1. Use text format (default):

    Terminal window
    cat data.txt | claude -p 'summarize this data' --output-format text > summary.txt
  2. Use JSON format:

    Terminal window
    cat code.py | claude -p 'analyze this code for bugs' --output-format json > analysis.json
  3. Use streaming JSON format:

    Terminal window
    cat log.txt | claude -p 'parse this log file for errors' --output-format stream-json

Create reusable slash commands for your project that all team members can use.

Create project-specific commands:

  1. Create a commands directory in your project:

    Terminal window
    mkdir -p .claude/commands
  2. Create a Markdown file for each command:

    Terminal window
    echo "Analyze the performance of this code and suggest three specific optimizations:" > .claude/commands/optimize.md
  3. Use your custom command in Claude Code:

    > /optimize

Add command arguments with $ARGUMENTS:

  1. Create a command file with the $ARGUMENTS placeholder:

    Terminal window
    echo 'Find and fix issue #$ARGUMENTS. Follow these steps: 1. Understand the issue 2. Locate the relevant code 3. Implement a solution 4. Add tests 5. Prepare a PR description' > .claude/commands/fix-issue.md
  2. Use the command with an issue number:

    > /fix-issue 123

    This replaces $ARGUMENTS with “123” in the prompt.

Create personal slash commands:

  1. Create a commands directory in your home folder:

    Terminal window
    mkdir -p ~/.claude/commands
  2. Create a Markdown file for each command:

    Terminal window
    echo "Review this code for security vulnerabilities, focusing on:" > ~/.claude/commands/security-review.md
  3. Use your personal custom command:

    > /security-review
  • Be specific in your prompts: Provide clear context and detailed requirements for better results
  • Use incremental changes: Make small, testable changes rather than large refactors all at once
  • Leverage session naming: Name your sessions with descriptive names early to find them easily later
  • Combine with existing tools: Integrate Claude Code into your CI/CD pipeline and shell scripts
  • Review generated code: Always review and test code changes before committing
  • Use project commands: Share common workflows with your team through .claude/commands/
  • Ask for explanations: Request explanations of changes to understand the reasoning behind suggestions