Agent skill

Codebase Pathfinder

by thedotmack in thedotmack/claude-mem

Maps a codebase into feature-grouped Mermaid flowcharts, finds duplicated concerns across features and proposes a unified architecture with handoff prompts for planning.

Apache-2.0Auto-check passedDevelopment

Install Codebase Pathfinder

skills CLI
$ npx skills add thedotmack/claude-mem --skill pathfinder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install thedotmack/claude-mem pathfinder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/thedotmack/claude-mem.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugin/skills/pathfinder .claude/skills/pathfinder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pathfinder
GitHub stars
99k
Token cost
~1.5k tokens
SKILL.md length
771 words
Files
1
Skills in repo
26
Repo updated
First seen
Licence
Apache-2.0

At a glance

Maps a codebase into feature-grouped Mermaid flowcharts, finds duplicated concerns across features and proposes a unified architecture with handoff prompts for planning.

  • Works in 5 steps: Feature Discovery (ALWAYS FIRST) → Per-Feature Flowcharts (FAN OUT) → Duplication Hunt → …
  • Auditing architecture before a large refactor
  • SKILL.md covers Delegation Model, Output Artifacts, Phases and Key Principles, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The agent acts as an orchestrator that writes no implementation code. It uses subagents for discovery and extraction, such as file reading, flow tracing, grep and diagramming, while it keeps synthesis for itself, rejecting any report that lacks source citations. Each subagent reports the exact file paths and line ranges read, concrete findings, Mermaid diagrams whose nodes are labeled with file and line, and a confidence note.

Work runs in phases. Phase zero sends one subagent to walk the source tree and propose feature boundaries, which the orchestrator reviews before anything fans out. Phase one deploys one flowchart subagent per feature in parallel, each tracing the main path from entry point to end state, noting side effects such as database writes, HTTP calls, file I/O and process spawns, and listing dependencies on other features.

Everything lands in a dated PATHFINDER folder at the repository root: a feature inventory, one flowchart per feature, a duplication report with evidence, a unified architecture proposal with its own diagram, and handoff prompts to run with /make-plan for each unified system.

When your agent uses it

  • Auditing architecture before a large refactor
  • Finding duplicated systems across features and deciding how to unify them
  • Producing per-feature flowcharts of an unfamiliar codebase

Example prompts

  • “Find the ideal path for this repo: map each feature and show where concerns are duplicated.”
  • “Audit the architecture before the refactor and give me a unified proposal.”
  • “Draw a flowchart for each feature in src and write the duplication report.”

Requirements

  • An agent that can launch parallel subagents

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Feature Discovery (ALWAYS FIRST)
  2. Per-Feature Flowcharts (FAN OUT)
  3. Duplication Hunt
  4. Unified Proposal (ORCHESTRATOR)
  5. Per-System Handoff Prompts

What it can do on your machine

Read from SKILL.md and the folder at commit fa8ab09. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codebase Pathfinder loads about 1.5k tokens when it runs. Until then it costs about 80 tokens; SKILL.md has 771 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from thedotmack/claude-mem at commit fa8ab09, republished under its Apache-2.0 licence (© thedotmack). 771 words, ~1,539 tokens.

