Agent skill

Filetree

by nekocode in nekocode/filetree-skill

A skill your agent uses when running /filetree:init or /filetree:update — the shared rules those commands load before generating or syncing FILETREE.md.

MITAuto-check passedAgent Workflows

Install Filetree

skills CLI
$ npx skills add nekocode/filetree-skill --skill filetree -a claude-code

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

GitHub CLI
$ gh skill install nekocode/filetree-skill filetree --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/nekocode/filetree-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/filetree .claude/skills/filetree && 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
filetree
GitHub stars
162
Token cost
~2.3k tokens
SKILL.md length
1,274 words
Files
4 (incl. scripts)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when running /filetree:init or /filetree:update — the shared rules those commands load before generating or syncing FILETREE.md.

  • Works in 5 steps: config.language from the todo output… → Else the dominant natural language of… → Else README (any localized variant). → …
  • Running /filetree:init
  • SKILL.md covers Summary style, Summary language, UNCHANGED bias (for… and Symlinks, plus 1 more section
  • Runs Python scripts from its folder; calls python3 and git

What it does

Filetree is an agent skill from nekocode/filetree-skill. Use when running /filetree:init or /filetree:update — the shared rules those commands load before generating or syncing FILETREE.md. Not invoked directly.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `scripts/filetree.py`, `scripts/filetree_config.py` and `scripts/filetree_selfonly.py`).

It sits in Agent Workflows. The repository describes itself as: A Claude Code plugin that maintains FILETREE.md. The licence is MIT.

When your agent uses it

  • Running /filetree:init
  • /filetree:update — the shared rules those commands load before generating
  • Syncing FILETREE.md

Example prompts

  • “/filetree”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. config.language from the todo output (set when .filetree.json pins language). When present it is authoritative — skip the rest of the chain.
  2. Else the dominant natural language of CLAUDE.md / AGENTS.md (the agent contract — most authoritative).
  3. Else README (any localized variant).
  4. Else (/filetree:update only) the dominant language of existing manifest entries.
  5. Else English.

What it can do on your machine

Read from SKILL.md and the folder at commit 8ad3710. 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

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Filetree loads about 2.3k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 1,274 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from nekocode/filetree-skill at commit 8ad3710, republished under its MIT licence (© nekocode). 1,274 words, ~2,329 tokens.

Download SKILL.mdSave it as .claude/skills/filetree/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
filetree
description
Use when running /filetree:init or /filetree:update — the shared rules those commands load before generating or syncing FILETREE.md. Not invoked directly.
license
MIT

Filetree Skill — Shared Rules

Cross-cutting rules used by /filetree:init and /filetree:update. The commands themselves contain step-by-step flows; this file holds rules that apply across modes so they're maintained in one place.

/filetree:lint is read-only script invocation and does not need these rules.


Summary style

One line, max 25 words, describes what the file is FOR (its role / purpose). Not what it implements internally.

  • Good: "JWT auth middleware; parses token from request header and injects user_id into context"
  • Bad: "Defines AuthMiddleware class with init and call methods"
  • Bad: "Handles auth" (too vague)

Present tense. No marketing words. For the language to write summaries in, see "Summary language" below — never pick per-file.


Summary language

One run, ONE language. Every summary in the manifest — and the command's own narration — uses it. Without a single anchor, parallel sub-agents each guess and the manifest ends up mixing Chinese and English.

The command resolves the canonical language ONCE, up front, by this priority:

  1. config.language from the todo output (set when .filetree.json pins language). When present it is authoritative — skip the rest of the chain.
  2. Else the dominant natural language of CLAUDE.md / AGENTS.md (the agent contract — most authoritative).
  3. Else README (any localized variant).
  4. Else (/filetree:update only) the dominant language of existing manifest entries.
  5. Else English.

Then it passes that one language verbatim into EVERY sub-agent prompt ("Write all summaries in <language>"). Sub-agents never re-detect; they run in parallel and would diverge if left to choose.


UNCHANGED bias (for /filetree:update ONLY)

Scope. This entire section applies to /filetree:update only. During /filetree:init the manifest starts empty, so there is no old summary to keep — UNCHANGED has nothing to refresh and apply will drop it. In init, every file gets a real summary. Do not apply this bias to init sub-tasks.

