# Sample: finding a deadlock in a .NET dump with an AI agent

DeadlockDemo starts two threads that take the same two locks in the opposite order. The process hangs and
uses no CPU.

    ./collect.sh              # lock(object), which uses Monitor
    ./collect.sh lock         # the same bug with System.Threading.Lock
    ./run-in-docker.sh        # same, inside a Linux container (use this on macOS)

Then let the agent investigate:

    dotnet-dump analyze artifacts/deadlock.dmp -c "syncblk" -c "parallelstacks" -c "exit"

Note the difference between the two scenarios: syncblk finds the Monitor owners, but prints nothing for
System.Threading.Lock. Only the stacks show that second deadlock.

.claude/skills/analyzing-dotnet-dumps/SKILL.md is the skill the agent uses. Claude Code and GitHub Copilot read
it from that path as is; for Codex, move the analyzing-dotnet-dumps folder to .agents/skills/.

Prerequisites: .NET 10 SDK, and dotnet-dump:

    dotnet tool install --global dotnet-dump
