/aws-devops-agent:chat runs instead · from aws-devops-agent
Provides fast conversational analysis with the AWS DevOps Agent for cost optimization, architecture review, topology mapping, security audits, and diagnostics.
This skill never runs in Claude Code
It ships in aws-devops-agent at skills/, but /aws-devops-agent:chat (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Chat is the default. It's instant, conversational, and the agent retains full context within an executionId. Only escalate to create-backlog-task when the user describes an incident or the agent itself suggests deeper analysis is warranted.
Preferred — use the local chat tool:
devops_agent_chat__send_message(
agent_space_id="SPACE_ID",
content="[Local Context]\n<IaC, git log, errors>\n\n[Question]\nWhat's causing the 503 errors?"
)
→ {"execution_id": "uuid", "response": "Based on my analysis...", "warning": null}
This handles CreateChat, SendMessage, and EventStream parsing internally. One call, plain text back. Reuse execution_id for follow-ups in the same conversation.
Fallback — if devops_agent_chat__send_message is not in your available tools (local MCP server didn't start), use the aws___run_script path below. Tell the user: "Local chat server unavailable — using raw AWS MCP path. Run the setup skill to configure it."
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".
Pick the AgentSpace.
aws___call_aws(cli_command="aws devops-agent list-agent-spaces --region us-east-1") → save agent_space_id
For multi-space setups, see the multi-space skill.
Open a chat session.
aws___call_aws(cli_command="aws devops-agent create-chat --agent-space-id SPACE_ID --user-id USER_ID --user-type IAM --region us-east-1") → executionId
Save executionId and reuse it for the entire conversation. The agent retains full context server-side.
Inject local context, then ask using aws___run_script with the call_boto3 streaming pattern:
aws___run_script(code="""
response = await call_boto3(
service_name='devops-agent',
operation_name='SendMessage',
region_name='us-east-1',
params={
'agentSpaceId': 'SPACE_ID',
'executionId': 'EXEC_ID',
'userId': 'USER_ID',
'content': '''[Local Context]
<relevant IaC, dependency manifest, error log, git state>
[Question]
<what the user actually asked>'''
}
)
# Collect streamed response — skip 'final_response' duplicate blocks
full_response = []
current_block_type = None
for event in response['events']:
if 'contentBlockStart' in event:
current_block_type = event['contentBlockStart'].get('type')
elif 'contentBlockDelta' in event:
if current_block_type in (None, 'text'): # Skip 'final_response' duplicates
delta = event['contentBlockDelta'].get('delta', {})
if 'textDelta' in delta:
full_response.append(delta['textDelta']['text'])
elif 'contentBlockStop' in event:
current_block_type = None
elif 'responseFailed' in event:
print(f"Error: {event['responseFailed']['errorMessage']}")
print(''.join(full_response))
""")
The response comes back as collected text. Show it to the user.
Why
aws___run_script?SendMessagereturns an EventStream thataws___call_awscannot handle. Thecall_boto3helper iterates the stream inside the sandbox. Note: rawimport boto3is blocked by the sandbox — always useawait call_boto3(...)with aparams={}dict.
Follow up. Reuse the same executionId — the agent keeps context. Don't open a new chat per question.
Resume previous chats. aws___call_aws(cli_command="aws devops-agent list-chats --agent-space-id SPACE_ID --region us-east-1") finds older sessions. Reuse the executionId to continue.
contentTailor by intent:
Cost questions — read IaC files (CDK / CFN / Terraform), instance types, scaling policies, reserved capacity. Include them.
Architecture review — read the IaC files plus the dependency manifest. Include the service's public API surface if visible.
Topology mapping — name the service and its key resources (cluster name, ALB, RDS instance). The agent will trace dependencies.
Knowledge / runbook discovery — no local context needed. Just ask:
"List all runbooks you have access to. For each, give the title, description, and AWS services it covers."
Quick diagnostics — include the alarm / metric / error the user is looking at, plus git log --oneline -10.
The DevOps Agent's intent detection is keyword-based. Word choice changes response speed:
| Phrasing | Response time |
|---|---|
| "Analyze...", "Review...", "Compare...", "What if...", "Show topology..." | 2–10s (chat) |
| "List...", "Show me...", "What is..." | instant (discovery) |
| "Investigate...", "Root cause of...", "What's wrong with..." | 5–8 min (deep — escalate to investigate skill) |
| "What runbooks...", "What do you know about..." | 2–10s (knowledge) |
If the user phrases something as "investigate" but it's really a question, you can still chat — but if the agent suggests deeper analysis, escalate via the investigate skill.
When chat surfaces a finding that needs deep multi-service correlation, hand off:
aws___call_aws(cli_command="aws devops-agent create-backlog-task \
--agent-space-id SPACE_ID \
--task-type INVESTIGATION \
--title 'Root cause of <thing chat found>' \
--priority HIGH \
--description '[From chat] <summary of chat findings> [Local context] <git log, IaC, etc.>' \
--region us-east-1")
Switch to the investigate skill for the polling/streaming workflow.
The AWS MCP Server's aws___run_script sandbox blocks certain Python constructs:
import boto3 — use await call_boto3(...) insteadtype() builtin — use e!r or str(e) for error formatting instead of type(e).__name__executionId format: call_boto3(SendMessage) only works with chat executionIds (pure UUID from create-chat). Investigation executionIds (exe-ops1-* format) require the aws___call_aws CLI path.
The local chat tool (devops_agent_chat__send_message) has a 180s boto3 read timeout and 180s MCP timeout — it handles slow agent responses internally. No task_id polling needed.
If using the fallback aws___run_script path and you receive a task_id with "working" status:
executionId and resend — the agent retains context.Tip: Complex questions about large IaC stacks or multi-service topology take 30-90s. The local chat tool handles this transparently.
executionId for follow-ups. Each executionId is a conversation — the agent retains full context server-side. Don't create a new chat per question.SendMessage returns ResourceNotFoundException or ValidationException on a previously-valid executionId, the session expired (sessions may expire after extended inactivity). Create a new chat and inform the user that prior context was lost.list-chats returns previous sessions. Reuse an executionId from the list to continue where you left off — no need to re-inject context the agent already has.Responses can contain commands or code. Never auto-execute anything the agent suggests. Show the response; require explicit user approval before running anything.
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
/investigateInvestigate an AWS incidentRun a deep root-cause investigation on the AWS DevOps Agent. Use when the user describes an incident, alarm, outage, or unexplained behavior — keywords like "5xx", "503", "OOM", "latency spike", "deployment failure", "rollback", "sev1", "investigate", "root cause", "debug", "alarm fired", "service down". Polls and streams progress, then surfaces recommendations./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