Automation
CrashLens
A desktop application that turns the nightmare of diagnosing random PC crashes into a single automated scan, combining event log forensics, minidump decoding, power budget math, and local AI analysis to explain exactly why your system is unstable.
In Plain English
When your PC randomly crashes, restarts, or shows a blue screen, CrashLens automatically scans your system logs, reads crash dump files, and checks whether your power supply can actually handle your hardware. Then it feeds everything to a local AI (an artificial intelligence running on your own machine, not in the cloud) that explains the problem in plain language and tells you what to fix. I built CrashLens by combining several open-source tools and GitHub projects into one integrated application with a unified interface.
Problem
When a Windows PC crashes, the evidence scatters across half a dozen different places. The Windows Event Viewer buries critical Kernel-Power 41 entries among thousands of irrelevant informational messages. WHEA hardware error codes arrive as hexadecimal soup that requires cross-referencing Microsoft documentation to interpret. Minidump files sitting in C:\Windows\Minidump are raw binary blobs that require WinDbg or specialized debuggers to parse. And none of these tools talk to each other, so correlating a GPU driver timeout with a power delivery issue that shows up as a different event type requires a human investigator to manually stitch the timeline together.
For most people, this investigation process is simply inaccessible. Even technically experienced users often spend days searching forums, running individual diagnostic utilities, and swapping components to isolate a root cause. The problem compounds when the crash has multiple contributing factors. A system that blue-screens during gaming could be suffering from GPU driver instability, insufficient PSU wattage for transient power spikes, marginal RAM, or overheating, and without systematically collecting and analyzing the evidence, you end up guessing.
CrashLens was born from exactly this scenario. A high-end build suffering random reboots under GPU load where the root cause turned out to be a power supply that technically met wattage requirements but could not handle the transient spikes of a modern graphics card. The investigation took days of manual log parsing and hardware testing. Rather than build every component from scratch, I pulled together several existing open-source projects and libraries for minidump parsing, event log reading, and hardware detection, then integrated them into a single cohesive application with a unified API and desktop interface. CrashLens automates that entire diagnostic workflow into a single scan that takes seconds, then hands the evidence to an AI that can spot the patterns a human might miss.
Architecture
CrashLens architecture: nine data collectors feed a FastAPI backend that serves both a React/Electron desktop app and an AI analysis engine backed by local Ollama models, with real-time sensor data streaming over WebSockets.
Features
Crash Event Detection
Kernel-Power 41, Event 6008, WHEA
The event log collector continuously scans Windows Event Logs for the specific event IDs that signal real trouble: Kernel-Power 41 (the system rebooted without a clean shutdown), Event 6008 (the previous shutdown was unexpected), and the full family of WHEA-Logger events that indicate hardware faults at the CPU, memory, and PCIe level. Rather than dumping thousands of irrelevant events, CrashLens filters by a curated set of crash-related providers and event IDs, then categorizes each finding by severity. WHEA errors are further decoded into subtypes so you can immediately see whether the hardware fault is a correctable memory error that might indicate aging RAM or an uncorrectable machine check exception that points to a failing processor.
Minidump BSOD Analysis
16+ bugcheck codes decoded
When Windows blue-screens, it writes a small binary file to C:\Windows\Minidump containing the bugcheck code and parameters that identify the crash. CrashLens reads these files directly, parsing the MDMP header format with struct-level binary unpacking to extract the stop code. Each code is mapped to a named condition and a probable cause: VIDEO_TDR_FAILURE (0x116) points to GPU driver timeouts, WHEA_UNCORRECTABLE_ERROR (0x124) signals serious hardware faults, FAULTY_HARDWARE_CORRUPTED_PAGE (0x12B) implicates failing RAM, and DPC_WATCHDOG_VIOLATION (0x133) often traces back to storage driver or firmware problems. The analyzer also handles kernel dump format (PAGE signature) and generates frequency reports showing which bugcheck types recur most often.
Power Budget Calculator
Databases of 69 GPUs and 88 CPUs
Many crash patterns trace back to power delivery problems that are invisible to traditional diagnostic tools. CrashLens detects your installed CPU and GPU via WMI and nvidia-smi, then looks up their TDP and transient power characteristics from embedded databases covering modern hardware. It calculates total sustained draw, peak draw including transient spike headroom, and recommends a specific PSU wattage tier along with ATX version requirements. For systems with high-power GPUs that require the 12VHPWR connector, it flags ATX 3.0/3.1 compliance and even suggests specific PSU models. This is the component that originally justified building CrashLens, because the connection between transient GPU spikes and random reboots is one of the hardest problems to diagnose manually.
Local AI Diagnosis
Ollama + streaming WebSocket chat
All collected evidence gets assembled into carefully engineered prompts and sent to a local LLM via Ollama for analysis. The prompt system includes a base system prompt that establishes the AI as a Windows system diagnostician, a crash analysis prompt that guides it through interpreting each event type, and a pattern detection prompt that searches for temporal, load-related, and component-specific correlations. The LLM produces a structured diagnosis with summary findings, detailed event analysis, ranked likely causes, recommended actions, and a risk assessment. Beyond one-shot reports, CrashLens also provides an interactive streaming chat endpoint over WebSockets for follow-up questions, so you can drill into specific findings without re-running the entire scan.
How It Works
Hardware Auto-Detection
On launch, CrashLens queries the system through multiple channels to build a complete hardware profile. PowerShell WMI queries identify the CPU model, core count, motherboard, and RAM configuration. The nvidia-smi command-line interface reports GPU model, VRAM, driver version, and current power draw. Each detected component is matched against embedded TDP databases that contain not just rated power draw but also transient spike multipliers, which are critical for identifying PSU inadequacy.
The power calculator then sums all component TDPs, applies manufacturer-specific transient headroom percentages, and compares the result against standard PSU tiers. If the system has a GPU requiring the 12VHPWR connector, the calculator flags ATX 3.0 or 3.1 compliance requirements and generates specific product recommendations. This entire process runs in under two seconds and produces the foundation that later analysis stages build on.
Event Log and Crash Scanning
The event log collector scans Windows Event Logs for crash indicators across multiple provider channels: Kernel-Power (event 41 for unexpected shutdowns, 109 for clean shutdowns, 137 for boot-time markers), WER-SystemErrorReporting (event 1001 for BSODs), EventLog (event 6008 for dirty shutdowns), WHEA-Logger (events 1, 17, 18, 19, and 47 for hardware faults), and disk-related providers for storage errors. Each event is extracted with its full payload, including the BugcheckCode parameter that differentiates a power-loss reboot from a blue screen crash.
In parallel, the minidump directory is scanned and each .dmp file is parsed at the binary level. The parser reads the MDMP signature, extracts header fields (version, stream count, timestamp), then searches known offsets for the bugcheck code and its four parameters. For files using the kernel dump format (PAGE signature), a different offset table is used. The result is a timestamped list of crashes with decoded stop codes that can be correlated with the event log timeline.
Power and Thermal Analysis
With hardware detected and crash events collected, CrashLens performs power and thermal analysis. The power budget report breaks down each component's sustained and peak wattage, calculates whether the current PSU tier provides adequate headroom for transient spikes, and flags specific risk factors like 12VHPWR connector requirements or ATX standard mismatches. Real-time sensor data from CPU and GPU temperature probes, power draw meters, and fan speed sensors streams to the React frontend via WebSocket connections every two seconds.
The thermal monitoring layer applies configurable warning thresholds. CPU or GPU temperatures crossing 80C trigger warning indicators, while 95C triggers critical alerts. This live data is especially valuable for catching intermittent thermal throttling that only occurs under specific workloads, which is a common contributor to crashes that happen only during gaming or rendering.
AI-Powered Diagnosis
The analysis engine assembles all collected data into structured context and feeds it to the local LLM through carefully engineered prompt templates. The crash analysis prompt guides the model through interpreting Kernel-Power events, decoding WHEA error types, correlating bugcheck codes with recent driver changes, and identifying faulting modules in application crashes. A separate pattern detection prompt instructs the model to look for temporal clustering, load-related correlations, and component-specific recurrence patterns.
The LLM Analyzer synthesizes these findings into a severity-rated diagnosis. It produces ranked probable causes with confidence levels, specific actionable recommendations (from DDU-based driver reinstallation to BIOS settings and specific PSU models), and a risk assessment of current system stability. The recommendation engine also generates category-specific suggestions: PSU upgrades for power issues, driver procedures for software faults, and hardware diagnostic steps for memory or processor errors.
Report Generation and Dashboard
Everything compiles into a SystemReport object that includes the hardware summary, power analysis, crash analysis with event counts, AI-generated summary and likely causes, a computed health score from 0 to 100, and a prioritized list of recommendations. The health score algorithm starts at 100 and deducts points based on event severity (5 points per critical event, 3 per WHEA error, 5 per unexpected shutdown), power adequacy concerns, and the AI-determined severity rating.
The React dashboard visualizes all of this through dedicated panels: a crash timeline with Recharts, an event list with severity filtering, a WHEA error breakdown, a minidump analysis view, real-time sensor gauges, and the interactive LLM chat. Reports can be exported in both JSON (for API consumption) and Markdown (for sharing in forums or support tickets). The Electron wrapper packages everything as a native Windows desktop application distributed via NSIS installer.
Tech Stack
Backend
Python, FastAPI, uvicorn, WebSockets for real-time streaming
Frontend
React 18, TypeScript, Vite, Tailwind CSS, Recharts, React Query
Desktop
Electron 28, electron-builder (NSIS installer for Windows)
AI
Ollama (local LLM), expert prompt engineering, pattern detection
System Integration
PowerShell (WMI), nvidia-smi, Windows Event Log API, python-evtx
Data
SQLite for event caching, embedded TDP databases, struct-level binary parsing