Skip to main content
Article
AICLIdeveloper-toolsAnthropicaiclianthropiccode-generation

Claude Code

Install and use Anthropic's `claude-code` CLI to automate software engineering tasks. Leverage Claude's intelligence for autonomous coding, debugging, and multi-step task execution directly from your terminal, boosting developer productivity.

beginner5 min4 steps
The play
  1. Install Claude Code CLI
    Install the `claude-code` Python package globally using pip.
  2. Set Your Anthropic API Key
    Obtain your Anthropic API key and export it as an environment variable. Replace `your_anthropic_api_key_here` with your actual key.
  3. Generate a Simple Function
    Ask Claude to write a basic function for you directly from the command line.
  4. Perform a Multi-step Task
    Request Claude to perform a task involving multiple steps, such as creating a file and writing content into it.
Starter code
export ANTHROPIC_API_KEY="your_anthropic_api_key_here" && claude-code "Write a Python function to calculate the Nth Fibonacci number."
Claude Code — Action Pack