Layer 1: Main Context — The Problem Skills Solve
~12 min read
Skills exist to fix a specific problem: LLMs forget everything unless instructions are restated each time. Layer 1, Main Context, is the always-loaded foundation everything else builds on.
Before naming Layer 1 specifically, it's worth understanding the problem this course frames Claude Skills as solving. Claude Skills are Anthropic's mechanism for giving agents reusable, persistent abilities without overloading the model's context window. They solve a practical issue in agent design: LLMs forget everything unless all instructions, examples and edge cases are restated each time. Without some system for this, every single conversation would need to re-explain every workflow the agent should know, burning enormous amounts of context on repetition rather than the actual task at hand.
Skills package this information into small, self-contained units that Claude loads only when they're relevant. This allows an agent to use hundreds of specialized workflows while keeping its active context lightweight. To make this scalable, Skills use a three-layer context management system that lets it use 100s of skills without hitting context limits — this is the system this topic covers, one layer per subtopic.
Layer 1, per this course, is Main Context: Always loaded, it contains the project configuration. This is the foundation layer — unlike the other two layers (covered in the next two subtopics), which load conditionally based on relevance, Main Context is present in EVERY interaction, regardless of which skills might get activated later in the conversation. Think of it as the baseline 'operating environment' the agent always has available: project-level settings, general behavior configuration, and whatever context defines the overall workspace the agent is operating within — the stable ground floor that the conditionally-loaded layers get built on top of.
Why does this layer need to be always-loaded rather than conditional, like the other two? Because project configuration is relevant to EVERY task the agent might perform, not just specific specialized workflows — there's no way to predict in advance which skill (if any) a given user request will need, but the project's baseline configuration is relevant regardless of which skill eventually gets activated, or whether any skill gets activated at all. This is the architectural insight the rest of the 3-layer system builds on: separate what's UNIVERSALLY needed (Main Context) from what's CONDITIONALLY needed (the next two layers), and only pay the context-window cost for the conditional parts when they're actually relevant.
💻 Code example
# Modeling Layer 1 (Main Context) as the ALWAYS-LOADED foundation,
# distinct from the conditionally-loaded layers covered in the next
# two subtopics -- illustrating why it can't be made conditional.
class AgentSession:
def __init__(self, project_config: dict):
# Layer 1: Main Context -- loaded ONCE, present for the entire session,
# regardless of which (if any) skills get activated later
self.main_context = project_config
self.active_skills: list[str] = [] # populated conditionally (Layer 2/3)
def current_context_tokens(self, skill_metadata_tokens: int = 0,
active_skill_tokens: int = 0) -> int:
"""Main Context's token cost is FIXED and unavoidable every turn --
the other layers are what actually scale with skill usage."""
main_context_tokens = len(str(self.main_context))
return main_context_tokens + skill_metadata_tokens + active_skill_tokens
project_config = {
"project_name": "CustomerSupportBot",
"default_tone": "professional, concise",
"escalation_policy": "route to human after 2 failed resolution attempts",
}
session = AgentSession(project_config)
print("Layer 1 (Main Context), always loaded:")
print(session.main_context)
print(f"\nBaseline context cost (no skills active yet): "
f"{session.current_context_tokens()} chars")
💬 Deep Dive with AI
Key points
- •Claude Skills solve a specific problem: LLMs forget everything unless instructions/examples/edge cases are restated every time
- •Skills package reusable workflow information into small, self-contained units loaded only when relevant, keeping active context lightweight
- •Layer 1, Main Context, is always loaded and contains the project configuration — present in every interaction regardless of which skills activate later
- •Unlike Layers 2 and 3 (next subtopics), which load conditionally, Layer 1 is universal — relevant to every task, not just specialized workflows
- •This separation (universal vs. conditional) is the core architectural insight behind the whole 3-layer system: only pay context cost for conditional parts when they're actually needed