KnightCode Docs
Customize KnightCode

Configuration

KnightCode supports user-level and project configuration. User-level configuration lives in the agent directory, which defaults to ~/.knightcode/agent. Project configuration...


KnightCode supports user-level and project configuration. User-level configuration lives in the agent directory, which defaults to ~/.knightcode/agent. Project configuration lives in .knightcode under the working directory and loads after project trust is granted. The only exception is sessionDir, which KnightCode reads before resolving trust so it can locate sessions.

In interactive mode, use /settings to change common preferences. For other options, ask KnightCode to update the configuration or edit the relevant files directly. Run /reload after manually changing settings, keybindings, instructions, or resources.

Agent directory

The agent directory is shown as <agent-dir> below. Set its location with the KNIGHTCODE_CODING_AGENT_DIR environment variable or the SDK's agentDir option.

PathResponsibility
<agent-dir>/settings.jsonUser-level settings, including preferences, defaults, resource paths, and KnightCode package declarations.
<agent-dir>/keybindings.jsonCustom terminal UI and application keybindings.
<agent-dir>/mcp.jsonMCP servers available in every project.
<agent-dir>/models.jsonCompatible endpoints, models, and model overrides.
<agent-dir>/auth.jsonSaved API keys and OAuth credentials.
<agent-dir>/tools.jsonWeb tool, scratchpad, and classifier gate settings written by /tools, including the Brave Search key.
<agent-dir>/AGENTS.override.md, AGENTS.md, AGENTS.MD, CLAUDE.md, or CLAUDE.MDUser instructions applied across working directories.
<agent-dir>/SYSTEM.mdReplaces KnightCode’s default system prompt.
<agent-dir>/APPEND_SYSTEM.mdAdds instructions to KnightCode’s system prompt.
<agent-dir>/extensions/User extensions.
<agent-dir>/skills/User skills and supporting files.
<agent-dir>/prompts/User prompt templates exposed as slash commands.
<agent-dir>/themes/User theme files.

Project .knightcode directory

PathResponsibility
.knightcode/settings.jsonProject-level settings, resource paths, and KnightCode package declarations.
.knightcode/mcp.jsonProject MCP servers.
.knightcode/SYSTEM.mdReplaces the system prompt for the project.
.knightcode/APPEND_SYSTEM.mdAdds project-specific instructions to the system prompt.
.knightcode/extensions/Project extensions.
.knightcode/skills/Project skills and supporting files.
.knightcode/prompts/Project prompt templates exposed as slash commands.
.knightcode/themes/Project theme files.

For SYSTEM.md and APPEND_SYSTEM.md, the trusted project file takes precedence over the corresponding agent-directory file. Files with the same name are not combined.

Context files

Context files are separate from project .knightcode configuration. KnightCode loads them from the agent directory, the working directory, and its parent directories. A context file applies whenever KnightCode runs in its directory or anywhere below it.

An AGENTS.override.md replaces AGENTS.md or CLAUDE.md only in the same directory. It does not suppress context files from the agent directory or other directories.

Context-file discovery does not require project trust.