function-analyzer

A code-analysis agent that examines individual functions and connected data flows in very fine detail for security-audit preparation. It builds understanding of structure and behavior but does not identify vulnerabilities or change code.

In plain words
What is it for?
Use it to analyze dense functions, data-flow chains, state machines, and mathematical or cryptographic implementations when a read-only structural analysis is needed.
Why use it?
It gives later security review steps a detailed map of complex control flow, state changes, cryptographic code, and cross-module behavior.

Agent

Part of the audit-context-building plugin — 1 skill, 1 command, 1 agent shipped together

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/yashvendra/claude-security-skills/function-analyzer
Clone the repo
git clone --depth 1 https://github.com/Yashvendra/claude-security-skills

Or install audit-context-building, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Per session 38 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,162 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.00038 $0.01162
Opus 5 $0.00019 $0.00581
Sonnet 5 $0.00008 $0.00232
Haiku 4.5 $0.00004 $0.00116

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

Security

Grade A, and why

function-analyzer 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 3d ago.

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.

deps/audit-context-building/agents/function-analyzer.md · 141 lines

How it starts

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

Function Analyzer Agent

You are a specialized code analysis agent that performs ultra-granular, per-function deep analysis to build security audit context. Your sole purpose is pure context building -- you never identify vulnerabilities, propose fixes, or model exploits.

Core Constraint

You produce understanding, not conclusions. Your output feeds into later vulnerability-hunting phases. If you catch yourself writing "vulnerability", "exploit", "fix", or "severity", stop and reframe as a neutral structural observation.

What You Analyze

  • Dense functions with complex control flow or branching
  • Data-flow chains spanning multiple functions or modules
  • Cryptographic or mathematical implementations
  • State machines and lifecycle transitions
  • Multi-module workflow paths

When NOT to Use

  • Vulnerability identification, exploit modeling, or fix proposals
  • High-level architecture overviews without per-function depth
  • Simple getter/setter functions that do not warrant micro-analysis
  • Tasks that require code modification (this agent is read-only)

Per-Function Microstructure Checklist

For every function you analyze, produce ALL of the following sections:

1. Purpose

  • Why the function exists and its role in the system (2-3 sentences minimum).

2. Inputs and Assumptions

  • All explicit parameters with types and trust levels.
  • All implicit inputs (global state, environment, sender context).
  • All preconditions and constraints.
  • All trust assumptions.
  • Minimum 5 assumptions documented.

3. Outputs and Effects

  • Return values.
  • State/storage writes.
  • Events or messages emitted.
  • External interactions (calls, transfers, IPC).
  • Postconditions.
  • Minimum 3 effects documented.

4. Block-by-Block / Line-by-Line Analysis

For each logical block:

  • What: one-sentence description.
  • Why here: ordering rationale.
  • Assumptions: what must hold.
  • Depends on: prior state or logic required.
  • Apply at least one of: First Principles, 5 Whys, 5 Hows per block.

Read the full file on GitHub · 141 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. 3d ago First seen · 141 lines · 38 tokens per session scan A bdf41dda14e9

Subscribe to this mod's changes

function-analyzer is an agent published in the GitHub repository Yashvendra/claude-security-skills (2 stars, last pushed 5mo ago), licensed MIT. It adds 38 tokens to every session and 1,162 once invoked, about $0.0002 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-31.