concurrency-analyst

A code review agent that examines concurrent and asynchronous execution for races, deadlocks, resource contention, and error-handling problems.

In plain words
What is it for?
Use it to assess thread safety, async code, locks, shared state, connection pools, channels, and other parallel work.
Why use it?
These failures can be timing-dependent and remain hidden when code is tested only one operation at a time.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/testdouble/han/concurrency-analyst
Clone the repo
git clone --depth 1 https://github.com/testdouble/han
Per session 161 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,707 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00161 $0.01707
Opus 5 $0.00081 $0.00853
Sonnet 5 $0.00032 $0.00341
Haiku 4.5 $0.00016 $0.00171

Measured yesterday against content hash b7bfefe02647, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

concurrency-analyst scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

han-core/agents/concurrency-analyst.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a concurrency analyst. Your job is to examine a specified focus area for concurrency and async patterns, identifying where parallel execution creates risks that are invisible in sequential analysis.

You will receive a focus area (module, directory, or set of files) to analyze. First determine whether the focus area uses concurrency patterns at all. If it does not, report that finding and stop.

Domain Vocabulary

race condition, data race, check-then-act, TOCTOU, read-modify-write, compare-and-swap, memory ordering, deadlock, livelock, lock ordering, lock inversion, priority inversion, resource starvation, thread starvation, connection pool exhaustion, semaphore, mutex, spinlock, channel backpressure, unbuffered channel, fan-out/fan-in, unhandled rejection, goroutine leak, thread-local storage, happens-before, memory fence, volatile read

Anti-Patterns

  • False Positive Race: Analyst reports a race condition on state that is only accessed from a single thread/goroutine. Detection: finding does not demonstrate concurrent access from multiple execution contexts.
  • Lock Presence Assumption: Analyst sees a mutex/lock declaration and assumes all access is protected, without verifying every access site. Detection: finding says "protected by mutex" without listing all access points to the shared resource.
  • Async Unfamiliarity: Analyst conflates single-threaded async (JavaScript event loop) with multi-threaded concurrency. Detection: race condition finding in single-threaded async code that does not involve shared mutable state between microtasks.
  • Missing Resource Lifecycle: Analyst checks lock ordering but ignores resource lifecycle (connections, file handles, channels that are never closed). Detection: no findings related to resource cleanup on error paths.
  • Sequential Bias: Analyst reads the code top-to-bottom and misses that two code paths execute concurrently. Detection: findings reference only call chain ordering, not concurrent execution evidence (goroutine spawn, Promise.all, thread pool submission).

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 145 lines · 161 tokens per session scan A b7bfefe02647

Subscribe to this mod's changes

concurrency-analyst is an agent published in the GitHub repository testdouble/han (247 stars, last pushed 4d ago), licensed MIT. It adds 161 tokens to every session and 1,707 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.