Architecting an Agentic Operating System: Implementing Hierarchical Context Injection via Claude Desktop
The current paradigm of interacting with Large Language Models (LLMs) is largely conversational and stateless. Users provide a prompt, and the model provides a response. However, for professional workflows, this "chat-centric" approach fails to scale. To achieve high-fidelity, repeatable outputs, we must move away from simple prompting and toward the construction of an Agentic Operating System (Agentic OS).
An Agentic OS is a structured environment where context is not merely provided in a prompt, but is architected into a persistent, hierarchical file system. By leveraging the Claude Desktop application—specifically utilizing both the Cowork and Code views—we can implement a system of "context injection" that ensures the model operates with the precise brand voice, visual identity, and operational rules required for any given task.
The Core Architecture: Global Instructions and State Management
The foundation of the Agentic OS lies in the root directory. This directory contains the global configuration files that govern the behavior of the model across all subsequent sub-directories and workstations.
1. The claude.md Instruction Manual
The claude.md file serves as the system prompt for the entire ecosystem. Because this file is loaded into every conversation within the directory, it acts as the "instruction manual" for the model's persona and operational constraints.
A robust claude.md should define:
- Communication Protocols: Instructions on tone (e.g., "be succinct," "provide a single best recommendation").
- Operational Constraints: Rules regarding error handling (e.g., "flag when information is missing") and task execution (e.g., "ask clarifying questions on complex tasks"). ually.
- Routing Logic: A "routing map" that instructs the model on how to navigate between different workstations (e.g., Finance, Ops, or Content).
2. The memory.md State Store
To mitigate the stateless nature of LLM sessions, we implement a memory.md file. This acts as a persistent, short-term memory store. By instructing the model to write significant decisions, project updates, or contact information to this file, we create a "write-ahead log" of sorts. This allows the model to maintain continuity across different sessions, provided the file is re-read at the start of new interactions.
Contextualizing Identity: The Brand Context Layer
A primary failure point in AI-generated content is the "generic" tone. To solve this, we implement a brand_context folder containing three critical Markdown-based resources:
- Voice Profile (
voice_profile.md): A multidimensional analysis of linguistic patterns. This file should include extracted patterns across dimensions such as syntax, vocabulary, and rhythm, often derived from analyzing previous writing samples (LinkedIn posts, newsletters, etc.). - ICP and Positioning (
icp_positioning.md): A strategic document defining the Ideal Customer Profile (ICP), market positioning, and "anti-positioning" (what the brand stands against). - Visual Identity (
design_tokens.md): A technical specification of the brand's visual language, including hex codes for color palettes, font hierarchies, and rules for asset generation.
The "Skills" Framework: Automating Workflows via Process Documents
The most powerful component of this architecture is the implementation of Skills. In this context, a "Skill" is a specialized Markdown-based process document designed to automate a specific, repeatable task.
Unlike a simple prompt, a Skill is an agentic workflow. It follows a structured, multi-step execution plan. For example, a voice_profile_builder skill would follow a deterministic path:
- Step 1: Data ingestion (collecting writing samples).
- Step 2: Feature extraction (identifying linguistic patterns).
- Step 3: Verification (confirming the extracted patterns with the user).
- Step 4: File serialization (writing the final
.mdprofile to thebrand_contextfolder).
By treating skills as modular, plug-and-play components, you can expand the capabilities of your Agentic OS without rewriting your global instructions.
Scaling via Workstations and Hierarchical Inheritance
To manage complexity, the system utilizes a hierarchical folder structure. We implement Workstations—specialized sub-directories (e.g., /workstations/content or /workstations/finance)—that inherit properties from the root directory but maintain their own localized context.
The Principle of Inheritance
The architecture relies on a "top-down" flow of information:
- Global Level:
claude.md(Global rules) $\rightarrow$memory.md(Global memory). - Workstation Level:
claude.md(Specific task rules, e.g., "no em-dashes") $\rightarrow$memory.md(Task-specific decisions). - Client Level: (For agencies) Specific brand context and project folders.
This hierarchy allows for "context injection at the right time." When working in the content workstation, the model inherits the global brand voice but applies specific formatting rules unique to content production.
Technical Implementation: Code View vs. Cowork View
A critical technical nuance involves the distinction between the Cowork and Code views in the Claude Desktop app.
The Cowork view is optimized for a streamlined UI but has limitations regarding directory traversal. It may struggle to inherit brand_context from a parent directory when the active working directory is set to a deep sub-folder (e.g., /workstations/content).
The Code view, however, provides a superior interface for complex architecture. It allows the model to traverse the file tree upward, enabling it to access the root brand_context even when operating within a nested workstation. For any professional-grade implementation involving deep folder hierarchies, the Code view is the required interface for maintaining context integrity.
Conclusion: The Path to Production-Ready AI
Building an Agentic OS is an iterative process of increasing the density and accuracy of the injected context. While the structure we have built—comprising claude.md, memory.md, skills, and workstations—provides a robust framework, the ultimate goal is the continuous refinement of the Skills layer. By codifying your unique business processes into Markdown-based skills, you transform Claude from a general-purpose assistant into a specialized, production-ready agent capable of executing complex, high-fidelity workflows with minimal human intervention.