Problem
The methodologies described in the “Inside Claude’s Cognition” series (and our continuation of it) rely on a Tier 1 memory file, like CLAUDE.md or GEMINI.md.
This creates a problem:
- A developer using Claude Code has a
CLAUDE.mdfile. - A developer using the Gemini CLI has a
GEMINI.mdfile. - A future tool might use
COPILOT.mdor another variant.
This leads to context fragmentation. The “single source of truth” for the project’s core context is split across multiple files, requiring manual synchronization and risking drift. The methodology becomes locked into specific tools, which is the opposite of the portable principles we want to establish.
Proposed Solution: A Simple Compatibility Layer
We can solve this with a simple, tool-agnostic build step.
-
A Single Source of Truth: Create one canonical context file in the project root. Let’s call it
AI.md. This file will hold the definitive Tier 1 context for the project, regardless of the tool being used. -
A Build Script: Create a simple script (e.g., a
Makefile, apackage.jsonscript, or a shell script namedaicontext.sh) that generates the tool-specific files fromAI.md.
Example: Using a Makefile
# Makefile
.PHONY: all claude gemini clean
# Default target
all: claude gemini
# Create CLAUDE.md
claude:
@echo "Generating CLAUDE.md from AI.md..."
@cp AI.md CLAUDE.md
# Create GEMINI.md
gemini:
@echo "Generating GEMINI.md from AI.md..."
@cp AI.md GEMINI.md
# Remove generated files
clean:
@rm -f CLAUDE.md GEMINI.md
Example Workflow
A developer joining the project would:
- Clone the repository.
- Run
make(ormake claudeif they only use Claude Code). - The appropriate context file (
CLAUDE.md) is created for them.
When the project’s core context needs to be updated, the change is made only to AI.md. Then, running make regenerates the tool-specific files, ensuring everyone is synchronized.
The generated files (CLAUDE.md, GEMINI.md) should be added to .gitignore to prevent them from being checked into source control, reinforcing AI.md as the single source of truth.
Benefits
- Tool-Agnostic: The project’s core principles are no longer tied to a filename.
- Single Source of Truth: Eliminates context drift and manual copy-pasting.
- Extensible: Adding support for a new tool is as simple as adding a new target to the script.
- Simple: Uses standard, ubiquitous tools like
makeor shell scripts, requiring no complex dependencies.
Future Enhancements
The compatibility layer could be made more intelligent. If different AI tools evolve to prefer slightly different syntax or directives within their context files, the script could handle this transformation.
For example, it could use sed or a simple script to replace [GEMINI_DIRECTIVE] with [CLAUDE_DIRECTIVE] during the build step, allowing for even deeper interoperability.