Configuration Files
What Are Configuration Files?
Section titled “What Are Configuration Files?”In the previous lesson, you learned about system prompts: the hidden instructions that shape how an AI behaves. Configuration files take this idea one step further. Instead of typing your system prompt into a text field every time, you save it in a file that the AI reads automatically at the start of every conversation.
Think of a configuration file like a job description pinned to the wall of an office. Every morning when the employee arrives, they read the job description to remind themselves of their responsibilities, their boundaries, and their goals. The employee does not need someone to repeat the instructions every day. The file is always there.
Configuration files are one of the most important concepts in this course because they enable persistent behavior. Without them, your AI agent would start every conversation as a blank slate with no memory of what you have taught it. With them, the agent remembers its role, its rules, and even the mistakes it has learned from in past sessions.
The Key Pattern
Section titled “The Key Pattern”Every AI platform has its own version of a configuration file, but the pattern is the same everywhere:
- You create a text file with instructions.
- You place it in a location the AI knows to look for.
- The AI reads the file at the start of every conversation.
- The instructions in the file shape the AI’s behavior throughout the session.
Let’s look at how this works on each platform.
CLAUDE.md
Section titled “CLAUDE.md”What it is: A Markdown file named CLAUDE.md that contains instructions for Claude Code (the command-line version of Claude) or for Claude in project settings.
Where it goes: Place it in the root of your project folder. Claude Code will automatically find and read it when you start a session in that folder.
What to put in it: Your system prompt, project-specific rules, preferred behaviors, lessons learned, and any context the AI needs.
Example CLAUDE.md:
# Project Instructions
You are an assistant helping to build a personal blog website.
## Role- Act as a friendly web design advisor.- Explain concepts in simple, non-technical language.
## Rules- Always suggest mobile-friendly designs.- Never use dark color schemes. The user prefers light themes.- When suggesting fonts, stick to Google Fonts that support Spanish characters.
## Output Format- Use bullet points for lists of suggestions.- When showing text examples, use blockquotes.
## Lessons Learned- The user prefers a minimalist style (learned 2025-01-15).- Do not suggest WordPress. The user wants a static site (learned 2025-01-20).You can also have a global CLAUDE.md in your home directory (~/.claude/CLAUDE.md) that applies to all projects, and a project-specific one that adds extra rules for a particular project.
AGENTS.md
Section titled “AGENTS.md”What it is: A Markdown file named AGENTS.md used by OpenAI’s Codex and ChatGPT’s agent features.
Where it goes: Place it in the root of your project folder when using Codex, or paste the content into Custom Instructions or Custom GPT instructions.
What to put in it: The same kind of content as CLAUDE.md: role definitions, rules, constraints, output formats, and accumulated knowledge.
Example AGENTS.md:
# Agent Instructions
You are an assistant helping to build a personal blog website.
## Role- Act as a friendly web design advisor.- Explain concepts in simple, non-technical language.
## Rules- Always suggest mobile-friendly designs.- Never use dark color schemes. The user prefers light themes.- When suggesting fonts, stick to Google Fonts that support Spanish characters.
## Output Format- Use bullet points for lists of suggestions.- When showing text examples, use blockquotes.
## Lessons Learned- The user prefers a minimalist style (learned 2025-01-15).- Do not suggest WordPress. The user wants a static site (learned 2025-01-20).For Custom Instructions (available on all plans, including free), go to Settings > Personalization > Custom Instructions and paste your instructions there.
For Custom GPTs (requires a paid plan), you paste these instructions directly into the Configure > Instructions field when building your GPT.
GEMINI.md
Section titled “GEMINI.md”What it is: A Markdown file named GEMINI.md used by Google’s AI tools and Gemini-based workflows.
Where it goes: Place it in the root of your project folder when using Google’s developer tools, paste it at the start of a conversation, or paste the content into the instructions field when creating a Gem (requires Gemini Advanced).
What to put in it: Role definitions, rules, tone guidelines, output format preferences, and context about the project.
Example GEMINI.md:
# Agent Instructions
You are an assistant helping to build a personal blog website.
## Role- Act as a friendly web design advisor.- Explain concepts in simple, non-technical language.
## Rules- Always suggest mobile-friendly designs.- Never use dark color schemes. The user prefers light themes.- When suggesting fonts, stick to Google Fonts that support Spanish characters.
## Output Format- Use bullet points for lists of suggestions.- When showing text examples, use blockquotes.
## Lessons Learned- The user prefers a minimalist style (learned 2025-01-15).- Do not suggest WordPress. The user wants a static site (learned 2025-01-20).For Gems (requires Gemini Advanced), you paste these instructions into the Instructions field in the Gem manager. Free users can paste the content at the start of each conversation.
Modelfile
Section titled “Modelfile”What it is: A file called Modelfile (no extension) that defines a custom Ollama model with built-in system instructions.
Where it goes: Anywhere on your computer. You reference it when you create the custom model.
What to put in it: A FROM line specifying the base model, followed by a SYSTEM block with your instructions.
Example Modelfile:
FROM llama3
SYSTEM """You are an assistant helping to build a personal blog website.
Role:- Act as a friendly web design advisor.- Explain concepts in simple, non-technical language.
Rules:- Always suggest mobile-friendly designs.- Never use dark color schemes. The user prefers light themes.- When suggesting fonts, stick to Google Fonts that support Spanish characters.
Output Format:- Use bullet points for lists of suggestions.- When showing text examples, use blockquotes.
Lessons Learned:- The user prefers a minimalist style (learned 2025-01-15).- Do not suggest WordPress. The user wants a static site (learned 2025-01-20)."""After creating this file, build your custom model:
ollama create blog-assistant -f Modelfileollama run blog-assistantNow every time you run blog-assistant, it starts with these instructions built in.
System Prompt Presets
Section titled “System Prompt Presets”What it is: LM Studio allows you to save system prompts as presets that you can load before starting a conversation.
Where it goes: LM Studio stores presets internally, but you can also keep your system prompt text in a .md file for backup and version control.
What to put in it: The same role, rules, tone, and format instructions as any other platform.
How to set it up:
- Open LM Studio and load your preferred model.
- Go to the Chat tab.
- In the System Prompt text area at the top, paste your instructions.
- Use the preset save feature to save this configuration for future sessions.
Example system prompt for LM Studio:
You are an assistant helping to build a personal blog website.
Role:- Act as a friendly web design advisor.- Explain concepts in simple, non-technical language.
Rules:- Always suggest mobile-friendly designs.- Never use dark color schemes. The user prefers light themes.- When suggesting fonts, stick to Google Fonts that support Spanish characters.
Output Format:- Use bullet points for lists of suggestions.- When showing text examples, use blockquotes.
Lessons Learned:- The user prefers a minimalist style (learned 2025-01-15).- Do not suggest WordPress. The user wants a static site (learned 2025-01-20).Since LM Studio runs locally, your system prompt stays on your computer and is never sent to any external server.
The Pattern to Remember
Section titled “The Pattern to Remember”No matter which platform you use, the underlying pattern is identical:
- Write your instructions in a structured format (role, rules, format, lessons).
- Save them in the place your platform expects (a file, a settings field, a Modelfile).
- The AI reads them automatically at the start of every session.
- Your agent behaves consistently because it always has the same foundation.
This is what separates a one-off chatbot conversation from a true AI agent. An agent has persistent instructions that carry over from session to session. Configuration files make that possible.
Key Takeaways
Section titled “Key Takeaways”- Configuration files store your system prompt in a file that the AI reads at the start of every conversation.
- Each platform has its own format:
CLAUDE.mdfor Claude,AGENTS.mdfor ChatGPT/Codex,GEMINI.mdfor Gemini,Modelfilefor Ollama, and system prompt presets for LM Studio. - The pattern is universal: write instructions, save them, and the AI reads them automatically.
- Configuration files enable persistent agent behavior across sessions. Your agent does not forget its role or rules.
- Start with a simple file and add to it over time as you learn what your agent needs.