cd /news/artificial-intelligence/how-to-use-claude-to-troubleshoot-li… · home topics artificial-intelligence article
[ARTICLE · art-27282] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

How to Use Claude to Troubleshoot Linux Servers

A developer shares a workflow for using Claude to troubleshoot Linux servers, based on a year of experience with Ubuntu, RHEL, and Rocky. The key is providing full context—OS, role, recent changes, and symptoms—rather than just an error message. Claude's long context enables multi-step diagnostic sessions, and the developer warns to always verify commands before running them.

read2 min publishedJun 14, 2026

Claude is genuinely useful for production Linux troubleshooting — when you use it right. Here's the workflow that works, after a year of using it on real incidents across Ubuntu, RHEL, and Rocky.

The mistake most engineers make on day one: they paste a 5-line error message and expect a fix. Claude can do better than that — but only if you give it the same context you'd give a senior engineer joining your incident bridge.

A senior engineer would want:

Give Claude that, and the quality of analysis changes completely.

Use our Linux Server Troubleshooting Prompt as your system prompt, or paraphrase: "You are a senior Linux sysadmin. Rank root-cause hypotheses by probability. Recommend safe diagnostics first. Label destructive commands as DANGEROUS."

Good:

OS: Ubuntu 22.04, kernel 5.15
Role: production MySQL replica, 64GB RAM, 16 cores
Recent changes: kernel upgrade 6 hours ago
Symptom: server load average 40+, MySQL replication lag growing, queries timing out

$ uptime
 14:22:01 up 6:02,  4 users,  load average: 41.23, 38.51, 35.04

$ free -h
              total        used        free      shared  buff/cache   available
Mem:           62Gi        58Gi       1.2Gi       128Mi       3.1Gi       1.8Gi

$ iostat -xz 2 3
[...]

Bad:

my server is slow can you help

The good prompts in our library tell Claude to ask for missing data before guessing. When it asks "can you share dmesg | tail -50

and vmstat 1 5

?" — that's a feature, not a flaw. Give it the data.

Claude will sometimes suggest a command with subtly wrong syntax, a destructive flag, or a path that doesn't exist on your distro. Read every suggestion before running. Never paste straight into a root shell.

Claude's long context means you can run a 30-minute diagnostic session in one thread, paste new output as you gather it, and the model retains the full diagnostic context. This is the single biggest workflow win versus older AI tools.

strace

, perf

, tcpdump

summaries).awk

/sed

/grep

one-liners for log analysis.A production server's load average suddenly spiked. Pasting top

, iostat -xz 2 3

, and dmesg | tail -50

into Claude with our prompt template, it immediately flagged: " %iowait is 78%, await on /dev/sda is 320ms, and dmesg shows 'task X blocked for more than 120 seconds.' The disk subsystem is saturated, not CPU. Investigate which process is doing heavy I/O: iotop -oP -d1 will show the writer in 1-second intervals."

That's exactly the diagnosis we wanted, framed with the evidence — in seconds.

This article was originally published on DevOps AI ToolKit — practical AI workflows for cloud engineers.

── more in #artificial-intelligence 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-use-claude-to…] indexed:0 read:2min 2026-06-14 ·