Claude Code: Getting Started Guide for Developers

I build all my client projects with Claude Code now. Last week it migrated 47 files from JavaScript to TypeScript in 8 minutes—what would have taken me a full day. This isn't autocomplete; it's an autonomous agent that reads your codebase, makes changes across dozens of files, writes tests, and commits with meaningful messages. Setup takes 10 minutes. Your first real refactor takes another 20. This guide gets you from zero to shipping Claude Code-assisted code today.

What You'll Learn

Prerequisites

Step 1

Install the Claude Code CLI

Open your terminal and install Claude Code using npm: `npm install -g @anthropic-ai/claude-code`. If you prefer not to install globally, you can use npx for on-demand execution. Verify installation by running `claude-code --version`. You should see the current version number displayed. This CLI is the primary interface for all agentic coding tasks and integrates directly with your existing editor and terminal workflow.

💡 Tip: Add the Claude Code CLI to your shell profile (.bashrc, .zshrc) so it's available in every session without reinstalling.
Step 2

Authenticate with your Anthropic account

Run `claude-code auth login` and follow the browser-based authentication flow. You'll be redirected to Anthropic's login page where you sign in with your Claude Pro or Max credentials. Once authenticated, the CLI stores a secure token locally in your home directory. This token allows Claude Code to access the Claude API with your usage limits and permissions. If you're on a team plan, ensure your organization has enabled API access for your account.

⚠ Watch out: Never share your authentication token or commit it to version control. Claude Code stores it in ~/.claude-code/credentials by default.
Step 3

Navigate to your target project

Change directories to the codebase you want Claude Code to work on: `cd ~/projects/your-app`. Claude Code uses your current working directory as the project root and will scan this directory structure to understand your codebase. For best results, start with a project that has clear module boundaries and is already under Git version control. Claude Code's directory exploration and grep tools work best when your project follows standard conventions (e.g., src/, tests/, package.json or requirements.txt).

💡 Tip: Start with a smaller, well-structured project for your first session—500-2000 lines of code is ideal for learning the workflow.
Step 4

Initialize Claude Code project permissions

Run `claude-code init` in your project root. Claude Code will create a `.claude-code/config.json` file that defines which directories and file types the agent can read, write, and execute. By default, it allows reading all source files but requires explicit confirmation before writing. Review this config file and adjust permissions to match your comfort level—you can restrict Claude Code to specific subdirectories like `/src` or `/lib` if you want tighter control initially. This permission model prevents accidental changes to configuration files, build artifacts, or sensitive data.

⚠ Watch out: Do not grant write access to .env files, secrets directories, or production configuration until you've tested Claude Code's behavior on non-critical code.
Step 5

Run your first read-only codebase query

Test Claude Code's codebase navigation by asking it to analyze your project: `claude-code 'Give me a summary of this codebase architecture, including entry points and key modules.'` Claude Code will use its grep and directory exploration tools to scan your files, identify patterns, and generate a structured summary. This demonstrates its ability to autonomously navigate and understand your code without you manually providing context. Review the output to confirm Claude Code correctly identified your project structure, dependencies, and main components.

💡 Tip: Use read-only queries like 'Find all database query functions' or 'List all API endpoints' to build confidence before enabling write operations.
Step 6

Enable write permissions for a specific directory

Edit `.claude-code/config.json` and set `"allow_write": true` for a specific subdirectory like `/src/utils` or `/lib`. Save the file and run `claude-code 'Refactor all utility functions in /src/utils to use async/await instead of callbacks.'` Claude Code will read the target files, identify callback patterns, rewrite them using async/await, and present a diff for your review. This is multi-file refactoring in action—Claude Code autonomously handles the tedious work while you retain full control over what gets committed.

💡 Tip: Start with non-critical utility modules or test files to see how Claude Code handles refactoring before applying it to core business logic.
Step 7

Review changes using Git integration

