Context Files
Provide custom project context to improve the AI’s understanding and accuracy in Kodezi CLI.
Context files help Kodezi CLI understand your project’s architecture, coding style, conventions, and structure. This allows the AI to generate code that matches your project standards more accurately.
They are especially useful when working in:
- large codebases
- multi developer teams
- strict architecture or coding guidelines
- custom frameworks or tooling setups
What Are Context Files?
Context files are markdown or text files that Kodezi CLI reads when it starts. Their content becomes part of the AI’s internal system context, meaning:
- Your coding standards are followed
- Your architecture is respected
- Generated code matches your conventions
- Suggestions become more accurate and useful
- AI understands your folder structure and naming patterns
Configuration
You can define context files globally or per project.
Global Config
These apply to all projects on your machine.
Add to:
~/.config/kodezi-cli/kodezi-cli.jsonExample Global Config:
{
"options": {
"context_paths": [
"~/dev/global-standards.md"
]
}
}Use global context files when you want:
- universal coding standards
- reusable architecture notes
- company wide best practices
Project Config
Place a config file in your project root:
kodezi-cli.jsonor
.kodezi-cli.jsonExample Project Config:
{
"options": {
"context_paths": [
"docs/ARCHITECTURE.md",
"docs/STANDARDS.md",
"CONTRIBUTING.md"
]
}
}Project context files override global context files and are tailored to the specific repository.
Default Context Files
Kodezi CLI automatically loads commonly used context files from your project if they exist.
If these files exist, they are automatically included without configuration.
Supported Formats
Kodezi supports common documentation formats:
- Markdown (
.md) - Plain text (
.txt) - JSON (
.json) - YAML (
.yaml,.yml)
This allows you to use existing project documentation without converting it.
Example Context Files
Use structured documentation to help Kodezi understand your project.
ARCHITECTURE.md
Document your project's architecture and structure:
# Project Architecture
## Stack
- Frontend: React + TypeScript
- Backend: Node.js + Express
- Database: PostgreSQL
## Structure
- `/src/api` - Backend API
- `/src/components` - React components
- `/src/utils` - Shared utilities
## Conventions
- Use async/await
- API routes under `/api/v1`
- PascalCase for componentsThis helps the AI understand your project structure and make appropriate suggestions.
STANDARDS.md
Define your coding standards and best practices:
# Coding Standards
## TypeScript
- Use interfaces for object shapes
- Enable strict mode
- Prefer const over let
## Testing
- Use Jest for unit tests
- Place tests next to source files
- Aim for 80%+ coverageThe AI will follow these standards when generating or modifying code.
How Context Files Improve AI Behavior
How It Works
When Kodezi CLI starts, it scans and loads all configured context files. Their content becomes part of the AI’s understanding of your project, enabling features like:
- Follow project specific conventions: Apply your coding style and patterns
- Understand your architecture: Make informed decisions about code organization
- Apply your coding standards: Generate code that matches your requirements
- Respect your guidelines: Follow team practices and workflows
Best Practices for Context Files
Best Practices
To get the most value from context files:
- Keep them concise: Focus on essential information and guidelines
- Update regularly: Ensure context reflects current project state
- Use clear structure: Organize with headers and bullet points
- Be specific: Provide concrete examples of conventions
- Version control: Commit context files to your repository for team consistency
- Separate concerns: Use different files for architecture, standards, and workflows
Related Topics
- Settings: All configuration options
- Quick Start: Getting started guide
- LSP Setup: Language Server Protocol
- MCP Setup: Model Context Protocol