How to Set Up Claude Code for Development Tasks
Configure Claude Code CLI for AI-assisted software development.
Jay Banlasan
The AI Systems Guy
Claude Code is the terminal-based AI development assistant that actually understands your entire codebase. The claude code setup development workflow takes about 10 minutes, and once it is running you have a tool that can read files, write code, run tests, and navigate your project without you copying and pasting context. I use it daily for client work including refactoring automation scripts, writing tests, and debugging complex pipelines.
The key difference from using the Claude API directly is that Claude Code has tools built in: it can read files, search the codebase, run shell commands, and edit code directly. You are not just chatting with an AI, you are directing a development agent that operates inside your project.
What You Need Before Starting
- Node.js 18 or higher installed
- An Anthropic account with API access
- A terminal you use for development
- A code project to work with (any language)
Step 1: Install Claude Code
npm install -g @anthropic-ai/claude-code
Verify the install:
claude --version
If you see a version number, the install succeeded.
Step 2: Authenticate
Run Claude Code in any project directory:
cd your-project
claude
On first run, it will prompt you to authenticate. You can use:
Option A: Browser OAuth (recommended) It opens your browser to authenticate with your Anthropic account. Credentials are stored locally.
Option B: API key directly
export ANTHROPIC_API_KEY=sk-ant-your-key-here
claude
Or add to your shell profile for persistence:
echo 'export ANTHROPIC_API_KEY=sk-ant-your-key-here' >> ~/.bashrc
source ~/.bashrc
Step 3: Understand the Interface
Once Claude Code is running, you get an interactive prompt. Type your request in plain English:
> Explain what this project does by reading the main files
> Write tests for the functions in src/utils.py
> Find all the places we're making API calls and add error handling
> Refactor the database connection to use a connection pool
Claude Code reads your files, understands the code, and can make edits directly. It asks for confirmation before writing to files.
Key commands inside Claude Code:
/help- Show available commands/clear- Clear conversation context/cost- Show token usage for the sessionCtrl+C- Cancel the current operationCtrl+D- Exit Claude Code
Step 4: Configure Claude Code Behavior with CLAUDE.md
Create a CLAUDE.md file in your project root. Claude Code reads this automatically at the start of every session:
# Project: My API Service
## Tech Stack
- Python 3.11
- FastAPI
- PostgreSQL via SQLAlchemy
- pytest for testing
- Docker for deployment
## Code Style
- Use type hints on all functions
- Docstrings in Google format
- Keep functions under 40 lines
- No print statements in production code, use logging
## Database
- All queries go through the repository layer in `src/db/repositories/`
- Never write raw SQL outside of repository files
- Use transactions for multi-step operations
## Testing
- Tests go in `tests/` mirroring the `src/` structure
- Minimum coverage: 80%
- Use fixtures from `tests/conftest.py`
- Integration tests in `tests/integration/`
## What NOT to do
- Don't modify `config.py` without asking
- Don't add new dependencies without discussion
- Don't remove error handling to make code shorter
This file tells Claude Code your project conventions so every suggestion follows your standards.
Step 5: Common Development Workflows
Explore an unfamiliar codebase:
> Give me a high-level overview of how this project is structured
> What does the authentication flow look like?
> Where does data from the webhook endpoint end up being stored?
Write new features:
> Add a function to src/notifications.py that sends an email when a user's trial expires
> Create a new endpoint POST /api/reports that generates a PDF summary and returns the download URL
Debug an error:
> I'm getting this error: [paste stack trace]. Find the root cause.
> The test `test_user_creation` is failing. Diagnose and fix it.
Refactor code:
> The function process_orders in orders.py is 200 lines. Break it into smaller functions.
> Replace all the manual try/except blocks in api/routes.py with a decorator
Write tests:
> Write unit tests for every function in src/validators.py
> Add integration tests for the /checkout endpoint covering success, payment failure, and invalid cart
Step 6: Use Claude Code in Non-Interactive Mode
For scripts and CI/CD pipelines, run Claude Code without the interactive shell:
# Run a single task and exit
claude -p "Review the changes in git diff and identify any security issues" --output-format text
# Run on a specific file
claude -p "Add type hints to all functions in this file" src/utils.py
Non-interactive mode is useful for automated code review on pull requests or pre-commit hooks.
Step 7: Set Usage Limits
Claude Code tokens add up. Set a spending limit to avoid surprises:
# Check current usage
claude /cost
# Set a limit (prompts you to stop if exceeded)
claude /config set max_tokens_per_session 100000
For team use, set the ANTHROPIC_API_KEY at the organization level and track usage through the Anthropic console.
What to Build Next
- Create a
CLAUDE.mdtemplate for your team's standard projects so every new repo starts with the right context - Set up a pre-commit hook that runs Claude Code to check for obvious bugs before committing
- Use non-interactive mode in your CI pipeline to auto-generate PR descriptions from diffs
Related Reading
- How to Set Up Anthropic Claude with System Prompts - System prompts in the API mirror what CLAUDE.md does for the CLI
- How to Build a Multi-Turn Conversation with Claude - Understanding how context works in multi-turn sessions
- How to Create AI API Keys Securely - Managing the API key Claude Code uses
Want this system built for your business?
Get a free assessment. We will map every system your business needs and show you the ROI.
Get Your Free Assessment