forge.yaml file is the main configuration file for customizing Forge’s behavior in your project.
Configuration Schema
Forge uses a JSON schema for validation. You can enable schema validation in your editor:Core Configuration
model
The AI model to use for all agents. Must match a model available from your configured provider.Example:Use
/model command in Forge CLI to see available models.custom_rules
Custom guidelines that all agents should follow when generating responses. Applied in addition to each agent’s individual rules.Example:
commands
Define custom commands as shortcuts for repetitive prompts.Schema:
name(string, required) - Command namedescription(string, required) - Command descriptionprompt(string, optional) - Prompt text to execute
templates
Path pattern for custom template files (supports glob patterns).Example:
Model Parameters
temperature
Controls randomness in the model’s output.
- Range: 0.0 to 2.0
- Lower values (0.0-0.3): More focused, deterministic, coherent
- Higher values (0.7-2.0): More creative, diverse, exploratory
top_p
Controls diversity via nucleus sampling.
- Range: 0.0 to 1.0
- Lower values (0.1): More focused on probable tokens
- Higher values (0.9): More diverse token selection
top_k
Controls the number of highest probability tokens to keep.
- Range: 1 to 1000
- Lower values (10): More focused responses
- Higher values (100): More diverse responses
max_tokens
Maximum number of tokens the model can generate.
- Range: 1 to 100,000
- Lower values (100): Concise outputs
- Higher values (20480): Detailed responses
Request Limits
max_requests_per_turn
Maximum number of requests an agent can make in a single conversation turn.Prevents runaway conversations and controls API usage. When reached, Forge prompts to continue or stop.Example:
max_tool_failure_per_turn
Maximum times a tool can fail before forcing completion.Prevents infinite retry loops when operations repeatedly fail.Example:
Project Settings
max_walker_depth
Controls how deeply Forge traverses your project directory structure.
- Lower values (1): Only immediate subdirectories
- Higher values (5+): Deep traversal (may be slower)
tool_supported
Enable/disable tool support for all agents.Example:
Context Compaction
Configuration for automatic context compaction to manage conversation length.Example:
Update Configuration
Configuration for Forge update checks.Example:
Complete Example
Advanced Usage
Variables
Use YAML anchors to reuse configuration values:Schema Validation
Enable schema validation in your editor:- Ensure
forge.schema.jsonis in your project root - Add schema reference to the top of your
forge.yaml:
Next Steps
Custom Rules
Define project-specific coding guidelines
Environment Variables
Configure runtime behavior