cw-debug

A guided method for investigating production problems in AWS CloudWatch Logs Insights, a tool for searching and analyzing application logs.

In plain words
What is it for?
Searching a chosen log group over a specified time range, filtering by identifiers such as user IDs or request IDs, and narrowing queries as new evidence appears.
Why use it?
It gives the investigation a repeatable structure instead of relying on guesswork when tracing errors, slow requests, or unexpected behavior.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pilot617/awesome-claude-code-plugins/cw-debug
Any agent
npx skills add pilot617/awesome-claude-code-plugins --skill cw-debug
Clone the repo
git clone --depth 1 https://github.com/pilot617/awesome-claude-code-plugins

Made for: Claude Code, Codex.

Per session 2 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,974 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00002 $0.01974
Opus 5 $0.00001 $0.00987
Sonnet 5 $0.00000 $0.00395
Haiku 4.5 $0.00000 $0.00197

Measured 2d ago against content hash 818054308da8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cw-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/cw.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cw-debug/skills/cw-debug/SKILL.md · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/cw-debug — CloudWatch Log Investigation Skill

You are investigating a production issue using CloudWatch Logs Insights. Follow the structured methodology below, adapting queries based on what you discover in each phase.

Arguments

The user will invoke this skill as:

/cw-debug <log_group> <filter_pattern> <hours_back> <region> "<issue_description>"
  • log_group: The CloudWatch log group path (e.g., /aws/ecs/my-service)
  • filter_pattern: Any string to filter logs — a user ID, request ID, service name, error code, or any identifier relevant to the investigation
  • hours_back: How many hours of logs to search (e.g., 24, 168 for 7 days)
  • region: AWS region (e.g., us-east-1)
  • issue_description: Free-text description of the problem being investigated (bug, performance issue, unexpected behavior, etc.)

Setup

  • Always use .venv/bin/python to run scripts
  • The skill has its own self-contained CloudWatch utility at ${CLAUDE_PLUGIN_ROOT}/skills/cw-debug/scripts/cw.py
  • Do NOT import from cloudwatch_utils.py — use the skill's own module instead
  • To use in inline scripts, add the scripts dir to sys.path then import:
    import sys, os
    sys.path.insert(0, os.path.expanduser("${CLAUDE_PLUGIN_ROOT}/skills/cw-debug/scripts"))
    from cw import CWClient
    
    cw = CWClient(region="{region}")
    results = cw.query("{query}", hours_back={hours_back}, log_group="{log_group}")
    cw.print_table(results)
    
  • Or use the CLI directly:
    .venv/bin/python ${CLAUDE_PLUGIN_ROOT}/skills/cw-debug/scripts/cw.py \
        --region {region} --log-group "{log_group}" --hours {hours_back} \
        --query "fields @timestamp, @message | limit 25"
    
  • Available CWClient methods:
    • cw.query(query_string, hours_back, log_group) — single log group query
    • cw.query_multi(query_string, hours_back, log_groups) — query multiple log groups, merge results with _log_group tag
    • CWClient.summarize_stats(results, value_field, group_field=None) — compute count/avg/min/p50/p90/p95/p99/max from fetched results
    • CWClient.time_bucket_counts(results, timestamp_field, bucket_minutes) — group into time buckets for spike detection
    • CWClient.print_table(results) — ASCII table output
    • CWClient.print_json(results) — JSON output
    • cw.save(results, name) — save to investigations/<name>.csv
  • Refer to ${CLAUDE_PLUGIN_ROOT}/skills/cw-debug/query_library.md for pre-built query templates

Read the full file on GitHub · 170 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 170 lines · 2 tokens per session scan A 818054308da8

Subscribe to this mod's changes

cw-debug is a skill published in the GitHub repository pilot617/awesome-claude-code-plugins (7 stars, last pushed 5mo ago), licensed MIT. It adds 2 tokens to every session and 1,974 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

technical-documentation

Audit, write, and improve developer documentation using Google's Developer Documentation Style Guide and Technical Writing courses. Use this skill for any documentation work, even when the user names no style guide: "audit our docs", "review this README", "write a README", "getting started guide", "how-to or…

wondelai/skills · 204 tokens

design-everyday-things

Apply foundational design principles: affordances, signifiers, constraints, feedback, and conceptual models. Use when the user mentions "why is this confusing", "affordance", "error prevention", "discoverability", "human-centered design", "mental model", "mapping", "seven stages of action", "users keep making…

wondelai/skills · 132 tokens

crossing-the-chasm

Navigate the technology adoption lifecycle from early adopters to mainstream market. Use when the user mentions "crossing the chasm", "beachhead segment", "whole product", "early adopters vs mainstream", "tech go-to-market", "bowling pin strategy", "technology adoption lifecycle", "pragmatist buyers", "growth stalled…

wondelai/skills · 139 tokens

hooked-ux

Design habit-forming product loops using the Hook Model (Trigger, Action, Variable Reward, Investment). Use when the user mentions "users arent coming back", "habit formation", "engagement loops", "habit zone", or "the manipulation matrix". Also trigger when designing notification or re-engagement strategies, building…

wondelai/skills · 109 tokens

architecture-optimization

Guided journey from a working codebase grown slow and tangled to one measurably fast, cleanly bounded, and readable. Orchestrates eight skills phase by phase - working-with-legacy-code, clean-architecture, software-design-philosophy, refactoring-patterns, system-design, ddia-systems, release-it, pragmatic-programmer …

wondelai/skills · 226 tokens

conversion-optimization

Guided journey from a leaking conversion flow - landing page, signup, checkout, or in-app onboarding - to a measured, tested funnel. Orchestrates six skills phase by phase - lean-analytics, cro-methodology, storybrand-messaging, hundred-million-offers, influence-psychology, design-everyday-things - each phase carries…

wondelai/skills · 225 tokens