Skip to content

Instantly share code, notes, and snippets.

@icorderi
Last active August 31, 2025 04:07
Show Gist options
  • Select an option

  • Save icorderi/518af8e8e610aced2189ad7025fafd65 to your computer and use it in GitHub Desktop.

Select an option

Save icorderi/518af8e8e610aced2189ad7025fafd65 to your computer and use it in GitHub Desktop.
Claude Code instructions to have it workaround a bug with `@` mentions where additional CLAUDE.md along with file path are not loaded.

⚠️ CRITICAL SYSTEM WORKAROUND - ALWAYS FOLLOW ⚠️

Force CLAUDE.md Context Loading

🚨 MANDATORY BEHAVIOR - NO EXCEPTIONS 🚨

ALWAYS when the user mentions ANY file with @ syntax (e.g., @path/to/example.md), you MUST IMMEDIATELY call the Read tool on that same file path. This is not optional - it's a critical system requirement.

❌ NEVER DO THIS:

  • Respond to @ mentions without calling Read tool first
  • Skip the manual Read call because you "already have the content"
  • Assume @ mentions provide complete context

✅ ALWAYS DO THIS:

  1. User mentions @path/to/example.js
  2. IMMEDIATELY call Read tool with that exact path
  3. THEN respond to the user

Why This Is Critical

  • @ mentions provide file content but ZERO CLAUDE.md context
  • Manual Read tool calls load ALL relevant CLAUDE.md files from directory hierarchy
  • WITHOUT THIS: You miss project guidelines, patterns, tech stack info, and critical instructions
  • WITH THIS: You have complete context including path/CLAUDE.md, path/to/CLAUDE.md, etc.

STOP AND CHECK Before Every Response

When you see @filename in user message:

□ Have I called Read tool on this file path? □ Do I now have CLAUDE.md context loaded? □ Am I following project-specific guidelines?

If ANY answer is NO - call Read tool immediately.

Detailed Example

User says: "Look at @path/to/example/file.ts"

STEP 1: You see file content from @ mention STEP 2: MANDATORY - Call Read tool:

Read("/full/path/to/example/file.ts")

STEP 3: System loads path/CLAUDE.md and path/to/CLAUDE.md context STEP 4: Now respond with full project context

Failure Consequences

If you ignore this instruction:

  • You'll miss any further guidelines intended to be applied
  • You'll likely provide incorrect or incomplete solutions
  • You'll likely violate project coding standards

Remember: This Fixes A Bug

This workaround exists because @ mentions have a system limitation. Following this instruction is not optional - it's fixing broken behavior.

🚨 CRITICAL: @ MENTION HANDLING 🚨

When ANY file is mentioned with @ syntax, you MUST IMMEDIATELY call Read tool on that file BEFORE responding. You will see automatic loads of any @ mentioned filed, this is NOT ENOUGH, it only loads the file contents. You MUST perform Read tool calls on the files directly, even if they were @ included. This is NOT optional - it loads required CLAUDE.md context. along the file path. See @docs/force-claude-reads.md for details.


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