Repo File Analyzer
Parent: Developer Tooling & Repo Automation · Published reference · snapshot 2026-09-08 · skill misc-catch-all/references/repo-file-analyzer.md
↓ Facts as markdownall context files
A lightweight, incremental repo intelligence skill. Walks a repository, analyzes each file, and stores the results in the mdb-context-hub file-analysis library via MCP tools. Does not write any files
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Repo File Analyzer
- A lightweight, incremental repo intelligence skill. Walks a repository, analyzes each file, and stores the results in the mdb-context-hub file-analysis library via MCP tools. Does not write any files to the analyzed repo. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#repo-file-analyzer]
When to use this skill
- You want a quick, searchable per-file index of any repo without running the full repo-bootstrapper [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#when-to-use-this-skill]
- You want to understand what a specific file does without reading the whole codebase [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#when-to-use-this-skill]
- You want to find which files handle authentication, routing, database access, etc. across a repo [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#when-to-use-this-skill]
- You want to re-run the analysis after changing some files and only re-process what changed [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#when-to-use-this-skill]
Required MCP
- mdb_context_hub must be running (HTTP on 127.0.0.1:3939). The skill uses these tools: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#required-mcp]
- tam_get_file_analysis_state - load previous file hashes for the repo [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#required-mcp]
- tam_save_file_analysis - save a single file's analysis entry [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#required-mcp]
- tam_save_file_analysis_state - persist updated hashes after the run [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#required-mcp]
- tam_list_file_analyses - browse results after analysis [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#required-mcp]
- tam_search_file_analyses - find files by keyword across all summaries [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#required-mcp]
- tam_delete_repo_file_analyses - wipe a repo's data and start fresh [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#required-mcp]
File categories
- Before analyzing anything, classify every file into one of four buckets. Process them in order: skip → meta → high-signal → standard. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#file-categories]
SKIP — never analyze
- Do not call tam_save_file_analysis for any file matching these patterns: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#skip-never-analyze]
META — store content verbatim
- These files contain high-value prose that should be preserved largely intact as the summary. Truncate at ~8 KB if the file is very long. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- Patterns (matched against filename or relative path): [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- README* (README.md, README.rst, README.txt, etc.) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- ARCHITECTURE, DESIGN, OVERVIEW* [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- LICENSE* (store as-is; mark purpose "docs") [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- docs/*.md and docs/**/*.md (top-level docs folder) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- Any .md file in the repo root that is not in the SKIP list [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- Use these field values: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- summary: full file content (up to 8 KB; if longer, include first 4 KB + "... [truncated]") [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
- tags: ["meta", "documentation"] plus one of ["readme"], ["license"], ["contributing"], ["architecture"] as appropriate [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#meta-store-content-verbatim]
HIGH-SIGNAL — deep analysis
- These files justify 3–5 sentence summaries and complete export/dependency lists. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- Entry points: index., main., app., server., __main__.py, cli., run. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- Service/business logic: .service., .controller., .handler., .router., .middleware., .resolver., .provider. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- Core models/schemas: .model., .schema., .entity., .domain. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- Any file over 200 lines of non-test source code [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- Files referenced by 3+ other files (if you can tell from imports) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- For high-signal files: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- Write 3–5 sentence summaries covering: what it does, the key algorithm or pattern used, and any important side-effects or invariants [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- List all named and default exports [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- List all significant dependencies (external packages + key internal imports) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
- Add a "high-signal" tag [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#high-signal-deep-analysis]
STANDARD — concise analysis
- All remaining source files. Write 1–3 sentence summaries. List key exports and dependencies only. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#standard-concise-analysis]
Step 1 — Identify the repo
- Accept the repo path from the user or infer it from the working directory. Resolve to an absolute path. This becomes repoPath for all tool calls. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-1-identify-the-repo]
Step 1.5 — Check if the repo is archived
- Do not proceed with a full analysis on an archived repo - it wastes time and pollutes the library with stale data. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-15-check-if-the-repo-is-archived]
- Check for archival using any available signal: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-15-check-if-the-repo-is-archived]
- If the repo is determined to be archived: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-15-check-if-the-repo-is-archived]
- Print: ⚠️ Repo appears to be archived. Skipping analysis to avoid storing stale data. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-15-check-if-the-repo-is-archived]
- Offer the user two options: (a) abort, or (b) continue anyway with a "archived" tag appended to all stored entries. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-15-check-if-the-repo-is-archived]
- If the user chooses (b), proceed with all steps and add "archived" to every file's tags array. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-15-check-if-the-repo-is-archived]
- If the user chooses (a) or gives no response, stop here. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-15-check-if-the-repo-is-archived]
Step 2 — Load previous state
- Call tam_get_file_analysis_state with repoPath. The response is: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-2-load-previous-state]
- Store this as previousState. If lastRun is null, this is a first run. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-2-load-previous-state]
Step 3 — Walk the repo
- Enumerate all files using: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-3-walk-the-repo]
- For each file, compute its SHA-256 hash: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-3-walk-the-repo]
Step 3.5 — Categorize every file
- Before doing any analysis, classify each file into one of: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-35-categorize-every-file]
- skip - matches any SKIP pattern (see table above) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-35-categorize-every-file]
- meta - matches any META pattern [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-35-categorize-every-file]
- high-signal - matches any HIGH-SIGNAL pattern [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-35-categorize-every-file]
- standard - everything else that isn't skipped [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-35-categorize-every-file]
- Print the category counts before starting analysis: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-35-categorize-every-file]
Step 4 — Determine which files need (re-)analysis
- For each file in the meta, high-signal, and standard buckets, compare its hash against previousState.files[relPath]?.hash. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-4-determine-which-files-need-re-analysis]
- New file (not in state): analyze [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-4-determine-which-files-need-re-analysis]
- Changed file (hash differs): analyze [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-4-determine-which-files-need-re-analysis]
- Unchanged file (hash matches): skip - do NOT call tam_save_file_analysis for it [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-4-determine-which-files-need-re-analysis]
- Report the delta counts at the end. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-4-determine-which-files-need-re-analysis]
Step 5A — Store meta files
- For each meta file that is new or changed: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5a-store-meta-files]
- Read the full file content [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5a-store-meta-files]
- Truncate to 8 KB if needed (keep first 4 KB + "\n... [truncated - full file is N lines]") [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5a-store-meta-files]
- Call tam_save_file_analysis: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5a-store-meta-files]
Step 5B — Analyze high-signal files
- For each high-signal file that is new or changed: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
- Read the file content (skip if binary - check by extension or failed UTF-8 decode) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
- Generate a deep analysis: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
- summary: 3–5 sentences covering what it does, the primary pattern/algorithm, key side-effects or invariants, and any notable constraints [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
- purpose: one of entry-point, service, utility, config, test, type-definition, schema, migration, script, component, hook, middleware, model, controller, router, view, store, fixture, build, docs [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
- exports: all named and default exports [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
- dependencies: all significant external packages and key internal imports [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
- tags: 3–6 domain tags + "high-signal" [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
- Call tam_save_file_analysis with this analysis. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5b-analyze-high-signal-files]
Step 5C — Analyze standard files
- For each standard file that is new or changed: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- Read the file content (skip binaries) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- Generate a concise analysis: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- summary: 1–3 sentences on what this file does [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- purpose: same label set as above [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- exports: key exports only [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- dependencies: notable imports only [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- tags: 2–5 domain tags [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- Call tam_save_file_analysis. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
- Batch size: Process in batches of 5–10 files to avoid context overflow. After each batch, continue immediately without pausing. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-5c-analyze-standard-files]
Step 6 — Save updated state
- After all files are processed, call tam_save_file_analysis_state with: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-6-save-updated-state]
- Include all files in the repo (not just the newly analyzed ones) - carry forward the hashes of unchanged files from previousState.files. Do not include SKIP-category files in the state (they are never stored and never need re-checking). [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-6-save-updated-state]
Step 7 — Report
- Offer to let the user query with tam_search_file_analyses or tam_list_file_analyses. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#step-7-report]
Tips for good analysis
- Config files (package.json, pyproject.toml, tsconfig.json): summarize key scripts and dependencies, not the full content; mark purpose: "config" [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#tips-for-good-analysis]
- Test files: note what is being tested and what mocking strategy is used [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#tips-for-good-analysis]
- Type-definition files (.d.ts, types.ts): list the main exported types/interfaces [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#tips-for-good-analysis]
- Entry points (index.ts, main.py, app.js): describe what the file bootstraps and which modules it composes - these are high-signal, treat accordingly [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#tips-for-good-analysis]
- Middleware/handlers: describe what request/response transformation it performs [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#tips-for-good-analysis]
- Models/schemas: list the fields and any validation rules [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#tips-for-good-analysis]
Incremental re-run behavior
- On subsequent invocations, the skill automatically: [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#incremental-re-run-behavior]
- Checks the repo for archival signals before doing any work [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#incremental-re-run-behavior]
- Loads the previous state via tam_get_file_analysis_state [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#incremental-re-run-behavior]
- Re-categorizes every current file (category can change if the file was renamed) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#incremental-re-run-behavior]
- Only re-analyzes files whose hash changed or that are new [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#incremental-re-run-behavior]
- Skips files that were deleted from the repo (they remain in the library until tam_delete_repo_file_analyses is called) [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#incremental-re-run-behavior]
- To force a full re-analysis, call tam_delete_repo_file_analyses first, then re-invoke the skill. [archived source: https://llms-explorer.com/sources/mdb-context-hub/repo-file-analyzer/#incremental-re-run-behavior]
Where this helps
- Building an initial understanding of an unfamiliar repository by walking every file and categorizing it — meta, high-signal, standard — instead of reading everything manually. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Maintaining an incremental, reusable analysis of a repo that only re-analyzes files that actually changed since the last run instead of redoing full analysis every time. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Populating a context hub with structured per-file summaries other tools or agents can query later without re-reading the whole repo. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Prioritizing review or documentation effort toward high-signal files instead of spending equal time on boilerplate or generated files that don't need deep analysis. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Skipping files that should never be analyzed — binaries, generated artifacts, vendored dependencies — so the analysis pass stays fast and focused on files that matter. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Project ideas
- Run the analyzer against an unfamiliar repo and use its high-signal file list as a reading order for a first pass through the codebase. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Wire the incremental re-run behavior into a CI job so the file-analysis library stays current as commits land, without a full re-walk on every run. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Use the stored per-file analysis as context input for a separate documentation-generation or onboarding-guide tool instead of duplicating the file-walk logic. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Extend the file-categorization rules for a language or project type the default rules don't classify well. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Antipatterns
- Re-running a full analysis from scratch on every invocation instead of loading previous state and only analyzing files that changed, wasting time on unchanged files. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Analyzing files that should be skipped, like binaries or vendored code, in full depth, producing noisy or meaningless analysis that pollutes the file-analysis library. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Treating every file as high-signal, which defeats the point of categorization and burns effort on files that don't warrant deep analysis. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Letting stored analysis go stale by never re-checking previous state before deciding what needs re-analysis, so the library drifts out of sync with the actual repo. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Known issues
- The analyzer depends on a required MCP connection to the context hub; without it, the skill has nowhere to store results and can't perform its core incremental-caching behavior. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Categorization rules for META versus HIGH-SIGNAL versus STANDARD versus SKIP are heuristic and can misclassify files in repos that don't follow common conventions, requiring manual correction. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Because the skill deliberately writes no files back into the analyzed repo, its output is only useful to consumers that know to query the file-analysis library — it isn't self-documenting inside the repo itself. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Incremental re-analysis depends on correctly detecting what changed since the last run; if the previous-state load step is skipped or fails, the tool can silently fall back to treating everything as new. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Children
- Per-File Summary Generation (frontier)
- Incremental Analysis via File Hashing (frontier)
- File Analysis Upload to Context Hub (frontier)
- High-Signal File Prioritization (frontier)
Frontier under this node: File Analysis Upload to Context Hub, High-Signal File Prioritization, Incremental Analysis via File Hashing, Per-File Summary Generation