Skip to the content.

Cross-Agent Context Discovery

AI coding agents discover project context through well-known files at session startup. Each agent has its own conventions, creating compatibility gaps in multi-agent projects. This analysis distills the interoperability landscape and proven bridging patterns.

The Two Context Layers

Every agent loads two types of context:

  1. Guardrail files — project instructions, coding rules, conventions
  2. Skill directories — loadable capabilities with structured metadata

Cross-Agent Compatibility Matrix

Guardrail File Discovery

File Native To Goose Claude Code Hermes Cursor Copilot
AGENTS.md AgentFS
CLAUDE.md Claude Code ⚙️
.cursorrules Cursor
.windsurfrules Windsurf
.github/copilot-instructions.md Copilot

⚙️ = configurable (add to CONTEXT_FILE_NAMES in Goose config)

Skill Directory Discovery

Directory Goose Claude Code Hermes
.agents/skills/ ⚙️
.claude/skills/
~/.agents/skills/ ⚙️
~/.claude/skills/

⚙️ = configurable via skills.external_dirs in Hermes

Key Finding: Goose Has Native .claude/ Support

Goose (v1.41+) already scans .claude/skills/, .claude/agents/, and ~/.claude/skills/ natively — no configuration needed. The only gap is that CLAUDE.md is not in the default context file list, but it can be added via config.

Gap Summary

Only two high-value gaps remain after native support is accounted for:

Gap Direction Impact Solution
Claude Code ignores AGENTS.md AgentFS → Claude High Generate CLAUDE.md shim with @AGENTS.md import
Goose doesn’t auto-load CLAUDE.md Claude → Goose Medium Add to CONTEXT_FILE_NAMES config, or use AGENTS.md cross-discovery instruction

Bridging Pattern: Cross-Agent Discovery Section

The most effective bridge is a declarative instruction in AGENTS.md that tells LLM-based agents to discover and load other agents’ context files. This works because agents that read AGENTS.md will follow the instruction — no code changes needed:

### Cross-Agent Context Discovery
When starting a session, check for and read these files if they exist:
| File | Purpose |
|------|--------|
| `CLAUDE.md` | Claude Code project instructions |
| `.cursorrules` | Cursor coding rules |
| `.github/copilot-instructions.md` | GitHub Copilot instructions |

Bridging Pattern: CLAUDE.md Shim

For Claude Code compatibility, generate a minimal CLAUDE.md at the project root that imports AGENTS.md:

<!-- Auto-generated by AgentFS -->
@AGENTS.md

Claude Code’s @file import syntax inlines the full content, creating a zero-maintenance bridge.

Bridging Pattern: Goose Config for CLAUDE.md

Add CLAUDE.md to Goose’s auto-loaded context files:

# ~/.config/goose/config.yaml
CONTEXT_FILE_NAMES:
  - .goosehints
  - AGENTS.md
  - CLAUDE.md

Design Principle

Single source of truth (AGENTS.md) with lightweight shims. Rather than maintaining parallel context files for each agent, keep all authoritative context in AGENTS.md and generate minimal bridge files that reference it. This prevents drift and reduces maintenance to a single file.