Claude Code
Boost Your Productivity with AI
Workshop 1: AI Tools for Cloud Engineering
Duration: 90 minutes
What We'll Cover Today
Introduction to AI for Engineers
Understanding AI as an amplifier and the importance of adoption
What is Claude Code?
Overview of the official Anthropic CLI and its capabilities
Installation & Setup
Getting started with Vertex AI and your GCP sandbox
Terminal & VSCode Usage
Practical examples and workflows in your development environment
Advanced Features
MCP servers, subagents, and extending Claude's capabilities
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.
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.
AI Superpowers for Cloud Engineers
SECTION 1
What is Claude Code?
Claude Code: Your AI Pair Programmer
- Official Anthropic CLI for Claude 4.5 Sonnet.
- Native integration with your local development environment.
- Works where you work: Terminal + VSCode support.
- Designed from the ground up specifically for engineers to be fast and context-aware.
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.
SECTION 2
Installation & Setup
What You'll Need
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
💡 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
Access any file and search entire codebase
Run bash, kubectl, terraform, etc.
Make direct code modifications
Create code and explain complex logic
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
- Open the Extensions view (Ctrl+Shift+X).
- Search for "Claude Code".
- Click "Install" on the official extension by Anthropic.
- Reload VSCode and log in via the command palette.
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
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!
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
- A team of task-specific agents working under the main Claude agent.
- Enables autonomous multi-step execution for complex problems.
- You can delegate a high-level goal, and the agent system will figure out the steps to achieve it.
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 Use Cases
- Complex multi-step tasks: "Figure out why our staging deployment is failing, fix it, and redeploy."
- Deep codebase research: "Find all instances where we use the deprecated 'lib-v1' and create a migration plan to 'lib-v2'."
- Automated pipeline execution: "Run the test suite. If it passes, run the code-reviewer agent on the new changes. If that passes, create a pull request."
Building Your Own Agents
Community-Built Agents
Learn from existing agents created by the community:
📦 Agent Repository
github.com/wshobson/agentsBrowse 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."
SECTION 8
Best Practices
How to Get Better Results
- Be specific and contextual: Instead of "fix this code," say "This code throws a TypeError when the input is null. Please add a check to handle this case."
- Provide examples: Give input and expected output. "For a pod named 'api-server' in namespace 'production', the kubectl command should return its CPU and memory usage."
- Define constraints: Mention tech stack, style guides, or performance needs. "Refactor this using ES6 syntax, and it must not use any external libraries."
- Use extended thinking for complex problems: Start your prompt with "Think:" to enable Claude's extended thinking mode, allowing deeper reasoning for algorithmic challenges, architectural decisions, or complex debugging.
- Iterate and refine: If the first answer isn't perfect, provide feedback and ask for a revision. "That's a good start, but can you also add error logging?"
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.
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
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.