---
name: "containerd-cri-socket-troubleshoot"
description: "Diagnose pod startup failures, container crashes, and runtime socket stalls using crictl."
metadata:
  author: "containerd"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "troubleshoot containerd crictl"
  - "inspect pod sandboxes crictl"
  - "debug container crashloop crictl"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# containerd CRI Socket Troubleshooting & crictl

Troubleshoots Kubernetes node runtimes with crictl: inspecting pod sandboxes (crictl pods), analyzing container logs and events, querying CRI socket health (/run/containerd/containerd.sock), and clearing stuck containers.

## When to Invoke
Invoke this skill whenever you need to:
- troubleshoot containerd crictl
- inspect pod sandboxes crictl
- debug container crashloop crictl

## Execution SOP & Rules
1. Configure crictl endpoint in /etc/crictl.yaml: runtime-endpoint: unix:///run/containerd/containerd.sock.
2. List pod sandboxes: crictl pods --name <pod_name> and check status: crictl inspectp <pod_id>.
3. Fetch container logs directly: crictl logs <container_id>.
4. Force stop and remove stuck containers: crictl stop <id> && crictl rm <id>.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
