Claude Code

Boost Your Productivity with AI

Workshop 1: AI Tools for Cloud Engineering

Duration: 90 minutes

What We'll Cover Today

1

Introduction to AI for Engineers

Understanding AI as an amplifier and the importance of adoption

2

What is Claude Code?

Overview of the official Anthropic CLI and its capabilities

3

Installation & Setup

Getting started with Vertex AI and your GCP sandbox

4

Terminal & VSCode Usage

Practical examples and workflows in your development environment

5

Advanced Features

MCP servers, subagents, and extending Claude's capabilities

6

Best Practices & Real-World Examples

How to use AI wisely and safely in production environments

AI as an Amplifier,
Not a Replacement

→ AI is transforming software engineering daily, introducing new tools and workflows.

→ It's here to amplify our capabilities—handling repetitive tasks so we can focus on complex problem-solving.

→ The human factor—creativity, critical thinking, and domain expertise—remains crucial and irreplaceable.

AI amplifying human capabilities

Jump on the AI Train or Get Left Behind

• The productivity gap between AI-augmented teams and others is growing exponentially.

• AI proficiency is becoming an essential skill, just like Git or Docker.

• Adopting these tools now provides a significant competitive advantage for you and the team.

Exponential growth and momentum

AI Superpowers for Cloud Engineers

Accelerate code development
Debug and solve problems faster
Auto-generate documentation
Learn new technologies quickly
Automate repetitive tasks
Improve code reviews
AI Superpowers

SECTION 1

What is Claude Code?

Claude Code: Your AI Pair Programmer

Key Capabilities

Direct Codebase Access

Reads and understands your project files without copy-pasting.

Complete Project Context

Gains a holistic understanding of your entire repository.

Command Execution

Can run bash commands to check status, run tests, or install dependencies.

File Editing

Applies suggested changes directly to your files with your approval.

MCP Tool Integration

Connects to external tools like Kubernetes, GitHub, and databases.

Specialized Agent System

Delegates complex tasks to a team of specialized subagents.

Capabilities Network

SECTION 2

Installation & Setup

What You'll Need

Node.js 18 or higher
A compatible terminal (bash/zsh recommended)
GCP Sandbox project (mo-sandbox-yourname)

Your GCP Sandbox Environment

Each team member has a personal sandbox project already set up:

Project Name

mo-sandbox-nombreapellido

Vertex AI API

Already enabled ✓

Roles

roles/aiplatform.user
roles/owner

Budget

500€ with alerts

📚 Documentation: github.com/masmovil/infrastructure

Installation Steps LIVE DEMO

1. Install Native Binary (macOS)

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

Beta version with better performance than npm package

2. Configure Vertex AI Environment Variables

Add to your shell config file (.bashrc, .zshrc, etc.):

export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=global
export ANTHROPIC_VERTEX_PROJECT_ID=mo-sandbox-yourname

⚠️ We use API billing through Vertex AI, not Claude subscription

3. Authenticate with GCP

gcloud auth application-default login

4. Start Claude Code

claude

SECTION 3

Terminal Usage

Claude Code CLI Basics

claude
Starts a new interactive chat session in the current directory.
claude "your question"
Runs a single command and prints the output without starting a session.
claude --print "prompt"
Headless mode for automation, scripts, and CI/CD pipelines. No terminal UI.
claude --help
Displays a list of all available commands and options.

💡 Headless Mode Options

Use Cases: Perfect for shell scripts, git hooks, pre-commit checks, and automated workflows.

--allowedTools: Restrict which tools Claude can use (e.g., --allowedTools Read,Grep)

--permission-mode: Set automatic permission mode (allow-all, deny-all, or ask)

Terminal Power in Action LIVE DEMO

Core Capabilities

Read & Search

Access any file and search entire codebase

Execute Commands

Run bash, kubectl, terraform, etc.

Edit Files

Make direct code modifications

Generate & Explain

Create code and explain complex logic

Debug & Analyze

Investigate logs and trace issues

Practical Examples

1. Project Analysis

claude "Summarize this project's purpose and tech stack. What's the entrypoint file?"

2. Log Debugging

claude "Analyze error.log. What is the root cause of the frequent NullPointerException?"

3. Infrastructure Updates

claude "Update the Terraform config to increase the instance count from 3 to 5 and apply the changes"

4. Refactoring

