/project-toolkit:observabilityfrom project-toolkit
Queries and analyzes agent JSONL event logs for debugging, performance analysis, and decision tracing. Activated by phrases like 'query agent logs', 'find slow tool calls', or 'show agent errors'.
Ships in project-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Query structured JSONL event logs to understand agent behavior, debug failures, and analyze performance.
| Trigger Phrase | Operation |
|---|---|
query agent logs | Run query_logs.py with filters |
find slow tool calls | Run with --slow threshold |
show agent errors | Run with --errors-only |
summarize session performance | Run with --output summary-sessions |
analyze tool usage | Run with --output summary-tools |
Use this skill when:
Use direct log file inspection instead when:
Logs use JSONL format (one JSON object per line). See schema.json for the full JSON Schema.
| Type | Purpose | Key Fields |
|---|---|---|
| session_start | Agent invocation begins | agent, session_id |
| session_end | Agent invocation completes | agent, session_id |
| tool_call | Tool invocation with timing | tool.name, tool.duration_ms, tool.success |
| decision | Reasoning captured alongside action | decision.action, decision.reasoning |
| metric | Numeric measurement | metric.name, metric.value, metric.unit |
| error | Error occurrence | error.message, error.category, error.recoverable |
{"timestamp":"2026-03-30T10:00:00Z","event_type":"session_start","session_id":"sess-001","agent":"implementer","message":"Session started"}
{"timestamp":"2026-03-30T10:00:01Z","event_type":"tool_call","session_id":"sess-001","agent":"implementer","level":"INFO","tool":{"name":"Read","duration_ms":45,"success":true,"input_summary":"src/main.py"},"message":"Read source file"}
{"timestamp":"2026-03-30T10:00:02Z","event_type":"decision","session_id":"sess-001","agent":"implementer","level":"INFO","decision":{"action":"Edit existing function","reasoning":"Function exists, modifying is safer than rewriting","alternatives_considered":["Rewrite from scratch","Create wrapper"]}}
{"timestamp":"2026-03-30T10:00:10Z","event_type":"error","session_id":"sess-001","agent":"implementer","level":"ERROR","error":{"message":"Test failed: assertion error in test_parse","category":"test_failure","recoverable":true}}
Agent event logs are stored at:
.agents/
logs/
{session-id}.jsonl # Per-session event log
| Avoid | Why | Instead |
|---|---|---|
| Reading raw JSONL manually for large logs | Slow, error-prone | Use query_logs.py with filters |
| Ignoring decision events | Loses the "why" behind agent actions | Filter by --event-type decision |
| Checking only errors | Misses slow degradation patterns | Use --slow to find latency issues |
| Analyzing without session context | Events lack meaning without grouping | Use --output summary-sessions |
| Script | Platform | Usage |
|---|---|---|
scripts/query_logs.py | Python 3.8+ | Cross-platform |
check_event_logging.py | Python 3.8+ | Check a scenario against the event-logging contract |
| Exit Code | Meaning |
|---|---|
| 0 | Query completed and results output (query) or scenario compliant (check) |
| 1 | File not found or invalid arguments (query) or scenario non-compliant (check) |
| 2 | Invalid JSONL format (query), malformed scenario (check), or a launcher failure (a ptk_run: line on stderr and no output) |
# Show all events in a session log
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/query_logs.py .project-toolkit/logs/sess-001.jsonl; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Check an emission scenario against the event-logging contract
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/check_event_logging.py scenario.json; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Find errors only
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/query_logs.py .project-toolkit/logs/sess-001.jsonl --errors-only; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Find tool calls slower than 500ms
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/query_logs.py .project-toolkit/logs/sess-001.jsonl --slow 500; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Filter by agent
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/query_logs.py .project-toolkit/logs/sess-001.jsonl --agent implementer; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Session summary as JSON
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/query_logs.py .project-toolkit/logs/sess-001.jsonl --output summary-sessions; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Tool usage summary
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/query_logs.py .project-toolkit/logs/sess-001.jsonl --output summary-tools; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Filter by time range
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/query_logs.py .project-toolkit/logs/sess-001.jsonl --since 2026-03-30T10:00:00Z --until 2026-03-30T11:00:00Z; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# JSON output for automation
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/observability/scripts/query_logs.py .project-toolkit/logs/sess-001.jsonl --output json --event-type tool_call; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
After execution:
Domain knowledge for observability analysis:
| File | Content |
|---|---|
| event-logging-contract.md | Canonical contract for which operational events code emits and omits: decision test, MUST and MUST NOT tables, log vs metric vs trace, worked example |
| three-pillars-reference.md | Logs, metrics, traces definitions, correlation matrix, OpenTelemetry |
| prometheus-recording-rules.md | Recording rule patterns, CPU throttling, disk I/O, PSI, TCP metrics |
| otel-migration-reference.md | IFx to OTel migration phases, instrumentation best practices, standard metrics |
references/distributed-systems-fallacies.md (opens in a new tab)references/event-logging-contract.md (opens in a new tab)references/otel-migration-reference.md (opens in a new tab)references/otel-semantic-conventions.md (opens in a new tab)references/prometheus-recording-rules.md (opens in a new tab)references/three-pillars-reference.md (opens in a new tab)schema.json (opens in a new tab)scripts/check_event_logging.py (opens in a new tab)scripts/query_logs.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
haikuThree short reads, in order
agent-logs, event-logs, debugging, performance-analysis, observability
105 skills in this plugin
/adr-generatorCreate comprehensive Architectural Decision Records (ADRs). Researches the destination directory to detect existing template conventions, gathers context, determines next ADR number, generates the ADR, validates completeness, and saves. Supports multiple ADR formats (MADR, Nygard, Alexandrian, project canonical). Use when documenting technical decisions, creating new ADR files, or capturing rationale so future readers can revisit a choice. Use when you say "write an ADR", "document this decision", "document these design choices", "record why we chose this", "capture the rationale", or "for future maintainers", or when creating an ADR-like markdown file under docs/decisions/, docs/adr/, docs/architecture/, architecture/decisions/, or .project-toolkit/architecture/. Do NOT use to debate or review an existing ADR (use adr-review)./adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator).npx claudepluginhub rjmurillo/ai-agents --plugin project-toolkitOther plugins' skills for the same job