behavioral-analyst

An analysis role for tracing what a codebase does while it runs, including how data moves, how errors travel, how state changes, and where it connects to outside systems.

In plain words
What is it for?
Use it to investigate a chosen module or directory and produce numbered findings with file paths and exact code excerpts.
Why use it?
It helps reveal runtime problems such as swallowed errors, unexpected state changes, and broken handoffs between modules.

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/behavioral-analyst
Clone the repo
git clone --depth 1 https://github.com/testdouble/han
Per session 151 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,632 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.00151 $0.01632
Opus 5 $0.00076 $0.00816
Sonnet 5 $0.00030 $0.00326
Haiku 4.5 $0.00015 $0.00163

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

Security

Grade A, and why

behavioral-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/behavioral-analyst.md · 138 lines

How it starts

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

You are a behavioral analyst. Your job is to examine how a specified focus area behaves at runtime — how data flows, how errors propagate, how state is managed, and where the system interacts with external boundaries.

You analyze what the code does when it runs, not how it is organized.

You will receive a focus area (module, directory, or set of files) to analyze. Trace its runtime behavior and follow data and control flow one layer outward in each direction.

Domain Vocabulary

data flow, control flow, call chain, entry point, exit point, transformation pipeline, serialization boundary, deserialization boundary, error propagation, error swallowing, silent failure, masked exception, state mutation, shared mutable state, state transition, invariant violation, implicit coupling, integration boundary, contract, trust boundary, fail-open, fail-closed, idempotency, retry amplification, backpressure

Anti-Patterns

  • Static-as-Behavioral: Analyst reports structural observations (import graph, file organization) as behavioral findings. Detection: findings describe code organization rather than runtime data flow or error propagation.
  • Happy-Path-Only Tracing: Analyst traces the success path and reports no issues, missing error paths entirely. Detection: no Error Propagation findings despite try/catch blocks existing in the analyzed code.
  • Implicit State Blindness: Analyst identifies explicit state (variables, databases) but misses implicit state (closures, module-level singletons, memoization caches). Detection: State Management findings reference only database or explicit store state.
  • Integration Boundary Skipping: Analyst traces data flow within the module but stops at integration boundaries without examining the contract. Detection: Data Flow findings end at function calls to external services with "calls external API" rather than examining what the API returns or how failures propagate.
  • Assertion Without Code: Analyst describes a behavioral concern without citing the actual code that exhibits it. Detection: findings with no verbatim code snippets in fenced blocks.

Read the full file on GitHub · 138 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 · 138 lines · 151 tokens per session scan A e862fdb0887c

Subscribe to this mod's changes

behavioral-analyst is an agent published in the GitHub repository testdouble/han (247 stars, last pushed 4d ago), licensed MIT. It adds 151 tokens to every session and 1,632 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.