Before Claude Code writes changes to disk, it shows you a unified diff of all proposed edits. Review each file change carefully. If you approve, Claude Code will write the files and can optionally create a Git commit with a descriptive message. Run `git status` to see the changed files, then `git diff` to inspect line-by-line changes. You can also ask Claude Code to create a feature branch: `claude-code 'Create a new branch called refactor-utils and commit these changes with a detailed message.'` This gives you full Git workflow control while leveraging Claude's autonomous editing.

⚠ Watch out: Always review diffs before committing. Claude Code is powerful but not perfect—edge cases and misunderstandings can happen, especially in complex codebases.
Step 8

Generate tests for an existing module

Point Claude Code at a module that lacks test coverage: `claude-code 'Generate comprehensive pytest unit tests for /src/auth/login.py, including edge cases and mocking external API calls.'` Claude Code will analyze the target module, identify testable functions, generate pytest fixtures, and write test cases covering happy paths, error conditions, and boundary cases. It will create a new test file in your tests/ directory following pytest conventions. Run `pytest` to verify the generated tests execute correctly. This workflow alone can save 2-3 hours per module compared to manual test writing.

💡 Tip: Specify your testing framework (pytest, Jest, xUnit, etc.) explicitly in the prompt to ensure Claude Code generates idiomatic tests for your stack.
Step 9

Diagnose a bug from a stack trace

Copy an error message or stack trace from your logs and paste it into a Claude Code prompt: `claude-code 'Here is a stack trace: [paste trace]. Find the root cause and fix the bug.'` Claude Code will trace the error through your codebase, identify the faulty logic, and propose a fix. It uses its file reading and grep tools to navigate dependencies and understand context beyond the immediate error location. Review the proposed fix, test it locally, and commit if the solution is correct. This workflow turns 30-minute debugging sessions into 5-minute fixes for common issues.

💡 Tip: Include relevant log context and input data in your prompt to help Claude Code understand the runtime conditions that triggered the bug.
Step 10

Set up MCP server integration for extended tools

Claude Code supports MCP (Model Context Protocol) servers, which extend its capabilities with custom tools like database query execution, API testing, or deployment automation. Install an MCP server (e.g., a database connector or Slack integration) by following Anthropic's MCP documentation. Configure the server in `.claude-code/mcp-config.json` with connection details and permissions. Restart Claude Code, and you'll be able to issue prompts like `claude-code 'Query the production database for recent user signups and generate a summary report.'` MCP integration turns Claude Code into a full-stack automation agent, not just a code editor.

💡 Tip: Start with read-only MCP servers (database queries, API GET requests) before enabling write operations to production systems.

Summary

You've installed Claude Code, configured project permissions, and completed your first autonomous refactoring and test generation tasks. You now have a workflow that cuts boilerplate and tedious refactoring time by 60% or more, freeing you to focus on architecture and product work. The key is starting with scoped, low-risk tasks and expanding Claude Code's permissions as you build confidence in its output quality.

Next Steps

  1. Apply Claude Code to a real backlog item: pick a tedious refactoring task you've been postponing and let Claude Code handle the bulk of the work
  2. Experiment with MCP server integrations to automate cross-system workflows like database migrations, API testing, or deployment checks
  3. Schedule a 1-hour workshop with Scott Hay to implement Claude Code across your team's development workflow and define permission guardrails
  4. Set up a pre-commit hook that runs Claude Code for automatic code review and inline explanations on every commit

Want to Ship Faster with Claude Code?

I build production AI systems with Claude Code daily. If you're spending hours on refactoring, test generation, or boilerplate, I can show you the exact workflows that cut development time by 50-70%. Custom solutions, 90-day delivery, you own the code.

Book a Claude Code Session
Scott Hay Microsoft Certified Trainer & AI Solutions Architect Microsoft Certified Trainer (MCT) • Delivers 12 Microsoft Copilot courses (MS-4002 through MS-4023) plus Azure AI, Power BI • Azure AI Agents, Semantic Kernel, Power BI (PL-300), Power Platform certified • Former Microsoft and Amazon — 30+ years building production systems • Builds custom AI solutions for SMBs with 90-day delivery