9
9
Table of Contents

1. Troubleshooting and Incident Triage

One area where Claude has made the biggest difference is incident troubleshooting.

When an alert comes in, the challenge usually isn't fixing the issue it's figuring out where to start. You're looking at thousands of log lines, multiple dashboards, and alerts coming from different systems, all while trying to understand what changed. That's where Claude is most useful.

Instead of manually scrolling through logs looking for patterns, it helps to provide the relevant logs along with a bit of context, such as when the issue started and any recent deployments or configuration changes.

For example, a prompt like this works well:

Here are the last 30 minutes of logs from our service. Errors started at 21:14 UTC. Find the first anomaly, group the errors by root cause, and identify anything that looks different from normal behavior.

Claude is particularly good at identifying the first event that triggered everything else. It might point out an out-of-memory event that occurred a few minutes before the application started failing, a configuration reload that coincided with the first errors, or a dependency that began timing out before the rest of the services were affected.

That doesn't mean it's always right, but it gives you a much smaller set of things to investigate. Instead of spending 20–30 minutes trying to correlate logs manually, the investigation can usually focus on a handful of likely causes within a few minutes.

It's equally helpful once the problem has been narrowed down to a specific component.

For example:

A pod keeps restarting. Here's the pod spec, the kubectl describe output, and the last 100 lines of container logs. The container exited with code 137. Walk me through the most likely causes, in order of probability, and explain what I should verify for each.

Rather than simply saying that exit code 137 usually indicates an out-of-memory kill, Claude tends to suggest a structured troubleshooting approach. It might recommend checking whether the container exceeded its memory limit, comparing memory requests and limits with actual usage, looking for signs of a memory leak, and finally verifying whether the node itself was under memory pressure.

The important part is that it helps organize the investigation, it doesn't replace it. Every suggestion should still be verified using Kubernetes events, metrics, and application logs before deciding on the actual root cause.

That's how AI fits into incident response. It doesn't make operational decisions for you, and it shouldn't. What it does well is reduce the time spent reading, correlating, and summarizing information so you can spend more time solving the problem. In practice, that's where it delivers the most value.

2. Automation and Scripting

Another area where Claude is genuinely useful is automation.

One of the most common things in DevOps is spotting repetitive work and thinking, "We should automate this." The problem is that writing the automation usually ends up at the bottom of the priority list. Between incidents, deployments, and project work, it's easy for those small improvements to get postponed.

Instead of starting with a blank file, describe exactly what you need and let it generate a first draft.

For example:

Write a Bash script for Ubuntu 22.04 that identifies Docker containers stuck in a restart loop (more than five restarts in the last 10 minutes), logs the container name along with the last 20 log lines to /var/log/container-x.log, and sends a summary to a Slack webhook. The script should run from cron every five minutes and exit safely if Docker isn't running.

Most of the time, the generated script is a solid starting point. It usually handles the overall logic correctly and saves you from writing the repetitive boilerplate. From there, you can focus on reviewing the implementation and adapting it to fit your environment.

The same approach works for plenty of other day-to-day tasks too. None of these tasks are particularly difficult, but they do take time, and that's exactly the kind of work where AI can provide a noticeable productivity boost.

If Claude uses a command or shell option that's unfamiliar, ask it to explain why it's there and whether it's actually necessary. For example:

Why are you using set -euo pipefail here? What problem does it solve, and what would happen if I removed it?

These follow-up questions are often just as valuable as the generated script itself because they help you understand the reasoning behind the implementation.

The right way to use AI for automation let it handle the repetitive parts of writing code, but keep the responsibility for reviewing, testing, and maintaining that code with the engineer. A script can save hours of manual work but only if you trust it because you've verified it, not because an AI wrote it.

3. Documentation That Actually Gets Written

Documentation is one of those things every DevOps team knows is important, but it almost always gets pushed behind operational work. When you're focused on incidents, deployments, or infrastructure changes, writing documentation rarely feels like the highest priority.

Claude is particularly useful here because it removes the hardest part of documentation starting from scratch. Instead of staring at a blank document, you can provide the relevant information and let it generate a structured first draft that you can review and refine.

Explaining Technical Information

One capability that often goes unnoticed is Claude's ability to explain technical information at different levels of detail.

It's regularly useful for understanding unfamiliar scripts, summarizing complex configurations, or translating technical details into language that's easier for different audiences to understand.

Some common prompts are:

Explain what this Bash script does and walk through it step by step.

Summarize this Terraform module and describe the AWS resources it creates.

Convert this internal incident summary into a customer-facing status update.

These aren't particularly difficult tasks, but they take time especially when switching between technical documentation and communication with stakeholders. Claude helps reduce that effort while still allowing to review the final output before sharing it.

It speeds up the writing process without replacing the engineer's understanding of the system. The final documentation is still reviewed and refined by the team, but getting to that first draft is significantly faster.

4. CI/CD Assistance

One area that's genuinely surprising is CI/CD. At first, Claude didn't seem like it would be particularly useful for pipelines. CI/CD configurations tend to be verbose, provider-specific, and full of small syntax details that are easy to forget. Whether it's Jenkins, GitLab CI, GitHub Actions, or Azure DevOps, most of us spend as much time looking up documentation as we do writing the pipeline itself.

After using it for a while, Claude turns out to be surprisingly good at handling this kind of work.

