بنقرة واحدة
agent-investigate
Deep-dive into agent execution - Docker logs, Claude stream events, tool calls, errors
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Deep-dive into agent execution - Docker logs, Claude stream events, tool calls, errors
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | agent-investigate |
| description | Deep-dive into agent execution - Docker logs, Claude stream events, tool calls, errors |
| user_invocable | true |
| args | <container_name|task_id|--recent [time_window]> |
You are investigating agent execution(s). The user's argument is: $ARGUMENTS.
Determine the mode based on the argument:
claude-agent-myproject-abc123), task ID, or pipeline_run_id + agent_name--recent optionally followed by a time window like 1h, 6h, 12h, 24h (default: 1h)If given a container name, extract project and task_id from it (pattern: claude-agent-{project}-{task_id}).
If given a task_id, query for agent events:
curl -s "http://localhost:9200/agent-events-*/_search" -H 'Content-Type: application/json' -d '{
"query": {"term": {"task_id": "<TASK_ID>"}},
"sort": [{"timestamp": "asc"}],
"size": 20
}' | jq '.hits.hits[]._source | {timestamp, agent_name, event_type, duration_ms, success, error_message, pipeline_run_id}'
If given a pipeline_run_id + agent_name, find the specific execution:
curl -s "http://localhost:9200/agent-events-*/_search" -H 'Content-Type: application/json' -d '{
"query": {
"bool": {
"must": [
{"term": {"pipeline_run_id": "<RUN_ID>"}},
{"term": {"agent_name": "<AGENT_NAME>"}}
]
}
},
"sort": [{"timestamp": "asc"}],
"size": 20
}' | jq '.hits.hits[]._source'
docker logs claude-agent-<project>-<task_id> 2>&1
If container no longer exists, note it. Check if it's still running:
docker ps --filter "name=claude-agent-<project>-<task_id>" --format "{{.Names}}\t{{.Status}}\t{{.RunningFor}}"
curl -s "http://localhost:9200/logs-claude.otel-default/_search" -H 'Content-Type: application/json' -d '{
"query": {"term": {"resource.attributes.task_id.keyword": "<TASK_ID>"}},
"sort": [{"@timestamp": "asc"}],
"size": 500
}' | jq '.hits.hits[]._source | {"@timestamp", event_name, "tool_name": .attributes.tool_name, "success": .attributes.success, "error": .attributes.error, "params": .attributes.tool_parameters}'
From the stream events, build a breakdown:
Look for:
curl -s "http://localhost:9200/agent-events-*/_search" -H 'Content-Type: application/json' -d '{
"query": {"term": {"task_id": "<TASK_ID>"}},
"sort": [{"timestamp": "asc"}],
"size": 10
}' | jq '.hits.hits[]._source | {timestamp, event_type, duration_ms, success, error_message}'
Build timeline: agent_initialized → agent_started → agent_completed or agent_failed.
Synthesize findings into a narrative:
curl -s "http://localhost:9200/agent-events-*/_search" -H 'Content-Type: application/json' -d '{
"query": {
"bool": {
"must": [
{"term": {"event_type": "agent_initialized"}},
{"range": {"timestamp": {"gte": "now-<TIME_WINDOW>"}}}
]
}
},
"sort": [{"timestamp": "desc"}],
"size": 50
}' | jq '.hits.hits[]._source | {timestamp, agent_name, project, task_id, pipeline_run_id}'
docker ps --filter "name=claude-agent-" --format "table {{.Names}}\t{{.Status}}\t{{.RunningFor}}\t{{.Image}}"
curl -s "http://localhost:9200/agent-events-*/_search" -H 'Content-Type: application/json' -d '{
"query": {
"bool": {
"must": [
{"terms": {"event_type": ["agent_completed", "agent_failed"]}},
{"range": {"timestamp": {"gte": "now-<TIME_WINDOW>"}}}
]
}
},
"sort": [{"timestamp": "desc"}],
"size": 50
}' | jq '.hits.hits[]._source | {timestamp, agent_name, project, task_id, event_type, duration_ms, success, error_message}'
| Time | Agent | Project | Duration | Status | Container | Error |
|---|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... | ... |
For any failed executions, run Mode A steps 2-6 to get details.
success: false with no error_message: Container crashed. Check docker logs for OOM or signal.branch_conflict_detected events.Reference for correctly querying GitHub issue state - board status, parent/child links, sub-issues. Use these patterns instead of `gh issue view --json projectItems` which does not reliably return status field values.
Analyze recommendations from pipeline run analyses — filter by priority, target (orchestrator/project), pipeline run ID, or project
Search and analyze Claude Code live execution logs captured in Elasticsearch - tool calls, tool results, API usage, and errors for a specific task or pipeline run
Quick reference for Elasticsearch indices, event types, Docker patterns, and pipeline flows
Investigate a pipeline run - timeline, Docker logs, decision events, root cause analysis
Comprehensive system health check - all components, queue, circuit breakers, active work, errors