Context limits

Context limits control how much text fx loads from instructions, skills, MCP tools, and image analysis. If content is shortened or omitted, press ctrl+o to see the limit notice in Full detail.

Available limits

FieldDescriptionDefault
skill_description_bytesEach skill's description in the catalog1 KiB
skill_catalog_bytesCombined skill catalogBased on the model's context window
skill_chunk_bytesSkill content returned by one readWhole file
skill_file_bytesEach skill file or reference file1 MiB
mcp_description_bytesEach MCP tool description in search results1 KiB
mcp_search_result_bytesCombined MCP tool search results16 KiB
mcp_server_instructions_bytesInstructions from each MCP server2 KiB
mcp_selected_schema_bytesOne tool's schema, or the combined schemas loaded by a search64 KiB
project_instruction_file_bytesEach instruction file64 KiB
project_instructions_total_bytesCombined project instructions128 KiB
image_adapter_output_bytesText returned by the vision tool20 KiB

The skill catalog budget is estimated from 2% of the model's context window, using four bytes per token. If the context size is unknown, it defaults to 8,000 characters. Setting skill_catalog_bytes replaces this with a fixed byte limit.

Skills load as complete files. If a file exceeds skill_file_bytes or an explicit skill_chunk_bytes limit, fx rejects the load instead of returning partial instructions.

Settings

Add context_limits to ~/.fx/settings.json. This example doubles the per-file and combined instruction limits:

{
  "context_limits": {
    "project_instruction_file_bytes": 131072,
    "project_instructions_total_bytes": 262144
  }
}

Use a non-negative integer in bytes, or "off" to disable a limit. All values, including "off", are capped at 64 MiB.

You can also set limits in a workspace entry. Restart fx after editing the file. Project .fx.json does not accept context_limits.

Command-line overrides

Place --context-limit before the command to override a limit for one run:

$fx --context-limit project_instruction_file_bytes=131072

Repeat the flag to change more than one limit:

$fx --context-limit project_instruction_file_bytes=off --context-limit project_instructions_total_bytes=off

Command-line values override workspace and global settings.