· Engineering  · 8 min read

AI-Powered Software Development with Claude Code: A Guide to Terminal-Based Coding

Claude Code CLI tool for AI-powered software development from the terminal. Agentic coding, file editing, MCP integration, and production workflow best practices.

Claude Code CLI tool for AI-powered software development from the terminal. Agentic coding, file editing, MCP integration, and production workflow best practices.

Claude Code is Anthropic’s terminal-based AI tool. Not an IDE plugin, but an AI coding agent that runs directly in your terminal. It reads files, edits them, runs terminal commands, debugs, and writes commit messages — all through the CLI.

In this article, I explain how I installed Claude Code, how I use it in my daily workflow, and what to watch out for in production environments.

Claude Code Terminal Claude Code, Anthropic’s terminal-native AI coding assistant


1. What is Claude Code and Why Is It Different?

What sets Claude Code apart from other AI coding tools is that it’s terminal-native. GitHub Copilot works inside VS Code, Cursor is a special IDE, Claude Code works directly in your terminal.

FeatureClaude CodeGitHub CopilotCursor IDE
PlatformTerminal (CLI)VS Code extensionCustom IDE
File EditingDirect (in-place)Inline suggestionInline + edit
Terminal CommandsYesNoPartial (built-in)
MCP SupportYesNoPartial
Agentic LoopYes (autonomous)PartialYes
Multi-file EditingYesLimitedYes
CLI-first WorkflowFullNoPartial
Git IntegrationAuto (commit)ManualManual
Context Window200K tokenVariableVariable

When to Use Claude Code?

  • If you work terminal-heavy — development via tmux, neovim, ssh
  • In CI/CD pipelines — automated code changes and PR review
  • Multi-file refactoring — simultaneous changes across multiple files
  • Integration with MCP tools — database, API, file system access
  • Headless environments — GPU servers, container-based development

2. Installation

macOS (Homebrew)

brew install claude-code

npm (All Platforms)

npm install -g @anthropic-ai/claude-code

Verification

claude --version
# claude-code 0.2.30

API Key

On first run, it asks for an API key:

claude
# → Enter your Anthropic API key or set ANTHROPIC_API_KEY env variable

Alternatively, use environment variables:

export ANTHROPIC_API_KEY="sk-ant-..."
export CLAUDE_CODE_ALLOW_SCRIPTS=true  # Script execution permission (optional)
claude

After installation:

claude
# Claude Code CLI starts, waits for a prompt

3. Basic Usage

Interactive Mode

$ claude
> Analyze this project's structure and summarize it in README.md

Claude Code scans the project, reads files, creates README.md, and shows the result in the terminal. It asks for confirmation — type y to write to the file.

One-Shot Command

claude -p "Analyze test coverage in the src/ folder and list missing tests"

The -p flag lets you send a one-shot prompt. Ideal for CI/CD pipelines.

Pipe Usage

cat error.log | claude -p "Analyze the errors in this log and explain the causes"

File Redirection

claude -p "Find performance issues in this file" < src/main.ts

4. Agentic Coding: Claude Code’s Most Powerful Feature

The most important feature that sets Claude Code apart is the agentic loop. When you give a task, Claude Code:

  1. Scans the project and understands context
  2. Reads necessary files
  3. Plans changes
  4. Edits code
  5. Runs tests
  6. Fixes errors
  7. Makes a commit

This loop runs completely autonomously.

Example: Adding a Feature

$ claude
> Add an API endpoint for users to upload profile photos.
> File size should be limited to 5MB, only allow jpg/png/webp formats.
> Create a thumbnail with Sharp and save to Cloudflare R2.

Claude Code follows these steps:

  1. Reads router files to understand existing API structure
  2. Checks the model layer
  3. Checks required dependencies (sharp, @aws-sdk/client-s3)
  4. Writes the route handler
  5. Adds validation (file type, size check)
  6. Sets up Sharp thumbnail pipeline
  7. Writes R2 upload function
  8. Runs tests
  9. Fixes any errors
  10. git commit -m "feat: add profile photo upload endpoint"

Output:

✓ Project structure analyzed (18 files read)
✓ Route handler created: src/routes/profile/upload.ts
✓ Validation added: file type + size check
✓ Sharp thumbnail pipeline created
✓ R2 upload service added
✓ Tests passed (3 tests, 0 fail)
✓ Commit made: feat: add profile photo upload endpoint
Total: 47 seconds

Agentic Loop Configuration

# Maximum tool call limit (default: 50, usually sufficient)
export CLAUDE_CODE_MAX_TOOL_CALLS=100

# Script execution permission
export CLAUDE_CODE_ALLOW_SCRIPTS=true

# Verbose log
export CLAUDE_CODE_VERBOSE=true

5. MCP (Model Context Protocol) Integration

One of Claude Code’s most powerful features is MCP support. With MCP, Claude Code can directly interact with external tools (database, API, file system).

What is MCP?

MCP (Model Context Protocol) enables AI models to communicate with external tools through a standard protocol. It’s an open standard developed by Anthropic.

MCP Server Configuration

// ~/.claude/claude.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_..."
      }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
    },
    "brave-search": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "..."
      }
    }
  }
}

Practical Usage Examples

With PostgreSQL:

$ claude
> Check the schema of the users table in the database
> and list users whose email address hasn't been verified

With GitHub:

$ claude
> Check the open issues on GitHub
> and create PRs for the most critical 3

With Brave Search:

