trace-data-flows

A method for following data through a software system, from outside input to storage, processing, and output.

In plain words
What is it for?
Use it during security reviews and bug investigations to map request data, uploads, environment settings, messages, database records, and third-party responses.
Why use it?
It helps reveal where untrusted data enters, where checks are missing, and whether data can reach an unsafe destination or leave the system unexpectedly.

Skill for Claude CodeCodex

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 skills/quangphu1912/codebase-analyzer/trace-data-flows
Any agent
npx skills add quangphu1912/codebase-analyzer --skill trace-data-flows
Clone the repo
git clone --depth 1 https://github.com/quangphu1912/codebase-analyzer

Made for: Claude Code, Codex.

Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,705 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.00037 $0.01705
Opus 5 $0.00018 $0.00852
Sonnet 5 $0.00007 $0.00341
Haiku 4.5 $0.00004 $0.00170

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

Security

Grade A, and why

trace-data-flows 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.

skills/trace-data-flows/SKILL.md · 177 lines

How it starts

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

Using codebase-analyzer to trace data flows.

Overview

Follow the data, not the code. Code shows structure; data shows behavior. Where does untrusted data enter? Where is it validated? Where does it influence control flow? Where does it persist? Where does it exit?

Every bug is data taking an unexpected path. Every vulnerability is data reaching a dangerous destination without proper clearance.

Prerequisites

Read these files first for context:

  • docs/analysis/tech-stack.md — framework conventions for data handling
  • docs/analysis/build-pipeline.md — build-time vs runtime data boundaries

Five-Stage Data Flow Trace

1. Entry — Where Does External Data Arrive?

Map every point where data crosses the system boundary:

  • HTTP parameters — query strings, headers, cookies, request bodies (JSON/form)
  • File uploads — multipart data, file paths from user input
  • Environment variables — configuration injected at runtime
  • IPC / message queues — data from other services, event streams, pub/sub
  • Database reads — data previously stored may have been poisoned
  • API responses — third-party data is untrusted by definition

For each entry point, record: the source, the data shape expected, and the trust level assigned.

2. Validation — Where Is Data Checked?

If at all. Gaps between entry and usage are injection risks.

Search for:

  • Schema validation (Zod, Joi, Pydantic, protobuf, JSON Schema)
  • Input sanitization (escaping, trimming, type coercion)
  • Allowlist validation (enum checks, regex patterns)
  • Authorization checks (can this user access this data?)

Critical: Note every entry point that has NO corresponding validation before the data is used. These are vulnerabilities.

3. Control Flow — Where Does Data Influence Execution?

This is where injection lives. When untrusted data determines what code runs:

  • SQL queries — string interpolation, concatenation in query building
  • Shell commands — data passed to exec(), system(), backtick operators
  • Template rendering — data injected into HTML (XSS), templates (SSTI)
  • Dynamic dispatch — data used as function names, class names, file paths
  • Configuration — data that alters application behavior (feature flags, routing)
  • Deserialization — data decoded into objects (pickle, YAML.load, unserialize)

Read the full file on GitHub · 177 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 177 lines · 37 tokens per session scan A 84736ad8d15f

Subscribe to this mod's changes

trace-data-flows is a skill published in the GitHub repository quangphu1912/codebase-analyzer (2 stars, last pushed 4mo ago), licensed MIT. It adds 37 tokens to every session and 1,705 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens