symlink-vs-realfile-classify-before-deleting-fanout-dups
Use before deleting "duplicates" during a skill/config dedup on a symlink-fanned tree — run a `test -L` classification loop first, so you remove only genuine…
Skill by hjr15
Chalk Labs
Need help deploying symlink-vs-realfile-classify-before-deleting-fanout-dups?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/hjr15-symlink-vs-realfile-classify-before-deleting-fanout-dups
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/symlink-vs-realfile-classify-before-deleting-fanout-dups
What's inside
- Skill name
symlink-vs-realfile-classify-before-deleting-fanout-dups- Description
- Use before deleting "duplicates" during a skill/config dedup on a symlink-fanned tree — run a `test -L` classification loop first, so you remove only genuine real-file dups and KEEP the install.sh fan-out symlinks. Guards a near-miss deletion of your own fan-out.
- License
- MIT
- Instructions
- 84 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- files: referenced but missing: scripts/install.sh
Files (1)
- SKILL.md
SKILL.md (first lines)
# Classify Symlink vs Real File Before Deleting Fan-Out Duplicates
## Overview
In a symlink-fanned config tree, one logical file legitimately appears at many
paths. In `claude-config`, `scripts/install.sh` fans universal memory cards out
by **symlink** — one real file under `memory/_universal/`, symlinks into every
project's memory dir and into `~/.claude`. During a dedup sweep, those symlinks
look exactly like "duplicates" and a naive `find … -delete` or "remove the copy"
will destroy your own fan-out.
The rule: **never delete a path in a fan-out tree without classifying it first.**
A symlink pointing back at the canonical source is *intended fan-out* — keep it.
A **real file** with the same content as the canonical one is a genuine dup
(often a sister session's stray copy or a pre-symlink leftover) — that's what
you delete.
## When to Use
- Deduplicating memory cards / skills / any config across a tree that
`install.sh` (or equivalent) symlink-fans-out.
- You've found N paths with the same name/content and are about to remove the
"extras".
- Any symlink-fanned repo where one source is projected into many locations.
## The Classification Loop
Test each candidate path before touching it:
```bash
for p in <candidate-paths>; do
if [ -L "$p" ]; then
printf 'SYMLINK (keep — fan-out): %s -> %s\n' "$p" "$(readlink "$p")"
else
printf 'REAL FILE (candidate to delete): %s\n' "$p"
fi
done
```
- **`-L` true → symlink → KEEP.** It's install.sh's fan-out. Confirm its
`readlink` target is the canonical source; if so, deleting it just breaks the
projection (and `install.sh` would recreate it anyway).
- **`-L` false → real file → delete candidate.** Only after confirming its
content matches the canonical source (`diff <canonical> "$p"`), and that the
canonical copy still exists.
## Do
- Classify with `test -L` first; delete only real-file dups whose canonical
source survives.
- Verify the fan-out still resolves after the sweep — re-run `install.sh` (or
its dry-run) so any legitimately-needed symlink is recreated.
- Treat a real-file dup you didn't create as possibly a sister session's WIP —
check mtime and content before removing.
## Don't
- `find <tree> -name '<dup>' -delete` blind — it eats your own fan-out symlinks.
- Delete a symlink thinking it's a duplicate — it's the *point* of the tree.
- Delete a real-file dup without confirming the canonical source still exists —
you could remove the last copy.
## Rerouting a card between scope tiers (the constructive counterpart)
Moving a card between `_universal/` ↔ project-memory (or project-A ↔ project-B) touches the
same fan-out mechanism, and it's deterministic-but-easy-to-drop-a-step. The invariants:
1. `git mv` the real file to the target scope.
2. **Update all three MEMORY.md indices the move touches** — source (remove), destination
(add), and for a move to/from `_universal/` the universal index too.
3. **Run `bash scripts/install.sh`** to reseed symlinks. Moving *into* `_universal/` creates
new fan-out symlinks in every project dir — they're tracked in git (mode 120000) and must
be `git add`ed. Moving *out of* a project makes those source-project symlinks vanish;
moving *into* a project materialises a real file. `git status` should show both kinds.
4. **Verify:** real file in the correct dir, expected symlinks present/absent, zero orphans
(`find ~/.claude/projects/ -type l -xtype l`).
## Related
- `scripts/install.sh` — the fan-out mechanism this skill protects.
- git commit no pathspec sweeps staged index — the sister-session hazard
in the same shared-config regime.From hjr15/claude-kit, MIT.
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 15, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/hjr15/claude-kit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get symlink-vs-realfile-classify-before-deleting-fanout-dups running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
symlink-vs-realfile-classify-before-deleting-fanout-dups skill. Agent Mart. https://agentmart.dev/skills/hjr15-symlink-vs-realfile-classify-before-deleting-fanout-dups (last updated 2026-10-24)