Coming soon·Cloud dashboards & CI/CD performance gatesJoin the waitlist →
v1.0.21 · Windows 10/11 · macOS 14+ · MIT License

A .NET profiler
built for AI
coding agents._

Ask your agent "find why this is slow" or "where am I wasting memory?" and get an answer backed by real profiling data — no detours, no GUIs, no context switching.

Claude Code — install plugin
/plugin marketplace add kodroi/metreja-profiler-marketplace
/plugin install metreja-profiler@metreja-profiler-marketplace
Prerequisite — install CLI
$dotnet tool install -g Metreja.Tool
claude — agent session
You: "This endpoint takes 3 seconds, find out why"
Agent: Setting up profiling session...
Running with profiler attached...
Analyzing trace (42,381 events captured)...
ValidateInventory is your bottleneck —
1.8s self time across 47 calls.
Queries inventory per-item instead of batching.
Here's the fix:
// Before: N+1 query
foreach (var item in items) { GetInventory(item.Id); }
// After: batch
GetInventoryBatch(items.Select(i => i.Id));
01

How it works

Say it. Profile it. Fix it.

The plugin orchestrates the full profiling loop on your behalf. You describe the problem; Metreja instruments your app, captures a trace, and hands the analysis back to the agent.

01

You describe the problem

Tell the agent what's slow, what's allocating too much, or what you want to compare.

02

Plugin sets up a session

Metreja creates an isolated session config with the right filters for your codebase.

03

App runs with profiler

The profiler DLL attaches to your .NET runtime and captures method-level timing and allocation events.

04

Trace is analysed

The agent reads the NDJSON output and identifies hotspots, call trees, or memory pressure.

05

Fix is proposed

The agent explains the root cause and suggests a concrete code change, backed by numbers.

06

Fix is verified

Run again, diff the traces. The agent confirms whether the change actually helped.

02

Why Metreja

Everything your agent needs.
Nothing it doesn't.

01

Data layer for agents

The CLI profiles, captures, and aggregates. Your agent or script decides what it means. No built-in recommendations, no 'this is slow because…' logic.

02

Finds the real bottleneck

Self-time analysis pinpoints the method that's actually slow, not the one that calls it. No more chasing callers up the stack.

03

Proves the fix worked

Diff two traces. See the numbers change. No guessing whether your change helped — analyze-diff gives you hard evidence.

04

CI regression gates

metreja check compares two traces and exits non-zero when a method regresses beyond your threshold. Drop it into any pipeline.

05

Traces only your code

Filter by assembly, namespace, or class. Framework noise stays out, overhead stays low. Signal, not noise.

06

Structured output, not reports

Every command returns machine-readable results that agents consume directly. No screenshots, no interactive sessions.

07

Exception profiling

Rank exception types by frequency with throw-site methods. Find noisy exception paths before they become latency.

08

Thread & timeline analysis

Per-thread call counts and activity windows, plus a chronological event timeline with method and type filtering.

09

macOS ARM64 support

Native profiler dylib for Apple Silicon alongside the Windows x64 DLL. Same CLI, same output format, both platforms.

03

Under the hood

A CLI the agent
drives for you.

The plugin orchestrates five commands. Every output is machine-readable NDJSON — designed to be consumed by an agent, not a human. You can also run the CLI directly if you need to.

CommandWhat it does
metreja hotspotsRank methods by self time, inclusive time, call count, or allocations
metreja calltreeExpand a slow method into its full call tree with timing at every level
metreja callersFind who calls a method and how much time each caller contributes
metreja memoryGC counts by generation, pause times, per-type allocation hotspots
metreja analyze-diffCompare two traces to verify a fix actually improved performance
metreja summaryTrace overview: event counts, wall-clock duration, threads, methods
metreja exceptionsRank exception types by frequency with throw-site methods
metreja timelineChronological event listing with tid, event type, and method filtering
metreja threadsPer-thread breakdown: call counts, root time, activity windows
metreja trendMethod performance trend across periodic stats flush intervals
metreja checkCI regression gate: compare two traces, exit non-zero on regression
metreja runLaunch an executable with profiler attached (--detach for GUI apps)
metreja flushTrigger manual stats flush on a running profiled process
metreja listList existing profiling sessions
metreja mergeCombine multiple trace files into one sorted by timestamp
metreja exportConvert traces to speedscope or CSV format for visualization/analysis
04

Coming soon

Join the Metreja
Cloud & CI Waitlist

The core CLI profiler stays free and open-source. We're building cloud-based dashboards and CI/CD performance gates on top of it. Join the waitlist to get early access and help us prioritise what matters most.

Cloud-based dashboards — visualise and share profiling data
CI/CD gates — block regressions automatically in pull requests
Team collaboration — share sessions and track trends over time
We use analytics to understand how you use our site and improve your experience. By clicking "Accept", you consent to our use of cookies for analytics.