$ claude
> Search for the latest Next.js 15 release notes
> and compare with the current Next.js version in our project

6. Claude Code in CI/CD Pipeline

You can use Claude Code in CI/CD pipelines for automated code changes and PR reviews.

Automated Code Review with GitHub Actions

# .github/workflows/claude-code-review.yml
name: Claude Code Review
on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm install -g @anthropic-ai/claude-code
      - run: |
          claude -p "Review this PR. Evaluate based on the following criteria:
          1. Are there security vulnerabilities?
          2. Are there performance issues?
          3. Does it follow best practices?
          4. Is test coverage sufficient?
          Write the results as a PR comment."
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Automated Changelog and Release Notes

# .github/workflows/release-notes.yml
on:
  push:
    branches: [main]

jobs:
  changelog:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - run: npm install -g @anthropic-ai/claude-code
      - run: |
          claude -p "Analyze changes since the last tag
          and update the CHANGELOG.md file. Categorize according to
          Conventional commits format: feat, fix, docs, refactor, chore."
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

7. Daily Workflow: How I Use It

Morning Routine

To check project status every morning:

$ claude
> Check all branches. Summarize changes made in the last 24 hours.
> List pending tasks and indicate which ones are priorities.

Development Loop

The cycle I use during development:

  1. Planning: claude -p "Create an implementation plan for this feature"
  2. Coding: Direct commands to Claude Code
  3. Review: claude -p "Review the last commit"
  4. Refactor: claude -p "Clean up this module, remove duplicate code"
  5. Testing: claude -p "Write tests for this feature"

Debug Workflow

For debugging:

$ claude
> Analyze the last 100 lines in production.log.
> Find the 3 most common errors and suggest fixes.
> Apply fixes and run tests.

Code Review

For reviewing my own PRs:

$ claude -p "Review the changes in the last commit.
Find potential issues. Categorize changes:
- Security
- Performance
- Type safety
- Test coverage"

8. Tips and Best Practices

1. Context Management

Claude Code has a 200K token context window, but it starts fresh each session. To maintain project context:

# Create a CLAUDE.md file — at the project root
# CLAUDE.md — Project Context

## Project Structure

- src/api/ — Express routers
- src/services/ — Business logic
- src/db/ — Prisma schemas and migrations
- tests/ — Jest tests

## Coding Standards

- TypeScript strict mode
- Functional components preferred
- PascalCase for types, camelCase for functions
- Test coverage minimum 80%

## Frequently Used Commands

- `pnpm dev` — Development server
- `pnpm test` — Test suite
- `pnpm lint` — ESLint
- `pnpm typecheck` — TypeScript check

This file is automatically read every time you run claude.

2. Prompt Engineering

# ❌ Bad prompt
claude -p "Make a login page"

# ✅ Good prompt
claude -p "
Add an email+password login endpoint to src/routes/auth/login.ts.
- Input validation with Zod
- Password hash comparison with bcrypt
- Return JWT token
- Rate limiting: 5 attempts/minute
- Error messages: 'Invalid credentials' (don't give specific errors)
- Use pattern matching existing project structure
"

3. Security

Since Claude Code can run terminal commands, be careful:

# Only allow scripts you trust
export CLAUDE_CODE_ALLOW_SCRIPTS=false  # default

# Or allow specific scripts
export CLAUDE_CODE_ALLOW_SCRIPTS="pnpm,npm,node,git,tsc,jest,eslint"

4. Cost Optimization

Claude Code’s cost depends on token usage:

OperationToken (approx)Cost (approx)
Simple file edit~5K-10K~$0.015
Feature implementation~50K-100K~$0.15
Full code review~30K-80K~$0.12
Daily workflow~100K-300K~$0.30

Tips:

  • Maintain context consistency with CLAUDE.md, don’t re-explain things
  • Use Headless mode (claude -p "...") to avoid unnecessary dialogue
  • Use file filtering to only load relevant files into context

9. Claude Code vs. Alternatives

A comparison based on my own experience:

CriteriaClaude CodeCline (VS Code)Aider
SpeedFastMediumFast
Code QualityHighMediumHigh
Context ManagementAutomaticManualAutomatic
Multi-file EditExcellentGoodGood
Terminal IntegrationFullVS Code terminalFull
MCP SupportYesYesPartial
PriceAPI costAPI costAPI cost
Learning CurveSteep (CLI)Low (IDE)Medium

When to use which?

  • Claude Code: Terminal-heavy, headless, CI/CD integration
  • Cline: Working with visual interface inside VS Code
  • Aider: Git-native, pair programming workflow

10. Conclusion

Claude Code is one of the most capable tools for AI-powered software development from the terminal. Especially:

  • Autonomous feature implementation with agentic loop
  • Interaction with external tools via MCP integration
  • Automated code review in CI/CD pipelines
  • Multi-file editing and refactoring

What we learned in this article:

  • ✅ Claude Code installation and basic usage
  • ✅ Autonomous development with agentic coding
  • ✅ External tool connection with MCP integration
  • ✅ CI/CD pipeline integration
  • ✅ Daily workflow and best practices
  • ✅ Security and cost optimization

If you want to try Claude Code, I recommend starting with a small refactoring task. Ask it to make changes in a single file in an existing project — then gradually move to more complex tasks.


Hero image: generated with fal.ai + FLUX.1 Dev


Resources

Back to Blog

Related Posts

View All Posts »
WhatsApp ile yazin