Skip to content

File walker skips dot-prefixed paths even when extractor is registered (.mcp.json, .claude/settings.json, etc.) #873

Description

@mattmillartech

Summary

Following the v8 / 0.8.1 release that added bash + JSON extractors (#866 — thank you!), the parsers work great for non-dot paths but dot-prefixed paths are still skipped by the file walker even when the relevant extractor is registered in _DISPATCH.

This leaves a real gap for the AI-coding-tool use case: dotfile config (.claude/settings.json, .mcp.json, .github/workflows/*.yml, .devcontainer/*.json) is where the agent operating environment actually lives, but it's invisible to graphify.

Reproduction

Against a repo with .mcp.json in the root + .claude/settings.json:

# Parsers are registered (confirmed):
python -c "from graphify.extract import _DISPATCH; print('.json' in _DISPATCH, '.sh' in _DISPATCH)"
# True True

graphify update . --force

# Non-dot JSONs land in the graph (good):
graphify explain "package.json"      # ✓ Node found
graphify explain "tsconfig.json"     # ✓ Node found
graphify explain "firebase.json"     # ✓ Node found

# Dot-prefixed JSONs are missing:
graphify explain ".mcp.json"         # "No node matching '.mcp.json' found"
jq -r '.nodes[] | select(.source_file == ".mcp.json") | .label' graphify-out/graph.json
# (empty)
jq -r '.nodes[] | select(.source_file | startswith(".claude/"))' graphify-out/graph.json
# (empty)

The walker also skips .sh scripts under dot-dirs by the same rule (e.g., .devcontainer/postCreate.sh).

Why it matters

For AI-coding-agent users (Claude Code, Cursor, Codex, etc.), the operational surface — what governs the agent's behavior, MCP wiring, hook execution — is almost entirely in dotfile paths:

  • .claude/settings.json — hook registration, MCP servers, permissions
  • .mcp.json — MCP server defs
  • .cursor/rules/*
  • .github/workflows/*.yml
  • .devcontainer/devcontainer.json
  • .aider.conf.yml / .aiderignore

Without these in the graph, the most valuable cross-reference queries — "what hook fires on PreToolUse for Edit", "what MCP server does the graphify tool depend on" — fall through to manual grep.

Proposed fix

Add an opt-in flag (default: still skip, for backward compat) that includes dotfile paths in the walk. A few options, in increasing scope:

  1. CLI flag: graphify update . --include-hidden / --include-dotfiles. Simplest; user opts in per-build.
  2. Config in .graphifyignore: support a leading ! to override defaults (gitignore-style). e.g.:
    !.claude/
    !.mcp.json
    !.devcontainer/
    
  3. Always include if the file matches _DISPATCH: the walker's current "skip dotfiles" rule could be relaxed when the file has a registered extractor — since the parser was explicitly added, presumably the user wants those files indexed.

Option 3 is the most ergonomic (no flag needed; "if you installed the extractor, files of that type get indexed regardless of path"). Option 1 is the safest. Option 2 is the most flexible.

Workaround (not great)

Symlink the dotfile from a non-dot path before graphify update:

ln -sf .mcp.json mcp.json
ln -sf .claude/settings.json claude-settings.json
graphify update .

Fragile — breaks if anyone runs lint or git status. Wouldn't ship this in prod.

Context

Continuing the work from #866 (thank you again for the fast turnaround on bash + JSON). The 6-layer agent intelligence stack I'm building uses graphify as the structured-query layer for operating-environment questions; #866 closed ~95% of that gap. This issue is the remaining 5% — the dotfile paths where the OS-level config lives.

Happy to contribute the PR if option 1 (CLI flag) is the right scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions