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.json

Example 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.json

or

.kodezi-cli.json

Example 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.

.cursorrules
CLAUDE.md
CLAUDE.local.md
kodezi-cli.md
kodezi-cli.local.md
Kodezi-Cli.md
Kodezi-Cli.local.md
KODEZI-CLI.md
KODEZI-CLI.local.md
AGENTS.md
agents.md
Agents.md

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 components

This 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%+ coverage

The 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:

  1. Keep them concise: Focus on essential information and guidelines
  2. Update regularly: Ensure context reflects current project state
  3. Use clear structure: Organize with headers and bullet points
  4. Be specific: Provide concrete examples of conventions
  5. Version control: Commit context files to your repository for team consistency
  6. Separate concerns: Use different files for architecture, standards, and workflows