claude "Refactor 'calculate_totals' in utils.py for better performance and add comments"

Powerful Slash Commands

Slash commands are special shortcuts that give you quick access to Claude Code's advanced features. Type them in the chat to instantly perform common tasks like managing agents, configuring integrations, or controlling permissions.

1. /agents - Manage AI Agents

/agents

View and manage active AI agents in your workspace

2. /mcp - Model Context Protocol

/mcp

Configure and interact with MCP servers for external integrations

3. /permissions - Manage Permissions

/permissions

Control which tools and commands Claude can execute automatically

Claude Code Memory

How Memory Works

Claude Code can remember context across conversations, making interactions more efficient and personalized.

  • Stores important facts, preferences, and project details
  • Automatically recalls relevant information in future chats
  • Reduces repetitive explanations
  • Improves response quality over time

💡 Memory Levels

User-level: Shared across all projects

Project-level: Specific to current project

Tip: Store coding standards, project conventions, and team preferences in CLAUDE.md files for consistent AI assistance.

Configuration

CLAUDE.md Files

Create markdown files to store memory:

~/.claude/CLAUDE.md - User-level (all projects)

.claude/CLAUDE.md - Project-level (current repo)

CLAUDE.md - File-level (specific context)

Quick Access with #

Type # in chat to quickly reference CLAUDE.md:

# "What coding style do we use?"

/memory Command

Manage memory via slash command:

/memory

SECTION 4

VSCode Integration

Claude Code in Your Favorite IDE

Installation

  1. Open the Extensions view (Ctrl+Shift+X).
  2. Search for "Claude Code".
  3. Click "Install" on the official extension by Anthropic.
  4. Reload VSCode and log in via the command palette.
VSCode Integration

Integrated Development Experience

Integrated Chat

A sidebar chat that is fully aware of your open workspace.

Code Selection Context

Highlight code to automatically include it as context in your prompt.

Inline Editing

Generate and apply code changes directly in your editor.

Terminal Integration

Runs commands within the integrated VSCode terminal.

Diff View

Review proposed changes in a clear side-by-side diff before accepting.

Recommended VSCode Workflow

1
Select Relevant Code: Highlight the specific function or block you're working on.
2
Ask a Specific Question: Use the chat to ask for refactoring, explanation, or tests.
3
Review Suggestions: Carefully examine the proposed changes in the diff view.
4
Apply with Judgment: Accept the changes if they are correct and meet your standards.
5
Validate & Test: Always run your tests and manually validate the changes.

SECTION 5

Model Context Protocol (MCP)

Extending Claude's Capabilities

MCP is a protocol that allows Claude Code to securely connect with external tools and services.

It creates a powerful, extensible ecosystem, turning Claude into a central hub for your entire workflow.

Enables direct access to databases, cloud APIs, internal services, and more.

Connect Claude to your entire toolchain.

MCP Server Ecosystem

Kubernetes MCP

Interact with your k8s cluster: check pods, read logs, apply manifests.

Atlassian MCP

Interact with Jira and Confluence to manage issues and documentation.

GitHub MCP

Manage repos, issues, and pull requests directly from the CLI.

Slack MCP

Send messages, read channels, and interact with your team.

Custom MCP

The true power: Build your own MCP server to connect to any internal API or service!

MCP Ecosystem

Setting Up MCP

Configuration Levels

🌍 User-level

~/.claude/mcp.json

Global for all projects

📁 Project-level

./.claude/mcp.json

Specific to current project

⚡ Local/Session

Temporary config

For current session only

Easy Setup with CLI

Add MCP Server

claude mcp add kubernetes

Claude will guide you through the configuration

List MCP Servers

claude mcp list

View all configured MCP servers

⚠️ Security

MCP servers execute commands. Only use trusted sources!

Managing Secrets in MCP Servers

❌ Don't Hardcode Secrets

Never store API keys directly in config:

{
  "apiKey": "sk-1234567890abcdef"  ❌
}

✅ Use Environment Variables

Reference env vars in config:

{
  "env": {
    "API_KEY": "${GITHUB_TOKEN}"
  }
}

Set in your shell: export GITHUB_TOKEN=sk-...

🔐 OAuth2 Authentication

1. MCP Server Initiates Flow

Server provides authorization URL via MCP protocol

2. User Authorizes in Browser

Claude opens browser for authentication

3. Token Exchange

