Skip to content

auggie --version hangs (100% CPU) when ~/.claude/skills contains a large skill tree -- discovery runs even for --version #178

Open

Description

@wangpfcn

Environment

  • auggie 0.36.0 (commit 7c61e5bb), installed via npm install -g @augmentcode/auggie
  • Windows 11 Home 10.0.26200, Node v24.20.0
  • Fresh install, not logged in, no ~/.auggie directory

Symptom

Every auggie invocation — including auggie --version — hangs indefinitely with one core saturated (~70% CPU) and produces no output.

Repro

  1. Have a data-dense skill under ~/.claude/skills/: its references/ subtree contains ~40,000 directories and ~36,000 .md files (an EDB indicator dictionary exported as markdown; total entries under ~/.claude/skills: ~79,700).
  2. Run auggie --version → hangs, no output ever.
  3. Control experiment: point both CWD and USERPROFILE at an empty directory → auggie --version returns instantly (0.36.0 (commit 7c61e5bb)).

Diagnosis (via node --inspect + CDP)

Paused the hung process 5 s in and captured the JS stack:

hasFrontmatter            (frontmatter parse)
<recursive dir-walk fn>   x8 levels
...
registerDiscoveredCommands
registerCommands

The innermost frames were walking ~/.claude/skills/<data-heavy-skill>/references/.... CPU delta over a 5 s window while hung: ~3,438 ms — busy scanning, not blocked on I/O.

Root causes as I read them from the bundle:

  1. Command/skill discovery runs unconditionally during CLI setup — even --version / --help pay for it before commander can answer.
  2. The walk is fully synchronous (readdirSync + lstatSync per entry), recursive, with no entry cap or depth limit. It only skips entries whose name starts with ..
  3. Every .md in the tree is read and frontmatter-parsed during discovery, so a skill that legitimately ships a large references/ data tree makes startup cost unbounded.
  4. Symlinks/junctions are followed (only "plugin"-source scans skip them). On Windows, legacy compatibility junctions such as AppData\Local\Application Data point at their own parent directory — beyond the volume problem this is a potential infinite-recursion hazard.

Suggestions

  • Short-circuit --version / --help before any discovery work.
  • During discovery, parse command/skill candidates only at defined locations (skill root SKILL.md, commands/ directories) rather than every .md anywhere in the tree.
  • Add an entry/depth cap, or move discovery off the startup critical path (lazy/async, cached).
  • On Windows, skip entries with hidden/system attributes and avoid following junction cycles.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions