This skill investigates a production bug in a fixed order and ends with a checked fix. It reads errors, traces, logs, and impact from LogBrew through the hosted LogBrew MCP server or the logbrew CLI, and it still works from a pasted stack trace and logs when neither is connected.
General debugging skills such as debugging-strategies and debugging-code cover reasoning about a bug. This one is narrower. It names the exact LogBrew reads for each step (issue, first-seen release, linked trace, logs around the first event, user impact) and closes with a before and after check of the same issue on the new release.
Use the first evidence source that works:
search and execute tools from https://mcp.logbrew.co/mcp are connected. In Claude Code: claude mcp add --transport http logbrew https://mcp.logbrew.co/mcp, then claude mcp login logbrew. A person approves which projects the agent can read. The connection reads only, unless that person also allows changes.logbrew status --json reports authenticated access, or LOGBREW_TOKEN holds a project read key. Add --json to every command.Both tools need a LogBrew account created by a person. Reads send queries to LogBrew's API. If the CLI reports no authentication, ask a person to run logbrew login. Do not start a login, create keys, or change project settings during an investigation.
Follow the 7 steps in order. Do not edit code before step 6.
With the MCP server, call search before the first execute of each operation and use the input fields from the returned schema. If search returns a newer version of an operation named here, use the newer one.
List unresolved issues for the environment and time of the symptom. Pick the issue whose message, route, service, and time match. If several match, pick the one with the most events in the incident window and say why.
logbrew read issues --project "$PROJECT_ID" --environment production --status unresolved --since 24h --jsonissues.list.v5 with project_id, environment, status, sinceRead the issue investigation for the recommended occurrence. Record the exception type and message, the first frame in your own code, subject.first_seen_at, the release of the first occurrence, occurrence_selection.reason, cause.status, and fix.status. If the issue first appeared in the newest release, treat it as a regression in that release. Then open the source file at that frame, at the commit the release names.
logbrew investigate issue "$ISSUE_ID" --occurrence recommended --json (or --occurrence first)issues.investigate.v15 with issue_id and selectionIf correlations.trace.status is available, read that trace and its logs. Otherwise read the logs of the same service from 5 minutes before the first event to 1 minute after it. Never guess a trace from timestamps or messages.
logbrew read trace "$TRACE_ID" --project "$PROJECT_ID" --jsonlogbrew read logs --trace "$TRACE_ID" --project "$PROJECT_ID" --since 24h --jsontraces.investigate.v3 with trace_id, then logs.list.v1 with trace_id, or with service_name, since, and untilFind the last successful step before the failure and the first warning or error. Compare the failing request with one that succeeded.
Read the occurrence count, the trend, impact.user_impact.status, and the release, environment, and service distributions. Report counts and scope. Never copy user IDs, emails, or other personal data into the report.
List each missing, unavailable, redacted, or truncated item and how it limits the conclusion. Stop without a code change if the issue is outside the approved project, the occurrence does not match the incident, fix.status is unknown and the failing frame is not in your code, the fix depends on redacted evidence, or you cannot explain the failure from the evidence.
Write a test that fails the same way, built from the observed shape of the failing request and never from real user data. Make the smallest change at the cause. Do not hide the error with a broad catch, a retry, or a lower log level.
Record the failing occurrence ID before the fix deploys. After the new release gets traffic, compare it with the new deployment.
logbrew investigate issue "$ISSUE_ID" verify --baseline-occurrence "$OCCURRENCE_ID" --candidate-deployment "$DEPLOYMENT_ID" --jsonissues.list.v5 with release set to the new release, and summary.volume.v1 for counts before and after the deployrecurrence_observed means the fix did not work, so go back to step 2. no_recurrence_observed is evidence, not proof. insufficient_traffic and unavailable mean check again later.
Illustrative, not a measured run:
User request: Checkout started returning 500s after this morning's deploy. Find out why and fix it.
Inputs: LogBrew MCP connected with read access to the "shop" project.
Expected result: The issue for the checkout 500, its first-seen release, the trace and logs around
the first event, the affected count, a failing test plus the smallest fix, and a verify status
after the next deploy, reported with Observed, Inferred, Proposed, and Verify kept apart.
Report format:
Issue: <issue_id> in <project>, <environment>, <service>, release <release>
Symptom: <what users see>
Observed: <exception, top frame, first seen, trace and log facts>
Affected: <event count, trend, user impact status>
Inferred cause: <conclusion> (unknown: <what is missing>)
Proposed fix: <change and test>
Verify: <the verify status after deploy, or when to check>
Commands run: <list>
no_recurrence_observed depends on traffic after the deploy and is not proof of a fix.logbrew resolve "$ISSUE_ID" --json, happens only when the person permits it. The skill never creates keys, changes project settings, or changes billing.logbrew login or the MCP sign-in. Keep LOGBREW_TOKEN out of outputs and tracked files.