Coding prompts · Prompt
Analyse error logs (prompt)
analyse-error-logs-prompt
A prompt that reads server, app or build logs and finds what matters - the first real failure, repeating patterns, spikes and timing, the probable cause with the log lines that prove it, and the next checks to run - without guessing beyond the data. Use when the user pastes logs, asks why a server crashed, or cannot spot what failed in a long log.
Works with: Any AI Not yet model-tested; testing Jan 2027
Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works
Install in Claude Code, Cursor or Codex (optional)
Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.
Claude Code (all your projects)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/analyse-error-logs-prompt/raw' -o ~/'.claude/skills/analyse-error-logs-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/analyse-error-logs-prompt/files/LICENSE.txt' -o ~/'.claude/skills/analyse-error-logs-prompt/LICENSE.txt'Cursor (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/analyse-error-logs-prompt/raw' -o '.cursor/skills/analyse-error-logs-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/analyse-error-logs-prompt/files/LICENSE.txt' -o '.cursor/skills/analyse-error-logs-prompt/LICENSE.txt'Codex and other Agent Skills tools (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/analyse-error-logs-prompt/raw' -o '.agents/skills/analyse-error-logs-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/analyse-error-logs-prompt/files/LICENSE.txt' -o '.agents/skills/analyse-error-logs-prompt/LICENSE.txt'
Or connect the whole library over MCP
Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):
{
"mcpServers": {
"theskillvault": {
"url": "https://theskillvault.ai/mcp"
}
}
}Logs are long and noisy. This prompt finds the first real error, the pattern around it and the likely cause, with the lines that prove it.
When to use
- A server, function or job crashed and you have the logs.
- A build or deploy log is hundreds of lines and you cannot see what failed.
- Errors come and go and you want to spot the pattern.
When not to use
- You need a full debugging method across code and tests. Use debug-systematically, and use this prompt for the log part.
Steps
- Copy the logs from around the problem, with timestamps. A few hundred lines is usually enough.
- Redact secrets: tokens, passwords, cookies, emails and IP addresses.
- Fill in {{CONTEXT}}: what you were doing and when it went wrong.
- Paste both into the prompt below and run the checks it suggests.
Prompt
Analyse these logs. Context: {{CONTEXT}}
1. First real error: quote the earliest line that shows the actual failure (not the follow-on errors), with its timestamp.
2. Patterns: errors or warnings that repeat, how often, and whether they cluster in time.
3. Timeline: a short list of what happened, in order, around the failure.
4. Likely root cause: your best explanation, with the log lines that support it. Give a confidence level (high, medium, low).
5. Other possible causes, if the evidence is not conclusive.
6. Next checks: 2-4 specific things to run or look at to confirm the cause.
Only claim what the logs show. If something is not in the logs, say so instead of guessing.
LOGS:
{{LOGS}}
How to adapt
- Performance problem rather than a crash? Ask for slow requests, timings and spikes instead of errors.
- Logs in JSON? Ask it to group by a field such as route or status code.
Gotchas
- Logs often contain tokens, session cookies and personal data. Redact them before pasting into any AI tool.
- The last error in a log is often a side effect. The first one usually matters most.
Portability
Works with any log source: Vercel, Netlify, Cloudflare, Docker, Kubernetes, GitHub Actions or a plain server. Any chat AI works; no tool lock-in.
Done when
- The first real error is quoted with its timestamp.
- There is a likely cause backed by log lines, and next checks to confirm it.
Example prompt
"Here are the last 300 lines of my server log from when it crashed at 2:14pm. Find the first real error and the likely cause."
---
Converted from the "analyze_logs" pattern in danielmiessler/Fabric (MIT, Copyright (c) 2012-2024 Scott Chacon and others). See LICENSE.txt.
Bundled files
Licence
Adapted from Daniel Miessler and Fabric contributors (analyze_logs pattern) (Copyright (c) 2012-2024 Scott Chacon and others), MIT License. Converted by TheSkillVault into a fill-in prompt: added a context input, a first-error and evidence requirement, a secrets-redaction step, steps and done-when sections.
Licence: MIT License. Attribution when you reuse it: Based on work by Daniel Miessler and Fabric contributors (analyze_logs pattern) (Copyright (c) 2012-2024 Scott Chacon and others, MIT License), https://github.com/danielmiessler/Fabric/blob/8ce0909d8622a61b6aaf539d467ba31bb7e0b6dd/data/patterns/analyze_logs/system.md; adapted by TheSkillVault, https://theskillvault.ai