defender_performance_tool / DefenderPerformanceTool
CLAUDE.md97 starsChanged 3 months agoMITView on GitHub
There are no automated tests; verification is manual by running the app and observing ETW events during a Defender scan. A WPF application with three components wired together in Program.cs: EtwListener.cs — subscribes to the Microsoft-Antimalware-Engine ETW provider on a background thread. Correlates Start/Stop Streamscanrequest events using ActivityID (Guid), calculates scan duration, and emits EventInfo records via a reactive Subject<EventInfo>. Plotter.cs — subscribes to the IObservable<EventInfo> stream. Accumulates durations per-process per-second in a ConcurrentDictionary, then a DispatcherTimer fires every second…
The file
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Build & Run
# Build (debug)
dotnet build
# Publish (release)
dotnet publish -c Release
# Output: bin\Release\net48\publish\
# Run (requires administrator privileges — UAC prompt auto-triggered if not elevated)
./bin/Release/net48/publish/DefenderPerformanceTool.exeThere are no automated tests; verification is manual by running the app and observing ETW events during a Defender scan.
Architecture
A WPF application with three components wired together in Program.cs:
EtwListener.cs — subscribes to the Microsoft-Antimalware-Engine ETW provider on a background thread. Correlates Start/Stop Streamscanrequest events using ActivityID (Guid), calculates scan duration, and emits EventInfo records via a reactive Subject<EventInfo>.
Plotter.cs — subscribes to the IObservable<EventInfo> stream. Accumulates durations per-process per-second in a ConcurrentDictionary, then a DispatcherTimer fires every second to atomically swap buffers (via Interlocked.Exchange), shift a 16-element circular history buffer, and redraw a ScottPlot stacked bar chart showing seconds of scan activity over the last 16 seconds.
Program.cs — checks for admin elevation (auto-elevates via UAC if needed), creates the WPF Application, instantiates EtwListener and Plotter, and hosts a WpfPlot control in a 1000×600 window.
EventInfo.cs — immutable record: DurationMsec, Process (filename only), Timestamp.
Key constraints
- Windows-only, x64, requires administrator privileges
- Target framework:
net48; output type:WinExe; ScottPlot 4.1.x (not 5.x) - Thread safety relies on
ConcurrentDictionaryandInterlocked.Exchange— no explicit locks - Color palette caps consistent process coloring at 16 entries
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

