AI Agent Preset Modes Explained: Architecture, Constraints, and Engineering Trade-offs

    This article breaks down the preset mode mechanism used by coding agents, explaining what a preset actually is (a directory plus a declarative assembly file), why modes lock once a session produces output, and how shared mounting with per-session state isolation enables concurrent modes. It compares the four presets—standard, code, minimal, and cordis—across capability radius and controllability, dissects the standard mode's assembly logic, and closes with practical guidance on mode selection, least-privilege tooling, and configuration as code.

    1. Why an Abstraction Called “Mode” Is Needed

    When building a coding agent, a common engineering dilemma is that a single runtime must serve both lightweight scenarios—users who just want to change one line of code—and heavy scenarios that require autonomous planning, sub-agent invocation, and long-running flows. If prompts, tool allowlists, and context compaction strategies are all hardcoded into the main loop, the system quickly degrades into a pile of conditional branches that are hard to maintain and cannot let different sessions run with different capability sets in parallel.

    The more mature approach in the industry is to extract “the set of session capabilities” into something declarative and composable: a preset. A preset can be understood as the agent’s capability configuration file. It contains no business logic; it only answers three questions—what identity this session speaks as, which tools it can call, and which behavioral rules it follows. The runtime is responsible for reading the configuration, assembling capabilities, and isolating state. The separation of responsibilities is clean.

    This article uses the standard mode as the main thread to explain the composition, constraints, and engineering value of preset modes.

    2. What a Preset Really Is: A Directory Plus an Assembly Declaration

    A preset usually corresponds to a standalone directory containing an assembly declaration file (in YAML form) that describes four dimensions of the session:

    • Persona: the opening definition of the system prompt, which determines the model’s role and tone;
    • Tool list: the set of tools the model can “see” in this session, which directly defines the boundary of its actions;
    • Prompt sections: additional behavioral rules, such as constraints during the planning phase or citation requirements during retrieval;
    • Always-on capabilities: infrastructure unrelated to any specific task but always active, such as context compaction and skill discovery.

    The most important point to emphasize here is a counterintuitive design: a mode determines the tool schemas and prompt text the model sees, not the runtime’s internal implementation. This means switching modes is not “flipping a switch” but “swapping in a different model-visible world.” From this follows a hard constraint—once a session has produced content, its mode is locked. The reason is that the session history already contains tool calls based on the old schemas and behavioral traces based on the old prompts; changing modes midway would make the context self-contradictory. The common engineering practice is to allow mode selection only in a blank session; otherwise the gateway directly returns an error code such as agent-preset-locked, blocking invalid operations at the entry point.

    Another key mechanism is mount granularity: the assembly result is mounted only once within the process and belongs to the always-on scope, so all sessions using the same mode share that mount. Session state, however, is stored under keys split by session and agent dimension, so it does not cross-contaminate. This model of “shared definition, isolated state” both avoids the overhead of repeatedly parsing configuration for every session and guarantees concurrency safety.

    3. Positioning and Trade-offs of the Four Presets

    Mode Identifier Positioning Applicable scenarios
    Standard mode standard Full-featured coding agent (default) Daily development, cross-file changes, retrieval and planning required
    Code orchestration mode code Standard capabilities + programmatic orchestration interface Completing multiple deterministic steps in a single round trip
    Minimal mode minimal Fixed prompt + two tools, no compaction, no skills Restricted sandboxes, cost-sensitive setups, behavior that must be tightly constrained
    Creation mode cordis Standard capabilities + read/write access to its own runtime Metaprogramming, generating new agent forms

    The four are not a straight line of increasing capability; they are different trade-offs between capability radius and controllability. Minimal mode sacrifices autonomy in exchange for predictability and extremely low resource usage. Code orchestration mode compresses “multi-step operations” from multiple conversation turns into a piece of executable logic, reducing the uncertainty introduced by round trips. Creation mode turns the runtime itself into a writable object—the highest risk, but also the highest ceiling. The default generally lands on standard mode, specified via the default entry in a local settings file, and any new session a user opens inherits that default.

    4. Dissecting Standard Mode: The Assembly Logic of Eleven Capability Groups

    The official description of standard mode can be summarized as a complete coding agent supporting file editing, shell execution, file and web retrieval, skills, planning, goals, sub-agents, and workflows. Its assembly file can be roughly broken down into the following capability groups.

    1. Identity and instruction injection. The persona contains two placeholders: the model name and the working directory. Both are resolved according to the session’s actual routing and runtime environment, so the same configuration produces a different opening statement in different sessions. The accompanying instruction byte limit (commonly on the order of tens of KB) determines how large the workspace documentation files entering the context can be—this is precisely the channel through which project-level convention files (such as various rule documents) influence model behavior. Engineering recommendation: put hard constraints at the front of the instruction file and lengthy background after them, so high-value rules are not truncated.

    2. Platform-adaptive shell. Tool assembly is not a static list but carries conditional expressions. A typical pattern enables a tool on Unix-like platforms and disables it on another, avoiding exposure of incompatible command-line capabilities to the model:

    1. tool-bash:
    2. disabled: process.platform === 'win32'

    This approach of “trimming tools by runtime environment” is far more reliable than repeatedly instructing the model in the prompt not to use a certain command—remove it at the schema level and the model has no way to call it.

    3. File editing and retrieval. This usually includes exact string-replacement editing, directory browsing, content search, and web fetching. Exact replacement is preferable to whole-file rewriting because it naturally limits the scope of changes and reduces the chance of collateral damage.

    4. Planning and goals. A separate prompt section introduces the behavioral constraint of “plan first, then execute,” breaking long tasks into verifiable intermediate states and reducing goal drift along long chains.

    5. Sub-agents and workflows. The main agent is allowed to dispatch constrained subtasks; sub-agents inherit part of the capabilities but have an independent context, used to isolate noise and advance work in parallel.

    6. Always-on infrastructure. Context compaction performs summary folding when history approaches the window limit; skill discovery retrieves reusable operational patterns from the workspace and injects them dynamically. Both are task-independent, so they sit in the always-on scope.

    5. Engineering Practice Recommendations

    • Decide the mode up front: determine the mode at session creation to avoid rework that triggers the lock error;
    • Minimize capabilities: prefer minimal mode for restricted environments, trading “fewer tools” for “predictability”;
    • Prefer orchestration for determinism: when steps are clear and must be completed in one pass, programmatic orchestration is more stable than multiple conversation turns;
    • Configuration as code: put the assembly file under version control and route changes through review, preventing prompts and tool allowlists from drifting arbitrarily;
    • Observability: instrument mode assembly, tool calls, and compaction trigger points to make problems like “why can’t the model see a certain tool” easier to diagnose.

    6. Conclusion

    The value of preset modes lies in decoupling an agent’s “capability boundary” from code into declarative configuration, and supporting concurrent modes through shared mounting plus session isolation. Understanding the cause of “mode locking” matters more than memorizing a particular error code: it reminds us that once the model’s visible world is formed, it has inertia, and architecture design should try to make the choice happen at the start of a session.