compact-dir-listing

compact-dir-listing is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 22 tokens per session (1,164 once invoked), scanned A, original, MIT.

A way to list repository files as short, slash-separated paths instead of a visual folder tree. It also avoids dumping large vendor or version-control folders into the listing.

In plain words
What is it for?
Use it when exploring a repository before editing, debugging, or refactoring files.
Why use it?
Clear file paths are easier for an AI agent to read and use, while excluding irrelevant folders reduces the amount of context it must process.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the major-ai-skills plugin — 147 skills, 8 plugins shipped together

Good fit Use it when exploring a repository before editing, debugging, or refactoring files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alivirgo/major-ai-skills/compact-dir-listing
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.

Any agent
npx skills add alivirgo/Major-AI-Skills --skill compact-dir-listing
Clone the repo
git clone --depth 1 https://github.com/alivirgo/Major-AI-Skills

Made for: Claude Code.

Or install major-ai-skills, the plugin that ships this one along with the rest of its 147 skills, 8 plugins.

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 compact-dir-listing

README.md
[![agentmods](https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/compact-dir-listing/github.svg)](https://agentmods.dev/skills/alivirgo/major-ai-skills/compact-dir-listing)
Your own site
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/compact-dir-listing"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/compact-dir-listing/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 compact-dir-listing

Your own site · 80×15
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/compact-dir-listing"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/compact-dir-listing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,164 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.00022 $0.01164
Opus 5.5 $0.00009 $0.00466
Sonnet 5.5 $0.00004 $0.00233
Haiku 4.5 $0.00002 $0.00116

Measured 1mo ago against content hash 45a5ebf20f0d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

compact-dir-listing 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 1mo 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.

skills/compact-dir-listing/SKILL.md · 126 lines

How it starts

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

Compact Directory Path Listing (Flat Paths over Visual Trees)

Overview

When exploring a repository structure, naive agents frequently run commands like tree or generate nested Unicode ASCII branch diagrams (├── src/, │ └── components/, │ └── Button.tsx).

Visual ASCII trees suffer from severe token inefficiencies:

  1. Tokenizer Fragmentation: Unicode branch glyphs (│, ├, ─, └) and leading whitespace consume 4 to 6 separate tokens per line.
  2. Ambiguous Relative Paths: The model must reconstruct full paths by mentally tracing nested indentation levels, leading to file-not-found tool call errors.
  3. Vendor Directory Bloat: Unbounded tree commands dump thousands of lines of node_modules, .git, and venv into context.

The Compact Path Listing Protocol replaces visual tree graphs with flat, slash-delimited relative path streams, cutting token consumption by 75% while providing unambiguous paths ready for instant tool invocation.


Visual ASCII Tree vs. Compact Flat Paths

┌─────────────────────────────────────────────────────────────┐
│                 Directory Listing Comparison                │
│                                                             │
│  Nested Visual ASCII Tree (`tree` - 185 Tokens):            │
│  .                                                          │
│  ├── src                                                    │
│  │   ├── api                                                │
│  │   │   ├── auth.ts                                        │
│  │   │   └── stripe.ts                                      │
│  │   └── components                                         │
│  │       └── Button.tsx                                     │
│  ↳ 185 tokens billed on decorative Unicode branches         │
│                                                             │
│  Compact Flat Paths (`git ls-files` - 38 Tokens):           │
│  src/api/auth.ts                                            │
│  src/api/stripe.ts                                          │
│  src/components/Button.tsx                                  │
│  ↳ 38 clean tokens (79.4% Reduction!)                       │
│  ↳ Instant 1-click path resolution for `view_file`          │
└─────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 126 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. 1mo ago Changed · -14 tokens per session 45a5ebf20f0d
  2. 1mo ago First seen · 126 lines · 36 tokens per session scan A 5881a17333ad

Subscribe to this mod's changes

compact-dir-listing is a skill published in the GitHub repository alivirgo/Major-AI-Skills (2 stars, last pushed yesterday), licensed MIT. It adds 22 tokens to every session and 1,164 once invoked, about $0.0001 per session on Opus 5.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-09-05.

Related

Other skills, from other repositories

trueline-workflow

Use when editing, reading, searching, or exploring files with trueline MCP tools (truelineread, truelineedit, truelinesearch, truelineoutline, truelineverify, truelinechanges). Covers when to pick trueline over built-in Read/Edit/Grep, ref reuse, hash-verified edits, search-then-edit, insertafter semantics, workflows…

rjkaes/trueline-mcp · 95 tokens

advogado-criminal-v2

ADVOGADO CRIMINALISTA SENIOR — ESPECIALISTA EM DIREITO PENAL E MARIA DA PENHA workflow skill. Use this skill when the user needs Advogado criminalista especializado em Maria da Penha, violencia domestica, feminicidio, direito penal brasileiro, medidas protetivas, inquerito policial e acao penal and the operator should…

diegosouzapw/awesome-omni-skills · 98 tokens

ad-creative-v2

Ad Creative workflow skill. Use this skill when the user needs Create, iterate, and scale paid ad creative for Google Ads, Meta, LinkedIn, TikTok, and similar platforms. Use when generating headlines, descriptions, primary text, or large sets of ad variations for testing and performance optimization and the operator…

diegosouzapw/awesome-omni-skills · 85 tokens

aio-google-workspace

Interact with Google Workspace services via the gws CLI. Use when the user wants to send email, read Gmail, upload to Drive, create a Google Calendar event, read or write Google Sheets, generate a standup report, manage Google Tasks, or work with Google Docs, Slides, Chat, or Contacts.

aiocean/claude-plugins · 67 tokens

airtable-automation-v2

Airtable Automation via Rube MCP workflow skill. Use this skill when the user needs Automate Airtable tasks via Rube MCP (Composio): records, bases, tables, fields, views. Always search tools first for current schemas and the operator should preserve the upstream workflow, copied support files, and provenance before…

diegosouzapw/awesome-omni-skills · 77 tokens

aio-perfectize

Use when the user asks to make finished work perfect or take it from good to perfect — "make it perfect", "make perfect", "perfectize", "final pass", "last 10%", "polish this", "best version", "raise the bar", "hoàn thiện lần cuối", "nâng chuẩn" — for code, prose, a plan, an analysis or a UI that already passes its…

aiocean/claude-plugins · 99 tokens