Server receives token and stores securely

💡 Best Practices

  • Use OAuth2 for user-scoped access
  • Store tokens in secure keystores
  • Never commit secrets to git
  • Use .env files (gitignored)

Example: Kubernetes Integration LIVE DEMO

You can ask Claude to interact with your cluster directly.

claude "Using the kubernetes tool, list all pods in the 'production' namespace 
that are in a CrashLoopBackOff state, then get the logs for the first one you find."

Claude will generate and execute the necessary kubectl commands.

> Executing: kubectl get pods -n production | grep CrashLoopBackOff
> Executing: kubectl logs -n production pod-xyz-12345

SECTION 6

Subagent System

Specialized Agents for Complex Tasks

Available Subagents

General-purpose Agent

Breaks down complex research and multi-step tasks into smaller, executable steps.

Code-reviewer Agent

Performs a deep static analysis of code, checking for bugs, style violations, and security issues.

Test-runner Agent

Finds, executes, and analyzes the results of your project's test suite.

Custom Agents

Define your own agents with specific goals and capabilities for your team's unique workflows.

Subagent Hierarchy

Subagent Use Cases

Building Your Own Agents

Community-Built Agents

Learn from existing agents created by the community:

📦 Agent Repository

github.com/wshobson/agents

Browse pre-built agents for code review, testing, documentation, and more

💡 Pro Tip

Use Claude to help you create custom agents! Just describe what you need and Claude can generate the agent definition for you.

Agent Location

Agents must be placed in your project directory:

.claude/agents/your-agent-name.md

Example Agent (Markdown)

---
name: code-reviewer
description: Review code for bugs and issues
tools: [Read, Grep, Edit, Bash]
---

Act as a senior engineer reviewing code.
Check for bugs, performance issues, and
adherence to best practices...

SECTION 7

Day-to-Day Examples

Real-World Scenarios

Production Debugging

"Here are the logs from our crashed pod. Analyze them, find the root cause in the codebase, and suggest a fix."

Automated Code Review

"Act as a senior engineer and review the changes in my last git commit. Check for bugs, performance issues, and adherence to our style guide."

Test Writing

"Write comprehensive unit tests for the 'user_auth.ts' file. Cover all edge cases, including invalid inputs and error handling."

Jira Integration

"Implement this Jira issue ISSUE-123"

OpsGenie Alert Analysis

"Why was this alert triggered? https://masorange.app.opsgenie.com/alert/detail/..."

Slack Thread Investigation

"What's the issue in this Slack thread? https://masstack.slack.com/archives/..."

More Real-World Scenarios

Documentation Generation

"Generate a README.md for this microservice. Include a project summary, setup instructions, and API endpoint documentation based on the code."

Infrastructure as Code

"Write a Terraform module to provision a secure S3 bucket with versioning, encryption, and a lifecycle policy to move objects to Glacier after 90 days."

Code Migration

"I need to migrate this project from Python 2 to Python 3. Analyze the codebase and provide a list of necessary changes and the refactored code."

Real-World Scenarios

SECTION 8

Best Practices

How to Get Better Results

Critical: Human Judgment Required

  • NEVER apply code without a thorough review. You are the final authority.
  • Understand every line of code you commit. If you don't understand it, ask Claude to explain it.
  • Test locally first. Always validate AI-generated code with your own tests.
  • Do not share secrets, API keys, or proprietary data in your prompts.
  • Validate for security vulnerabilities. AI can sometimes produce insecure code.
Security and Validation

Using AI Wisely

→ Use AI to offload repetitive and boilerplate tasks (writing tests, docs, basic functions).

→ This frees you up to focus on high-value work like system design, architecture, and complex logic.

→ Actively learn from AI suggestions to improve your own skills.

→ Avoid 100% dependency. It's a tool to assist you, not replace your thinking.

Learn More

Homework for Next Session

Install Claude Code on your machine.
Try 2-3 of the use cases from today.
Share your experiences and findings in our Slack channel.
Identify one task in your current work that could be automated.

Coming Up Next...

Workshop 2: Advanced AI Workflows

  • Advanced Claude Code techniques & prompting.
  • Building a custom MCP server for our internal tools.
  • Automating team workflows (e.g., PR reviews).
  • Developing specialized agents for Cloud Engineering tasks.

Questions?

Let's Build Amazing Things
with AI!

Thank you for attending.