Model and skills control is about guiding the AI’s behavior for more reliable output. The right model configuration ensures appropriate cost and capability for each task, while skills provide project-specific and task-specific context that dramatically improves model self-validation by telling the model exactly what standards to follow. The goal here is to iterate by adjusting skills according to mistakes models make, until you reach acceptable generation quality.

Environment Configuration
Environments let you switch between different AI models and providers without restarting your session. Each environment is a named collection of Claude Code-level variables — API keys, model names, base URLs, and pricing — stored in .xedant/environments.yml.
Variable Substitution
Environment variables support $VARIABLE_NAME references. When the environment is activated, references are resolved to their actual values. This works with both other environment variables and system environment variables, letting you keep secrets out of the repository:
# .xedant/environments.yml — safe to commit
environments:
production:
variables:
- ANTHROPIC_API_KEY=$MY_API_KEY # resolved from system env at runtime
- ANTHROPIC_BASE_URL=https://api.anthropic.com
Hierarchical Inheritance
Environment names support inheritance based on hyphen-separated segments. An environment named glm-5-turbo automatically inherits variables from both glm-5 and glm. Define shared settings (API key, base URL) in the parent and override only what differs in children:
environments:
glm:
variables:
- ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
- CLAUDE_DISABLE_EXPERIMENTAL_BETAS=true
glm-5:
variables:
- ANTHROPIC_MODEL=glm-5
- MODEL_INPUT_PRICE=1.00
glm-5-turbo:
variables:
- ANTHROPIC_MODEL=glm-5-turbo
- MODEL_INPUT_PRICE=1.20
Switching Environments Mid-Chat
Use the environment selector in the chat input area to switch at any time. Switching is instant — the next message uses the new model and settings without starting a new chat or refreshing the page. This lets you use different models for different phases of a task: a cheaper model for exploration and a more capable one for implementation.
Skills as Validation Guides
Skills are folders in .claude/skills/ containing a SKILL.md instruction file and supporting resources (scripts, documentation, samples). They provide project-specific context that shapes the model’s behavior. From a validation perspective, skills are the primary mechanism for preventing mistakes before they happen.
SKILL.md Frontmatter
Each skill’s SKILL.md starts with YAML frontmatter defining metadata:
---
name: code.development
description: Core development workflow for this project
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
model: claude-3-5-sonnet
---
- allowed-tools — Comma-separated whitelist of tools the model can use when this skill is active. Restricting tools reduces the attack surface and prevents unintended actions
- model — Override the default model for this specific skill, useful for skills that need different capability levels
Writing Validation Rules into Skills
The most effective validation happens before the model writes code. Include specific rules in your skill instructions that prevent common mistakes. However, don’t bloat skill files — more context means less attention paid to each requirement, making it both costly and ineffective — the more information is in the context, the less attention is paid to each requirement. Start empty and add short one-line rules only after a model makes a mistake, then ask the model to adjust the skill itself until it stops failing. Prefer having models edit skills rather than editing them manually, and don’t tolerate even rare mistakes. If you notice a model struggling with finding files, using tools, or behaving unexpectedly, stop immediately and ask it to fix the skill first — then start a fresh chat to verify. Don’t give up until it’s perfect.
- Coding standards — Naming conventions, file organization rules, architectural patterns the project follows
- Technology constraints — Which libraries to use, which patterns to avoid, framework-specific best practices
- File structure rules — Where new files should go, naming patterns, required imports or annotations
- Process instructions — “Don’t build manually — builds run automatically on file changes” prevents wasted tool calls
Expect 20–30 iterations of adding rules after mistakes before most routine tasks reach around 85% accuracy.
Skills Configuration
Skills are enabled and customized in .claude/skills.yml. Each skill has an enabled flag and a color for visual identification in the skill selector. When enabled is true, the skill appears in the message input control below the chat, allowing one-click switching. Even if a skill is disabled and not shown there, you can still ask the model to use it directly.
skills:
version: 1.0
activated:
code.development:
enabled: true
color: '#3b82f6'
project.planning:
enabled: true
color: '#84cc16'
The Skills Selector
The skills selector in the chat input area lets you choose which skill to activate before sending your first message. The system automatically prepends start with loading {skill name} skill to your message. For mid-chat switches, it appends load {skill name} skill to your next message, changing the model’s context without losing conversation history.
Select the right skill for the task at hand. A development skill loads coding standards and workflow instructions. A planning skill loads architectural guidelines. A website skill loads content management patterns. Each skill focuses the model’s attention on what matters for the current task.
Effective Validation Patterns
- Write specific skill instructions — Vague rules like “write clean code” don’t help. Specific rules like “all API endpoints must return NotFoundResult with a message property” do
- Restrict allowed tools per skill — If a skill only needs to read and write files, don’t give it Bash access. Fewer tools means fewer opportunities for mistakes
- Use different environments for different tasks — A fast, cheap model for simple edits; a capable model for complex implementation. Switch mid-chat as the task evolves
- Iterate on skills continuously — Every mistake is an opportunity to improve the skill. The improvement curve is steep: 20–30 fixes reach ~85% accuracy
For the complete environments reference, see Environments. For skills management and editing, see Skills. For context optimization, see Context Utilization.