Why this matters. Hash changes trigger the LLM, but most code changes (typos, refactors, comments, small additions) don't change a file's purpose. Outputting "UNCHANGED" lets cmd_apply refresh just the hash and keep the existing summary — the manifest itself carries the memory of "I already reviewed this version". In a healthy update run, 80%+ of changed items should resolve to UNCHANGED. Writing a fresh 25-word summary when the old one still fits wastes ~100x more tokens than a 4-byte "UNCHANGED" reply.

Decision rule. You have: old summary, old hash, new hash, and the file's new content (prefer reading the git diff over the full file — diff is far denser per token and is all you need for purpose-level judgement). If the diff comes back EMPTY (the change was already committed, so working tree == HEAD), fall back to reading the file — the hash moved, so judging purpose from a blank diff would falsely yield UNCHANGED.

Output "UNCHANGED" if the old summary still describes the file's PURPOSE. Refactors, renames, bug fixes, test additions, formatting, comment changes, small additions — these almost always leave the purpose intact.

Output a new summary string only if:

  • A major new feature has been added that meaningfully expands purpose
  • A previously central concern has been removed
  • The file has been substantially rewritten for a different goal
  • The old summary is in the wrong language (not the run's canonical language — see "Summary language"). Rewrite it in the target language even if the purpose is unchanged; this is how a legacy mixed-language manifest converges — gradually, as each file's hash changes and re-enters the work plan. Language mismatch ALWAYS overrides the UNCHANGED bias.

When in doubt (and the language already matches), output UNCHANGED.

Rationalizations — every one resolves to UNCHANGED

The pressure to "be thorough" pushes toward rewriting. Each excuse below is a trap; the right answer is UNCHANGED.

ExcuseReality
"The diff is large, so I should rewrite"Diff size ≠ purpose change. A 500-line refactor with the same role is UNCHANGED.
"Let me polish the old summary while I'm here"Polishing burns ~100x the tokens of UNCHANGED and isn't an exception. Only purpose change or wrong language qualifies.
"It's slightly more accurate now""Slightly better wording" is not "purpose changed". UNCHANGED.
"I'm not sure the purpose changed"Not sure = it didn't. UNCHANGED.
"New function added, must re-describe"A helper added to the same role doesn't expand purpose. UNCHANGED.
Red flags — STOP, you're about to waste tokens
  • About to write a summary that says the same thing as old_summary in new words
  • Justifying a rewrite by how much the code changed rather than whether the role changed
  • "Improving" or "tidying" a summary whose language already matches
  • Reading the full file when the git diff already answers the purpose question

All of these mean: output "UNCHANGED".


Show full SKILL.md (522 more words)Show less

Some added / changed items carry a symlink_target field. For those: do not Read the file — a Read follows the link to the target's content (wasteful, and fails on a broken link). Write exactly symlink → <target> using the supplied symlink_target; do not infer a role you can't see. The script already hashes symlinks correctly from the link string.


Processing the work plan (todo --split)

Always run todo --split (the script chunks the LLM work and writes it to files, so you never count, truncate, or hand-split). Output:

json
{ "stats": {...}, "removed": [...], "renamed": [...],
  "manifest_exists": true,
  "config": {"manifest_path": "FILETREE.md", "language": null},
  "split_dir": "/tmp/filetree_XXXX",
  "batches": [{"file": ".../batch_00.json", "count": 25}, ...] }

The config block reflects .filetree.json (the script is the only config parser — never re-read the file yourself). manifest_path is where the manifest lives (may be renamed / relocated); language pins the summary language (see "Summary language" priority 0). exclude / include filtering is already applied inside the script, so the work plan only lists files that belong in the manifest. manifest_exists is whether the manifest file is already on disk — /filetree:update uses it to detect a not-yet-initialized repo (a present-but-empty manifest also reads total_in_manifest: 0, so the boolean is the reliable signal).

Each batch_NN.json is a JSON array of todo items (added + changed). Drive it purely off batches:

  • 0 batches → no LLM work; no part files exist to glob, so apply the empty payload via stdin (it still syncs removed/renamed from repo state):
    bash
    echo '{"updates": []}' | python3 .../filetree.py apply
  • 1 or more batches → spawn one claude-haiku-4-5 sub-agent per batch (good enough, ~10x cheaper) — always, even for a single batch. The main session never Reads a file or writes a summary itself; that work stays out of its context. Each sub-agent: Read SKILL.md, Read its assigned batch_NN.json, then write <split_dir>/part_NN.json. Sub-agents run in parallel and never see each other's batch.
Part-file shape (no hand-merging, no hashes)

Each part_NN.json carries ONLY summaries — hash is computed from disk, removed/renamed are recomputed from repo state, so neither belongs here:

json
{"updates": [{"path": "...", "summary": "..." | "UNCHANGED"}]}

Apply all parts in one call (the shell expands the glob, the script merges):

bash
python3 .../filetree.py apply <split_dir>/part_*.json
Coverage gate — evidence from apply, never a hand-rolled diff

Before claiming the manifest is synced, run this gate on apply's return:

  1. READ missing_from_manifest — any indexable file still without an entry (a dropped sub-agent output, a forgotten file). This is the completion gate.
  2. READ the fixable anomaly keys: skipped_unchanged_new (a wrong UNCHANGED), skipped_missing_path (a hallucinated path).
  3. If 1 or 2 are non-empty → spawn one more claude-haiku-4-5 sub-agent to summarize those files. Pass it the split_dir, the exact paths to fix, and an output filename that does NOT collide with the existing part_NN.json (use part_fixup_NN.json, NN incrementing each retry). It writes <split_dir>/part_fixup_NN.json; then re-run apply <split_dir>/part_*.json — the glob still catches the fixup part, and apply merges and dedups by path. Keep this fixup off the main session too — same as the batch work. Loop until both clear.
  4. IGNORE skipped_excluded — real files the config keeps out, nothing to fix. Do NOT gate on applied == received: a legitimate skipped_excluded makes applied < received hold forever, which would loop here.
  5. ONLY THEN report — straight from apply's return.

Never hand-roll a coverage diff (concatenating batch lists, comparing counts): it is redundant and error-prone. The script's keys are the only evidence.

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

Files

SKILL.md and 3 other files (scripts) in skills/filetree of nekocode/filetree-skill.

  • SKILL.md
  • scripts/filetree.py
  • scripts/filetree_config.py
  • scripts/filetree_selfonly.py

Open the folder on GitHubat commit 8ad3710

Compare with similar skills

Filetree 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.

Filetree compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Filetree this skillnekocode/filetree-skill162—~2.3kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k10 repos~4.1kAutomated safety check: NotesApache-2.0
Using Superpowersfarm-fe/farm5.6k36 repos~1.4kAutomated safety check: PassMIT
Executing Plans Inlineobra/superpowers297k2 repos~5.1kAutomated safety check: PassMIT
Skill CreatorAzure/azqr79689 repos~8.2kAutomated safety check: PassApache-2.0

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 10 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Using Superpowers

    farm-fe/farm

    A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

    5.6k GitHub starsUsed in 36 repos~1.4k tokens
    Agent WorkflowsAuto-check passed
  • Executing Plans Inline

    obra/superpowers

    Has the agent carry out an implementation plan itself, task by task in the current session, keeping a ledger, proving each step with a test and ending with one whole-branch review.

    297k GitHub starsUsed in 2 repos~5.1k tokens
    Agent WorkflowsAuto-check passed
  • Skill Creator

    Azure/azqr

    Official

    Create new skills, modify and improve existing skills, and measure skill performance.

    796 GitHub starsUsed in 89 repos~8.2k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 7 repos~2.8k tokens
    Agent WorkflowsAuto-check passed

Categories

Questions about Filetree

What does Filetree do?

A skill your agent uses when running /filetree:init or /filetree:update — the shared rules those commands load before generating or syncing FILETREE.md. Filetree is an agent skill from nekocode/filetree-skill.md.

When should I use Filetree?

Filetree fits situations like: running /filetree:init; /filetree:update — the shared rules those commands load before generating; syncing FILETREE.md.

How do I install Filetree in Claude Code?

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

How do I install Filetree in Codex?

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

Can I use Filetree 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 nekocode/filetree-skill --skill filetree -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/filetree, .gemini/skills/filetree, .github/skills/filetree and .opencode/skills/filetree in your project.

What does Filetree need to run?

Going by SKILL.md and its folder, Filetree needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and git). Our summary lists: Python 3.

Does Filetree access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Filetree 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Filetree use?

Filetree is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Filetree use?

About 2.3k tokens (SKILL.md is roughly 9.3k 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 Filetree?

Skills that share tags, products or a category with Filetree: MCP Server Builder (anthropics/skills, 180k stars), Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Using Superpowers (farm-fe/farm, 5.6k stars) and Executing Plans Inline (obra/superpowers, 297k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Filetree?

nekocode (a GitHub user) maintains it in nekocode/filetree-skill, which has 162 GitHub stars. The repository was last updated on July 20, 2026.

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