Skip to content
Akshay Kumar Sharma
BookBook a call
Akshay Kumar Sharma

ngram blog

From log chaos to clarity: debugging at scale

How a single markdown skill file turned a 15-minute log hunt into a 30-second slash command for ngram’s engineers.

First published on the ngram blog. Read the original

Illustration: raw log lines on the left, an arrow, and on the right a structured summary with status, execution time and a checklist of which steps succeeded and which failed.

The problem: logs are a haystack

One user request touches several services and leaves logs across all of them. When someone reports an issue, debugging means finding request IDs, opening logging dashboards, filtering hundreds of entries, piecing together what happened and spotting the error buried in the output. That takes 15 to 30 minutes per issue.

The solution: a slash command that does the work

ngram built a debugging skill for AI coding assistants that turns one command into structured insight in about 30 seconds:

/debug-conversation 8b7d7d8d-81f0-43b2-8d19-358c298cbca4

It returns the request parameters, an execution timeline with durations and status, a step-by-step breakdown by component, and what worked versus what failed, with no manual log hunting.

How it works

1. Fetch logs from your log provider

The skill uses Vercel’s log API to pull entries that match the request identifiers over a configurable time range. The same approach works with any log provider that has an API, such as Datadog, CloudWatch or Papertrail.

2. Parse and extract structure

Raw logs carry JSON messages with timestamps, operation names, parameters and results. The skill extracts request metadata, builds a chronological timeline, calculates durations, flags errors and warnings, and parses structured output.

3. Write a summary that fits the logs

Instead of “processData: 75000ms” it gives context: “Data processing took 75 seconds and handled 3 input sources.”

The skill file

The whole capability is one markdown file, .claude/commands/debug-conversation.md, which defines the inputs, setup, step-by-step workflow, output format and error handling.

Why this pattern matters

Every team has workflows that combine context retrieval, domain knowledge and structured output, and they usually live in people’s heads. Written down as AI skills, they become consistent, fast, easy to onboard onto, and easy to improve.

Building your own

The ingredients are structured JSON logging, log storage you can query through an API, and a markdown skill that tells the assistant how to fetch, parse and present.

A real example: a broken chat session

ngram’s agentic chat orchestrates web research, storyboard generation, image creation and voice synthesis. Debugging a broken session used to mean searching logs by conversation ID and scrolling through hundreds of entries. Now the skill fetches the logs, works out the time range and parses the tool calls, and within seconds shows that image generation timed out after 45 seconds and blocked everything downstream.

It also handles logs from other places:

/debug-conversation <id> --since 7d
/debug-conversation --file logs/session-dump.json

What’s next

ngram keeps building skills that make engineering teams faster, turning expertise into shareable files that keep improving. For teams running complex production systems, it documents the workflow and speeds up debugging at the same time.