| name | hidden-folder-audit |
| description | Audit and consolidate hidden folders in a repository. Identifies duplicates, dead directories, and consolidation opportunities for .agent-os/, .ai/, .claude/, and other hidden folders. |
| version | 1.2.0 |
| updated | "2026-01-20T00:00:00.000Z" |
| category | meta |
| triggers | ["hidden folder audit","consolidate hidden folders",".agent-os cleanup",".ai cleanup","dot folder review"] |
Hidden Folder Audit Skill
Systematic audit and consolidation of hidden (dot) folders in a repository. Identifies duplicate configurations, dead symlinks, orphaned directories, and consolidation opportunities to establish a clean, maintainable folder structure.
Version Metadata
version: 1.2.0
python_min_version: '3.10'
dependencies: []
compatibility:
tested_python:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
os:
- Windows
- Linux
- macOS
When to Use
- Repository has accumulated multiple hidden folders over time
- Multiple AI/agent configuration directories exist (
.agent-os/, .ai/, .claude/)
- Symlinks point to non-existent targets
- Unclear which configuration is authoritative
- Preparing for repository restructure or cleanup
- After inheriting or forking a repository
- Before establishing new folder standards
Audit Process
Step 1: Inventory All Hidden Folders
List all hidden directories at the repository root.
find . -maxdepth 1 -type d -name ".*" ! -name ".git" | sort
du -sh .*/ 2>/dev/null | grep -v "^0" | sort -hr
find . -maxdepth 1 \( -type d -o -type l \) -name ".*" ! -name ".git" | sort
Step 2: Check Git Tracking Status
Determine which hidden folders are tracked, ignored, or untracked.
git ls-files --error-unmatch .folder/ 2>/dev/null && echo "TRACKED" || echo "NOT TRACKED"
git check-ignore -v .folder/ 2>/dev/null && echo "IGNORED" || echo "NOT IGNORED"
git ls-files | grep "^\." | cut -d'/' -f1 | sort -u
git status --porcelain --ignored | grep "^!!" | grep "^\./\." | cut -d'/' -f2 | sort -u
Step 3: Analyze Content Overlap
Check for duplicate or overlapping content between hidden folders.
diff -rq .agent-os/agents/ .claude/agents/ 2>/dev/null
find .agent-os .ai .claude -name "*.md" -type f 2>/dev/null | xargs -I {} basename {} | sort | uniq -d
find .agent-os .ai .claude -type f 2>/dev/null | xargs md5sum 2>/dev/null | sort | uniq -w32 -d
diff <(find .agent-os -type f | sed 's|.agent-os/||' | sort) \
<(find .claude -type f | sed 's|.claude/||' | sort) 2>/dev/null
Step 4: Identify Authoritative Source
Determine which folder should be the single source of truth.
Criteria for Authoritative Source:
- Git tracking - Tracked folders are more likely authoritative
- Recency - Check last modification dates
- Completeness - More complete configuration wins
- Active use - Referenced in CI/CD, scripts, documentation
- Tool requirements - Some tools require specific folder names
stat -c '%Y %n' .*/ 2>/dev/null | sort -rn | head -10
grep -r "\.agent-os" --include="*.sh" --include="*.yml" --include="*.yaml" .
grep -r "\.claude" --include="*.sh" --include="*.yml" --include="*.yaml" .
find . -maxdepth 2 -type l -exec ls -la {} \;
Step 5: Plan Consolidation
Create a migration plan based on analysis.
Migration Checklist:
Common Hidden Folders Reference
Based on actual cleanup sessions, this table provides verified recommendations.
| Folder | Purpose | Action | Notes |
|---|
.claude/ | Claude Code configuration, agents, skills, docs | KEEP | Authoritative for AI tools |
.claude-flow/ | Runtime data, state, coordination | KEEP | Add to .gitignore |
.githooks/ | Git hooks | KEEP | Standard location |
.github/ | GitHub workflows, templates | KEEP | Required by GitHub |
.git/ | Git repository data | NEVER TOUCH | - |
.gitignore | Git ignore patterns | KEEP | Update as needed |
.vscode/ | VS Code settings | KEEP | Team settings if tracked |
.idea/ | JetBrains IDE settings | KEEP | Or add to .gitignore |
.env | Environment variables | KEEP | Must be in .gitignore |
.agent-os/ | Legacy agent OS configuration | CONSOLIDATE | Merge into .claude/ |
.ai/ | Legacy AI configuration | CONSOLIDATE | Merge into .claude/ |
.drcode/ | External tool (Dr. Code) config | DELETE | Legacy AI config, confirmed deletable |
.slash-commands/ | Command registry | CONSOLIDATE | Move to .claude/docs/commands/ |
.git-commands/ | Git helper scripts | CONSOLIDATE |
Related Directory Patterns
Some non-hidden directories follow similar cleanup/consolidation patterns.
specs/archive/
Standard location for completed specification plans.
mkdir -p specs/archive
git mv specs/modules/<completed-plan>.md specs/archive/
benchmarks/
Benchmark directories typically contain mixed content requiring separation.
| Subdirectory | Content | Action |
|---|
legacy_projects/ | Reference test data (*.dat, *.csv) | Move to tests/fixtures/ |
reports/ | Timestamped HTML reports | Add to .gitignore |
results/ | Timestamped CSV/JSON | Add to .gitignore |
Root *.py files | Benchmark scripts | Keep tracked |
mkdir -p tests/fixtures/orcaflex
git mv benchmarks/legacy_projects/* tests/fixtures/orcaflex/
git rm -r --cached benchmarks/reports benchmarks/results
echo "benchmarks/reports/" >> .gitignore
echo "benchmarks/results/" >> .gitignore
Consolidation Commands
Migrate .agent-os to .claude
cp -r .agent-os .agent-os.backup
mkdir -p .claude/agents
cp -r .agent-os/agents/* .claude/agents/ 2>/dev/null
mkdir -p .claude/standards
cp -r .agent-os/standards/* .claude/standards/ 2>/dev/null
git rm -r --cached .agent-os/ 2>/dev/null
git add .claude/
rm -rf .agent-os
rm -rf .agent-os.backup
Migrate .ai to .claude
cp -r .ai .ai.backup
mkdir -p .claude/skills/prompts
cp -r .ai/prompts/* .claude/skills/prompts/ 2>/dev/null
cp .ai/config.* .claude/ 2>/dev/null
git rm -r --cached .ai/ 2>/dev/null
rm -rf .ai
Clean Dead Symlinks
find . -maxdepth 2 -type l ! -exec test -e {} \; -print
find . -maxdepth 2 -type l ! -exec test -e {} \; -delete
rm -rf .agent-runtime
Consolidate Runtime Directories
mkdir -p .claude-flow/state
mkdir -p .claude-flow/cache
mkdir -p .claude-flow/logs
mv .coordination/* .claude-flow/state/ 2>/dev/null
mv .session/* .claude-flow/state/ 2>/dev/null
rm -rf .coordination .session
Update .gitignore
Add these patterns after consolidation:
# Runtime and state (not tracked)
.claude-flow/
.coordination/
.session/
# Legacy folders (prevent re-creation)
.agent-os/
.ai/
.agent-runtime/
# Cache directories
.pytest_cache/
.ruff_cache/
.mypy_cache/
__pycache__/
Audit Checklist
Pre-Audit
Discovery Phase
Analysis Phase
Planning Phase
Execution Phase
Verification Phase
Documentation Phase
Verification Commands
Use these commands to verify the final state after audit and cleanup.
Verify Hidden Folder State
echo "=== Remaining Hidden Folders ==="
find . -maxdepth 1 -type d -name ".*" ! -name ".git" | sort
echo "=== Checking for Legacy Folders ==="
for dir in .agent-os .ai .drcode .slash-commands .git-commands .benchmarks .agent-runtime .common .specify; do
if [ -d "$dir" ]; then
echo "WARNING: $dir still exists!"
fi
done
echo "Check complete."
Verify Consolidation Targets
echo "=== .claude/ Structure ==="
ls -la .claude/
echo "=== scripts/git/ ==="
ls -la scripts/git/ 2>/dev/null || echo "scripts/git/ does not exist"
echo "=== .claude/docs/commands/ ==="
ls -la .claude/docs/commands/ 2>/dev/null || echo ".claude/docs/commands/ does not exist"
echo "=== specs/archive/ ==="
ls -la specs/archive/ 2>/dev/null || echo "specs/archive/ does not exist"
echo "=== benchmarks/ Structure ==="
ls -la benchmarks/ 2>/dev/null || echo "benchmarks/ does not exist"
if [ -d "benchmarks/legacy_projects" ]; then
echo "[WARN] benchmarks/legacy_projects/ should be moved to tests/fixtures/"
fi
Verify Git Status
echo "=== Untracked Hidden Folders ==="
git status --porcelain | grep "^??" | grep "^\./\." || echo "None found"
echo "=== .gitignore Hidden Folder Entries ==="
grep -E "^\.(claude-flow|coordination|session)" .gitignore || echo "No runtime folders in .gitignore"
echo "=== .claude/ Tracked Files ==="
git ls-files .claude/ | wc -l
Final State Checklist
echo "=== Final State Verification ==="
hidden_count=$(find . -maxdepth 1 -type d -name ".*" ! -name ".git" ! -name ".claude" ! -name ".claude-flow" ! -name ".github" ! -name ".githooks" ! -name ".vscode" | wc -l)
if [ "$hidden_count" -eq 0 ]; then
echo "[OK] No unexpected hidden folders"
else
echo "[WARN] $hidden_count unexpected hidden folders found"
fi
legacy_count=0
for dir in .agent-os .ai .drcode .slash-commands .git-commands .benchmarks; do
[ -d "$dir" ] && legacy_count=$((legacy_count + 1))
done
if [ "$legacy_count" -eq 0 ]; then
echo "[OK] All legacy folders removed"
else
echo "[WARN] $legacy_count legacy folders remain"
fi
for subdir in agents docs skills; do
if [ -d ];
git diff --quiet 2>/dev/null;
Best Practices
- Always backup before deleting - Create a backup branch or copy
- Use git rm for tracked folders - Preserves history
- Check symlink targets before deleting - May need to update references
- Update .gitignore first - Prevents accidental re-tracking
- Test after consolidation - Ensure nothing broke
- Commit in logical chunks - Separate migration from cleanup
- Document the changes - Future maintainers will thank you
Related Skills
References
Version History
- 1.2.0 (2026-01-20): Added Related Directory Patterns section
- Added benchmarks/ entry to reference table (SPLIT action)
- Added Related Directory Patterns section for non-hidden directories
- Added specs/archive/ as standard location for completed plans
- Added benchmarks/ separation pattern (fixtures vs generated outputs)
- Updated verification commands for new patterns
- 1.1.0 (2026-01-20): Updated reference table and added verification commands
- Updated Common Hidden Folders Reference table with verified recommendations
- Added .drcode/ as DELETE (confirmed legacy AI config)
- Added .slash-commands/ as CONSOLIDATE to .claude/docs/commands/
- Added .git-commands/ as CONSOLIDATE to scripts/git/
- Added .benchmarks/ as DELETE (usually empty)
- Added .githooks/ as KEEP (standard location)
- Added Verification Commands section with:
- Verify Hidden Folder State commands
- Verify Consolidation Targets commands
- Verify Git Status commands
- Final State Checklist script
- Added Notes column to reference table for additional context
- 1.0.0 (2025-01-20): Initial release based on digitalmodel repository hidden folder audit session