Writing Pipeline Configurations

Instead of manually building a pipeline from scratch, describe it in plain English and let Claude generate the initial configuration.

For example:

Write a declarative Jenkins pipeline (Jenkinsfile) that runs on pull requests to the main branch. It should lint and unit test a Python 3.11 application, build a Docker image, scan it using Trivy, and push the image to Amazon ECR only if the scan succeeds and the branch is main. Cache pip dependencies between builds.

The generated pipeline is rarely perfect, but it's usually close. Most of the structure, stage ordering, caching, and conditional execution are already in place, which means the time goes into reviewing and refining the Jenkinsfile instead of writi­ng Groovy from scratch.

Troubleshooting Pipeline Failures

This is probably where Claude gets used most often.

Rather than reading hundreds of lines of CI logs manually, provide the failed pipeline, the relevant stage logs, and any supporting files, then ask Claude to explain what might have gone wrong.

For example:

This Jenkins pipeline fails during the Docker build stage with COPY failed: no source files were found. Here's the Jenkinsfile, the Dockerfile, and the repository structure. What is the most likely cause?

In many cases, Claude identifies issues that are easy to overlook, such as an incorrect build context, an invalid file path, missing artifacts between stages, or a mismatch between the Dockerfile and the repository layout.

That doesn't replace debugging, but it often helps narrow the investigation to a much smaller set of possibilities.

Reviewing Pipeline Changes

Another valuable use case is reviewing CI/CD changes before they're merged.

When making changes to a Jenkinsfile, it's worth asking Claude to review the configuration from a reliability and security perspective.

For example:

Review this Jenkinsfile. Are there any security concerns, credentials scoped more broadly than necessary, missing failure conditions, or edge cases that could cause unexpected behavior?

On more than one occasion, it's pointed out overly broad credentials, missing dependency checks, or stages that would behave differently depending on the branch or trigger event.

Again, those suggestions aren't final decisions, but they serve as another review pass before the code reaches production.

That's the best way to use AI in CI/CD. Let it generate, explain, and review pipeline configurations but keep the final approval and deployment decisions with the engineering team.

The Guardrails

The practical use cases are interesting, but they're only half the story. AI can improve productivity, but without the right safeguards it can just as easily introduce new risks.

These are the principles that matter most when using Claude for DevOps work.

Provide Context

The quality of the response depends heavily on the information you provide.

A prompt like:

Why is my pod crashing?

will usually result in a generic troubleshooting checklist.

On the other hand, providing the pod specification, Kubernetes events, recent deployment details, and application logs gives Claude enough context to produce a much more relevant analysis.

It's like onboarding a new engineer. They're capable of solving the problem, but they don't know anything about your environment until you explain it.

Keep Humans in Control

One rule worth following consistently is that AI can recommend actions, but people make the final decisions.

It's fine to let Claude analyse logs, explain an error, suggest a Terraform change, or draft a Kubernetes command. What it shouldn't do is execute those actions automatically.

Infrastructure changes, deployments, restarts, deletions, and production rollbacks should always be reviewed and approved by an engineer. AI can speed up the investigation, but operational responsibility should remain with the team.

Protect Sensitive Information

Infrastructure logs and configuration files often contain API keys, tokens, internal hostnames, customer information, or other sensitive data.

Before sharing anything with an AI assistant, make sure that confidential information has been removed or anonymised. If AI becomes part of a team's regular workflow, it's worth investing in automated sanitisation so engineers don't have to rely on remembering to clean logs during an incident.

Where possible, enterprise AI deployments with appropriate security and compliance controls are a much better choice than personal accounts.

Verify Everything

Like any engineer, Claude can be wrong.

The difference is that it often presents incorrect information with the same level of confidence as a correct answer.

That's why every suggestion is best treated as a hypothesis rather than a fact. Whether it's a generated script, a Terraform configuration, or an explanation of an error message, verify it before using it in production.

The goal isn't blind trust, it's faster investigation backed by human validation.

Know When Not to Use AI

There are also situations where AI should be deliberately avoided.

For example:

AI shouldn't be allowed to make autonomous rollback or failover decisions.

Regulated or compliance-sensitive information shouldn't be shared unless it's been approved by the appropriate security team.

AI shouldn't be relied on as a substitute for understanding how your systems work.

AI should help engineers become more productive not become a dependency that replaces engineering knowledge.

Start Small and Build from There

In practice, it's much more effective to start with low-risk tasks where the benefits are easy to measure.

Documentation is usually a good starting point. After that, incident investigation and log analysis tend to provide immediate value because they reduce time spent reading and correlating information. Once the team becomes comfortable using AI in those areas, it becomes much easier to extend it to automation, scripting, and CI/CD.

The important part is measuring the impact. Look at metrics such as incident investigation time, documentation effort, or the time required to build and troubleshoot new pipelines. Those numbers will tell you whether AI is actually improving your workflow.

12
Let's discuss your cloud challenges and see how CloudKeeper can solve them all!
Meet the Author
  • Diya Khandelwal
    DevOps Engineer

    Diya Khandelwal is a cloud enthusiast with deep expertise in AWS and a knack for simplifying complex systems.

No Comments Yet
Leave a Comment
Certified. Trusted. Industry Recognized.

Stop paying for cloud tools. Start paying for outcomes.

Get Started with CloudKeeper