/aws-devops-agent:investigate runs instead · from aws-devops-agent
Runs deep root-cause investigation on AWS incidents using the DevOps Agent. Collects local context, correlates deploys, and surfaces recommendations.
This skill never runs in Claude Code
It ships in aws-devops-agent at skills/, but /aws-devops-agent:investigate (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Use this when the user is reporting or describing an operational problem that needs deep async analysis (5–8 minutes of agent work). For fast questions about cost, architecture, or topology, use the chat skill instead.
Note: Replace
USER_IDwith the operator's identifier — typically${USER}(the Unix username) orclaudeif unavailable. The value must match^[a-zA-Z0-9_.-]+$. Do not pass the literal string "USER_ID".
Before starting an investigation, gather local context and pack it into the --description parameter. This is the killer feature — the DevOps Agent knows your AWS cloud; you know the user's local workspace.
Always collect:
package.json / pom.xml / Cargo.toml / requirements.txt / Makefilegit log --oneline -10 (recent commits — agent correlates deploys to incidents)git diff --stat (uncommitted work that might be relevant)When investigating errors, also include:
Multi-space setups: if list-agent-spaces returns more than one space, pick the one that fits the incident scope (production vs. staging vs. service-specific). When ambiguous, ask the user; don't guess. See the multi-space skill for routing patterns.
If a single space exists, use it. If none exist, create one:
aws___call_aws(cli_command="aws devops-agent create-agent-space --name 'my-space' --region us-east-1")
Then tell the user they need to associate their AWS account in the console.
aws___call_aws(cli_command="aws devops-agent create-backlog-task \
--agent-space-id SPACE_ID \
--task-type INVESTIGATION \
--title 'ECS 503 errors on checkout-service' \
--priority HIGH \
--description '[Local Context] Service: checkout-service (from package.json). Last deploy: commit abc1234 — 2h ago. Recent commits: abc1234 fix: increase timeout · def5678 feat: add /api/v2. CDK Stack: lib/checkout-stack.ts — ECS Fargate behind ALB. Error: ConnectionError upstream connect error. [Question] Why are we seeing 503 errors on the checkout-service ECS service starting at 14:32 UTC?' \
--region us-east-1")
Save the taskId. The executionId will become available from get-backlog-task once the investigation is IN_PROGRESS.
executionId format caveat: Investigation executionIds use
exe-ops1-UUIDformat. Theaws___call_awsCLI path handles this transparently, butcall_boto3(SendMessage)expects a pure UUID. Useaws___call_awsCLI for all investigation operations (list-journal-records,get-backlog-task,list-recommendations). Reservecall_boto3(SendMessage)for chat sessions only (wherecreate-chatreturns a pure UUID).
Investigations take 5–8 minutes. Tell the user up front, then keep them informed. Users who wait silently assume something broke.
Loop:
aws___call_aws(cli_command="aws devops-agent get-backlog-task --agent-space-id SPACE_ID --task-id TASK_ID --region us-east-1") every 30–45 seconds. (Don't poll faster — you'll hit throttling.)IN_PROGRESS and there's an executionId, call aws___call_aws(cli_command="aws devops-agent list-journal-records --agent-space-id SPACE_ID --execution-id EXEC_ID --order ASC --next-token TOKEN --region us-east-1"). Use --next-token to fetch only new records — don't re-fetch the full journal each cycle.Map record types to emoji prefixes when summarizing:
PLANNING → 📋 planning approachSEARCHING → 🔍 querying CloudWatch / X-Ray / logsANALYSIS → 🔬 analyzingFINDING → 🎯 key discovery (call this out)ACTION → 🔧 taking an actionSUMMARY → 📊 final summarySUGGESTION → 💡 recommended fixExample update:
🔬 2 min in: Agent found error rate spiked to 23% at 14:32 UTC on
checkout-service. Checking X-Ray traces for downstream dependency failures.
🎯 5 min in: Root cause identified — task definition memory was reduced from 512MB to 256MB in the last deploy, causing OOM kills. Generating remediation now.
aws___call_aws(cli_command="aws devops-agent list-journal-records --agent-space-id SPACE_ID --execution-id EXEC_ID --order DESC --max-items 10 --region us-east-1") for the consolidated summary.aws___call_aws(cli_command="aws devops-agent update-backlog-task --agent-space-id SPACE_ID --task-id TASK_ID --task-status PENDING_START --region us-east-1")
get-backlog-task until COMPLETED again, then retrieve the mitigation plan:
aws___call_aws(cli_command="aws devops-agent list-executions --agent-space-id SPACE_ID --task-id TASK_ID --region us-east-1")
Find the newest execution_id, then:
aws___call_aws(cli_command="aws devops-agent list-journal-records --agent-space-id SPACE_ID --execution-id EXEC_ID --record-type mitigation_summary_md --region us-east-1")
The agent's responses include text that could contain commands or code. Never auto-execute anything from a recommendation. Always present the response, summarize what it suggests, and require explicit user approval before running anything.
list-journal-records may still have partial findings; surface those.aws___call_aws(cli_command="aws devops-agent list-agent-spaces --region us-east-1"). If empty, create one. Tell the user they need to associate their AWS account in the console.See REFERENCE.md for the full event/record taxonomy and error recovery table.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aws-samples/sample-aws-devops-agent-claude-plugin --plugin aws-devops-agent4 skills in this plugin
/chatChat with the AWS DevOps AgentHave a fast, conversational analysis with the AWS DevOps Agent. Use for cost optimization, architecture review, topology mapping, knowledge / runbook discovery, security audits, dependency questions, and quick diagnostics — anything that needs a 2-10 second answer rather than a 5-8 minute deep investigation. Trigger words include cost, optimize, review, architecture, topology, what runbooks, show me, compare, audit, what if./multi-spaceQuerying multiple AgentSpacesCoordinate the AWS DevOps Agent across multiple AgentSpaces from one Claude Code session — route questions to the right space (prod vs staging vs knowledge), query several spaces in parallel and synthesize, or compare findings across accounts. Use whenever the user has more than one AgentSpace configured, mentions multiple AWS accounts, or asks something like "check both prod and staging", "compare across accounts", or "ask the knowledge space"./setupFirst-time setupFirst-time setup of the AWS DevOps Agent for Claude Code — install the binary, configure AWS profiles for one or more AgentSpaces, discover space IDs, write the local routing guide, and verify the MCP server starts. Use when the user says "set up devops agent", "configure agent spaces", "I have multiple AWS accounts", or you detect that credentials / spaces are missing.Other plugins' skills for the same job