factual-knowledge-extractor-v2-ast

factual-knowledge-extractor-v2-ast is an agent for Claude Code from jingnanzhou/fellow. It costs 30 tokens per session (2,748 once invoked), scanned A, original, Apache-2.0.

A code-analysis assistant that uses abstract syntax trees, a structured representation of source code, to extract data models, entities, relationships, and code structure.

In plain words
What is it for?
Use it to find classes, methods, functions, inheritance, documentation, attributes, and source locations before deeper domain analysis.
Why use it?
It provides the important shape of a codebase with less reading than examining every source file in full.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter; names the TodoWrite tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the fellow plugin — 4 commands, 4 agents shipped together

Good fit Use it to find classes, methods, functions, inheritance, documentation, attributes, and source locations before deeper domain analysis.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add jingnanzhou/fellow
Claude Code
/plugin install fellow

Made for: Claude Code.

Or install fellow, the plugin that ships this one along with the rest of its 4 commands, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for factual-knowledge-extractor-v2-ast

README.md
[![agentmods](https://agentmods.dev/badge/agents/jingnanzhou/fellow/factual-knowledge-extractor-v2-ast/github.svg)](https://agentmods.dev/agents/jingnanzhou/fellow/factual-knowledge-extractor-v2-ast)
Your own site
<a href="https://agentmods.dev/agents/jingnanzhou/fellow/factual-knowledge-extractor-v2-ast"><img src="https://agentmods.dev/badge/agents/jingnanzhou/fellow/factual-knowledge-extractor-v2-ast/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for factual-knowledge-extractor-v2-ast

Your own site · 80×15
<a href="https://agentmods.dev/agents/jingnanzhou/fellow/factual-knowledge-extractor-v2-ast"><img src="https://agentmods.dev/badge/agents/jingnanzhou/fellow/factual-knowledge-extractor-v2-ast.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,748 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00030 $0.02748
Opus 5 $0.00015 $0.01374
Sonnet 5 $0.00006 $0.00550
Haiku 4.5 $0.00003 $0.00275

Measured 12d ago against content hash 2ade9f1aaa03, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

factual-knowledge-extractor-v2-ast 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 12d 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.

agents/factual-knowledge-extractor-v2-ast.md · 400 lines

How it starts

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

Factual Knowledge Extraction Agent (V2 - AST Enhanced)

Objective

Analyze the target codebase and extract data/object models to understand WHAT exists in this project.

NEW: Uses AST (Abstract Syntax Tree) extraction for 80-90% token reduction during structural analysis, then Claude semantic analysis for domain understanding.


Hybrid Extraction Workflow

Phase 1: Structure Extraction (AST - Token Efficient)

Use the ast_extractor.py tool to extract structural information:

# Extract entity signatures from target project
python3 ${CLAUDE_PLUGIN_ROOT}/tools/ast_extractor.py ${TARGET_PROJECT} > /tmp/entity_structures.txt

What This Provides:

  • All class definitions with inheritance
  • Method signatures (name, args, return type, decorators)
  • Function signatures
  • Docstrings (first line)
  • Source locations (file:line)
  • 80-90% fewer tokens than reading full files

Example Output:

## File: src/models/user.py

class User(BaseModel):
  Location: src/models/user.py:10
  Doc: Represents a user account in the system
  Attributes:
    - id: int
    - email: str
    - created_at: datetime
  Methods:
    - validate_email(email: str) -> bool
      Doc: Validates email format
    - get_by_id(user_id: int) -> Optional[User]
      Doc: Retrieves user by ID

Phase 2: Semantic Analysis (Claude - Domain Understanding)

Read the AST structure and extract semantic meaning:

For Each Entity, Extract:

  1. Purpose: What does this entity represent in the domain?

    • Example: "User represents a user account with authentication credentials"
  2. Domain Meaning: How does it fit into the business domain?

    • Example: "Core entity in authentication system"
  3. Relationships:

    • Has-a: Entity contains/references others (e.g., User has Orders)
    • Is-a: Inheritance relationships (already in AST)
    • Uses-a: Dependencies (infer from method parameters/return types)
    • Multiplicity: one-to-one, one-to-many, many-to-many

Read the full file on GitHub · 400 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. 12d ago First seen · 400 lines · 30 tokens per session scan A 2ade9f1aaa03

Subscribe to this mod's changes

factual-knowledge-extractor-v2-ast is an agent published in the GitHub repository jingnanzhou/fellow (4 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 30 tokens to every session and 2,748 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 agents, from other repositories

MS-SQL Database Administrator

Work with Microsoft SQL Server databases using the MS SQL extension.

github/awesome-copilot · 18 tokens

core-data-auditor

Use this agent when the user mentions Core Data review, schema migration, production crashes, or data safety checking. Automatically scans Core Data code for the 5 most critical safety violations - schema migration risks, thread-confinement errors, N+1 query patterns, production data loss risks, and performance issues…

CharlesWiltgen/Axiom · 261 tokens

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 tokens

django-migrations-specialist

Database specialist for Django, runs in the "database" extra phase after development. Finalizes model field types and Meta indexes/constraints, runs makemigrations, reviews generated SQL with sqlmigrate, runs migrate, verifies with migrate --check. Do NOT use for: application logic (django-architect), tests…

AratKruglik/claude-sdlc · 85 tokens

database-architect

Use this agent for database design and change work: schema design, indexing strategy, query optimization, migration safety, and engine selection. Trigger on "design a schema for", "this query is slow", "is this migration safe", "add an index", "Postgres or Mongo for this", or N+1 complaints. Returns schema/DDL with…

aayushostwal/nexus · 96 tokens

db-performance-auditor

Audits a .NET data-access layer end to end for performance — EF Core query patterns (N+1, projections, tracking), indexing gaps, DbContext configuration, connection resiliency, and bulk-operation opportunities — and produces a ranked report with fixes. Use when the user wants a database/EF performance review of a…

StefanTheCode/dotnet-ai-toolkit · 88 tokens