Skip to content

[FEATURE] Add "Avoid Symlinks" to AI-Friendly Repo Recommendations #361

@jwm4

Description

@jwm4

Proposal: Add "Avoid Symlinks" Check and Remove Symlink Recommendations

Description

Add a new assessor that flags symbolic links to mutable source files within repositories intended for AI coding agents. Additionally, update existing AgentReady guidance and internals that currently recommend or use symlinks.

The Problem

Current-generation AI agents frequently fail to distinguish between a file and a symlink. This leads to several failure modes that can cause data loss or incorrect file states:

  1. Destructive Overwrites: Agents may write through a symlink without recognizing it, replacing the contents of the underlying target file. This is especially dangerous for configuration files like .env that may symlink to external secret stores.
  2. Read/Write Asymmetry: Agents can often write to a file via a symlink (as the OS resolves the path), but then fail to read it back (because the agent's file-indexing tool sees the path as a link and skips it). This causes the agent to think the file is empty or missing and overwrite it.
  3. Security Bypass: Symlinks can be used to bypass agent permission controls. CVE-2026-25724 demonstrated that Claude Code's deny rules could be circumvented via symlinks because access control evaluated literal paths rather than resolved canonical paths.
  4. Platform Incompatibility: On Windows with Git's default core.symlinks=false, symlinks become plain-text stub files containing paths. Agents parse these stubs as literal content, causing YAML/config parsing failures.

Supporting Evidence

Scope

This issue covers three changes:

1. New symlink_usage assessor

  • Rule: Flag symlinks to mutable source files within the repository.
  • Exception: Symlinks for static/read-only dependencies are acceptable only if those paths are excluded from AI indexing (e.g., via .gitignore, .cursorignore).
  • Alternative guidance: Use a flat directory structure, explicit copy scripts (e.g., a pre-commit hook), or tool-specific reference mechanisms (e.g., @ references in CLAUDE.md).
  • Tier: TBD — likely Tier 2 or Tier 3 given the direct impact on agent reliability.

2. Update CLAUDEmdAssessor to stop recommending symlinks

The current CLAUDEmdAssessor (assessors/documentation.py) recommends CLAUDE.md as a symlink to AGENTS.md and gives it a full score. This should be changed to:

  • Prefer @ references or direct files over symlinks
  • Continue to accept symlinks (don't penalize existing repos that use them) but stop recommending them in remediation guidance
  • Update remediation text to remove "Option 2: symlink CLAUDE.md to AGENTS.md"

3. Replace AgentReady's internal use of symlinks

AgentReady creates *-latest symlinks for reports (cli/main.py, cli/harbor.py). These should be replaced with an alternative mechanism (e.g., direct copies, or a latest text file containing the path).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions