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 toolbox menu and in toolbox search resultsOne sentence of up to 100 bytes in the menu, 1 KiB in search results
skill_catalog_bytesThe toolbox menu: skills, MCP servers, and built-in tools in toolboxBased 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, as toolbox opens it, or the combined schemas of always-loaded ACP client servers64 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 toolbox menu budget is estimated from 2% of the model's context window, using four bytes per token, up to 32 KiB. If the context size is unknown, it defaults to 8,000 characters. Setting skill_catalog_bytes replaces this with a fixed byte limit, still at most 32 KiB. When the menu doesn't fit, fx shortens its descriptions, then lists fewer entries; toolbox search still finds the rest.

In the menu, each skill shows the first sentence of its description, up to 100 bytes. A longer sentence ends after its last whole word, or at the limit when it has no space near the end, followed by …. toolbox search results show up to 1 KiB of the description. Setting skill_description_bytes replaces the 1 KiB limit, and a value under 100 bytes also shortens the menu's lines. A skill installed in more than one skills folder with the same name and description appears once in the menu and in search results.

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.

Instruction files work differently: fx cuts a file longer than project_instruction_file_bytes at its last complete line within the limit, and leaves out whole files once the combined instructions pass project_instructions_total_bytes. See Missing instructions for which files fx keeps.

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. An unknown limit name or any other value makes fx skip the rest of that settings file or workspace entry, keeping only its provider and model choices, and report the problem at startup.

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.