Download SKILL.mdSave it as .claude/skills/pathfinder/SKILL.md (or your agent's skills folder).
name
pathfinder
description
Map a codebase into feature-grouped flowcharts, identify duplicated concerns across features, and propose a unified architecture. Use when asked to "find the ideal path," unify duplicated systems, or audit architecture before a refactor. Emits a proposed unified flowchart plus per-system /make-plan prompts.

Pathfinder

You are an ORCHESTRATOR. Map the codebase into feature-grouped flowcharts, identify duplicated concerns, propose the simplest unified architecture, and hand off per-system plans to /make-plan.

You do not write implementation code. You produce diagrams, a duplication report, a proposed unified flowchart, and handoff prompts.

Delegation Model

Use subagents for discovery and extraction (file reading, flow tracing, grep, diagramming). Keep synthesis (deciding feature boundaries, picking unification strategies, final flowchart) with the orchestrator. Reject subagent reports that lack source citations and redeploy.

Subagent Reporting Contract (MANDATORY)

Each subagent response must include:

  1. Sources consulted — exact file paths and line ranges read
  2. Concrete findings — exact function names, call sites, data flow
  3. Mermaid diagram(s) with nodes labeled by file:line
  4. Confidence note + known gaps

Output Artifacts

All artifacts go in PATHFINDER-<YYYY-MM-DD>/ at repo root:

  • 00-features.md — feature inventory with boundaries
  • 01-flowcharts/<feature>.md — one Mermaid flowchart per feature
  • 02-duplication-report.md — cross-cutting duplicated concerns with evidence
  • 03-unified-proposal.md — proposed unified architecture + Mermaid
  • 04-handoff-prompts.md — copy-pasteable /make-plan prompts per unified system

Phases

Phase 0: Feature Discovery (ALWAYS FIRST)

Deploy ONE "Feature Discovery" subagent to:

  1. Walk the source tree (not built artifacts) and read top-level README / CLAUDE.md
  2. Propose feature boundaries based on directory structure, import graph, and naming
  3. Return a flat list of features with: name, entry points (file:line), core files, brief purpose

Orchestrator reviews the proposal, adjusts boundaries if needed, writes 00-features.md. Do NOT fan out until feature boundaries are approved.

Phase 1: Per-Feature Flowcharts (FAN OUT)

Deploy ONE "Flowchart" subagent per feature in parallel. Each receives only its feature's scope. Each must:

  1. Trace the feature's primary happy path from entry point to terminal state
  2. Identify side effects (DB writes, HTTP calls, file I/O, process spawns)
  3. Note error and fallback branches but do not let them dominate the diagram
  4. Produce a Mermaid flowchart TD with every node labeled Name<br/>file:line
  5. List external dependencies (other features it calls into) at the bottom

Orchestrator writes each flowchart to 01-flowcharts/<feature>.md. Reject any diagram missing file:line labels.

Phase 2: Duplication Hunt

Deploy TWO subagents in parallel:

"Within-Feature Duplication" subagent:

  • For each feature, find repeated code/logic patterns inside the feature only
  • Report only duplications worth consolidating (ignore trivial repetition)

"Cross-Feature Duplication" subagent:

  • Compare flowcharts across features for concerns that appear in multiple places
  • Examples of what to look for: multiple capture paths, parallel queue implementations, duplicated storage/migration code, repeated agent scaffolding, parallel parsing layers
  • For each duplication, report: (a) the concern, (b) every location with file:line, (c) why they diverged, (d) whether the divergence is legitimate specialization or accidental

Orchestrator synthesizes both into 02-duplication-report.md. Every duplication claim must cite ≥2 file:line locations.

Show full SKILL.md (336 more words)Show less
Phase 3: Unified Proposal (ORCHESTRATOR)

The orchestrator writes 03-unified-proposal.md itself — do not delegate synthesis.

For each duplicated concern from Phase 2 that is NOT legitimate specialization:

  1. Propose the simplest unified design (one path, one store, one handler — whatever applies)
  2. Name the consolidated component and its single entry point
  3. Show what each old call site becomes
  4. Call out any loss of capability and whether it's acceptable

End the document with ONE combined Mermaid flowchart showing the proposed unified system. Nodes still labeled with target file:line (new or existing) where knowable.

Anti-patterns to reject in your own proposal:

  • Adding a new abstraction layer "for flexibility"
  • Keeping both old paths behind a feature flag
  • Introducing a registry/factory when a switch statement suffices
  • Preserving divergent behavior "just in case"
Phase 4: Per-System Handoff Prompts

For each unified system in the proposal, write a ready-to-run /make-plan prompt to 04-handoff-prompts.md. Each prompt must:

  1. State the target unified component and its single entry point
  2. List the exact call sites to rewrite (from Phase 2 evidence)
  3. Cite the relevant flowchart file from 01-flowcharts/
  4. Include anti-pattern guards specific to this system

Format each as a fenced code block the user can copy directly into /make-plan.

Key Principles

  • Evidence over intuition — every diagram node and duplication claim cites file:line
  • Current state before ideal state — Phases 0–2 describe what IS; Phase 3 describes what SHOULD BE
  • Simplest unification wins — prefer deletion over abstraction; prefer one path over configurable paths
  • Specialization is not duplication — two components serving different trust models or data sources are legitimate even if their code looks similar
  • Handoff, don't implement — Pathfinder ends at plan prompts; /make-plan and /do take it from there

Failure Modes to Prevent

  • Drawing flowcharts from memory instead of source — redeploy subagent with grep evidence requirement
  • Proposing unification of legitimately specialized components — re-examine trust/data-source divergence
  • Handoff prompts that lack concrete call sites — rewrite with Phase 2 evidence
  • Skipping Phase 0 boundary review — fanning out on bad feature boundaries wastes all of Phase 1

© thedotmack, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugin/skills/pathfinder of thedotmack/claude-mem.

Open the folder on GitHubat commit fa8ab09

Compare with similar skills

Codebase Pathfinder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codebase Pathfinder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codebase Pathfinder this skillthedotmack/claude-mem99k—~1.5kAutomated safety check: PassApache-2.0
Audit Flowzebbern/claude-code-guide4.7k—~4.2kAutomated safety check: PassMIT
Archify Diagramstt-a1i/archify81k—~2.9kAutomated safety check: PassMIT
Archify Diagram BuilderUnclecheng-li/AI_Animation1.5k2 repos~4.1kAutomated safety check: PassMIT
GitDiagram Repository Overviewahmedkhaleel2004/gitdiagram18k—~427Automated safety check: PassMIT
Code Graph Mermaid Diagramstrailofbits/skills7.4k—~1.7kAutomated safety check: PassCC-BY-SA-4.0

Similar skills

  • Audit Flow

    zebbern/claude-code-guide

    Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export.

    4.7k GitHub stars~4.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Archify Diagrams

    tt-a1i/archify

    Creates interactive architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone HTML with inline SVG, themes and image or video export.

    81k GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Archify Diagram Builder

    Unclecheng-li/AI_Animation

    Builds validated architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone interactive HTML from a small JSON spec, with optional motion and image export.

    1.5k GitHub starsUsed in 2 repos~4.1k tokens
    DevelopmentAuto-check passed
  • GitDiagram Repository Overview

    ahmedkhaleel2004/gitdiagram

    Explains the architecture of a public GitHub repository through GitDiagram: how the code is organized, the main components with paths, and a Mermaid diagram.

    18k GitHub stars~427 tokensUpdated today
    DevelopmentAuto-check passed
  • Code Graph Mermaid Diagrams

    trailofbits/skills

    Official

    Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.

    7.4k GitHub stars~1.7k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Mermaid Diagrams

    jjmartres/opencode

    Helps an agent pick the right Mermaid diagram type and write the syntax for class, sequence, flow, ER, C4, state and other software diagrams.

    133 GitHub starsUsed in 6 repos~1.9k tokens
    DevelopmentAuto-check passed

More from thedotmack/claude-mem

All 26 skills in this repo
  • Walks you through creating, installing and verifying a custom claude-mem mode, including note types, tags and optional Telegram alerts for chosen memories.

    99k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Pull Request Babysitter

    thedotmack/claude-mem

    Keeps watching a pull request, fixing real review and CI problems and resolving stale threads, until it is clean and ready to merge.

    99k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Claude-Mem Install for Grok Bot

    thedotmack/claude-mem

    Use this when setting up claude-mem on Grok Bot: local worker plus CMEM Pro observer (default), optional host-login observer, or remote cmem.ai. No Cursor…

    99k GitHub stars~440 tokensUpdated today
    Auto-check passed
  • Claude-Mem Cloud Sync

    thedotmack/claude-mem

    Checks claude-mem cloud sync status and guides you through connecting a cmem.ai Pro account without the sync token ever passing through the chat.

    99k GitHub stars~1k tokensUpdated today
    Auto-check: notes
  • Audits a design against Dieter Rams' ten principles of good design, scores each with evidence, and hands off a make-plan prompt for a new, refined or redesigned outcome.

    99k GitHub stars~4.6k tokensUpdated today
    Auto-check passed
  • Session Handoff Document

    thedotmack/claude-mem

    Writes a HANDOFF.md capturing goal, state, files, failed attempts and next steps so a fresh agent session can continue exactly where this one stopped.

    99k GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Works with

Questions about Codebase Pathfinder

What does Codebase Pathfinder do?

Maps a codebase into feature-grouped Mermaid flowcharts, finds duplicated concerns across features and proposes a unified architecture with handoff prompts for planning. The agent acts as an orchestrator that writes no implementation code. It uses subagents for discovery and extraction, such as file reading, flow tracing, grep and diagramming, while it keeps synthesis for itself, rejecting any report that lacks source citations.

When should I use Codebase Pathfinder?

Codebase Pathfinder fits situations like: auditing architecture before a large refactor; finding duplicated systems across features and deciding how to unify them; producing per-feature flowcharts of an unfamiliar codebase.

How do I install Codebase Pathfinder in Claude Code?

Run `npx skills add thedotmack/claude-mem --skill pathfinder -a claude-code`. Or copy the skill folder (plugin/skills/pathfinder in thedotmack/claude-mem) into .claude/skills/pathfinder in your project. Claude Code loads it when a task matches its description.

How do I install Codebase Pathfinder in Codex?

Run `npx skills add thedotmack/claude-mem --skill pathfinder -a codex`. Or copy the skill folder (plugin/skills/pathfinder in thedotmack/claude-mem) into .agents/skills/pathfinder in your project. Codex loads it when a task matches its description.

Can I use Codebase Pathfinder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add thedotmack/claude-mem --skill pathfinder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pathfinder, .gemini/skills/pathfinder, .github/skills/pathfinder and .opencode/skills/pathfinder in your project.

What does Codebase Pathfinder need to run?

SKILL.md names no scripts, command-line tools or credentials: Codebase Pathfinder is instructions for the agent only. Our summary lists: An agent that can launch parallel subagents.

Does Codebase Pathfinder access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Codebase Pathfinder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codebase Pathfinder use?

Codebase Pathfinder is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codebase Pathfinder use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codebase Pathfinder?

Skills that share tags, products or a category with Codebase Pathfinder: Audit Flow (zebbern/claude-code-guide, 4.7k stars), Archify Diagrams (tt-a1i/archify, 81k stars), Archify Diagram Builder (Unclecheng-li/AI_Animation, 1.5k stars) and GitDiagram Repository Overview (ahmedkhaleel2004/gitdiagram, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codebase Pathfinder?

thedotmack (a GitHub user) maintains it in thedotmack/claude-mem, which has 98,732 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 9, 2026.

Source: thedotmack/claude-mem on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.