
Enable Auto-sync rules from repo in your settings
What is Rules File Detection?
Rules File Detection automatically detects and imports configuration files from popular AI coding tools and assistants in your repository. This ensures Kody understands and respects your existing coding standards without requiring manual setup.Supported Rule Files
Kodus automatically detects and imports the following rule file patterns:Cursor
.cursorrules- Main Cursor rules file (legacy).cursor/rules/**/*.mdc- Cursor rules in subdirectories
GitHub Copilot
.github/copilot-instructions.md- Copilot instructions.github/instructions/**/*.instructions.md- Detailed instruction files
Agentic (agents.md convention)
AGENTS.md- The de-facto standard agent guidance file.agents.md/.agent.md- Dotfile variants
Claude
CLAUDE.md- Claude-specific rules.claude/settings.json- Claude configuration settings
Windsurf
.windsurfrules- Windsurf IDE rules
Sourcegraph Cody
.sourcegraph/**/*.rule.md- Cody rule files
OpenCode
.opencode.json- OpenCode configuration
Aider
.aider.conf.yml- Aider configuration.aiderignore- Aider ignore patterns
Generic/Internal Rules
.rules/**/*- Generic rules directory.kody/rules/**andrules/**/*.md- Kody-specific rules (see Repository Rules — these are imported verbatim, without LLM rewriting)docs/coding-standards/**/*- Documentation-based coding standards
Detection details
- Nested files are discovered. Every pattern above is matched at the repository root and under any subdirectory. A
services/billing/CLAUDE.mdis imported and automatically scoped toservices/billing/**— per-directory guidance files (the common monorepo convention) work out of the box. - Matching is case-insensitive.
claude.mdandCLAUDE.mdare equivalent. @filereferences are followed. If a rule file references another file with the standard@convention (e.g.@AGENTS.mdinsideCLAUDE.md), the referenced file’s content is fetched and included during import (one level deep, up to 5 references per file, 100KB per referenced file).- Multiple globs per rule are supported. A rule path like
app/**/*.rb,lib/**/*.rb(or apath: []list in Repository Rules frontmatter) applies the rule to files matching any of the globs.
How It Works
Initial Setup
- Enable Auto-sync: Toggle the “Auto-sync rules from repo” option in your settings
- First Sync Modal: A modal will appear asking if you want to sync for the first time
- Repository Scan: When you confirm, Kodus scans your entire repository for supported rule files
- Rule Generation: An LLM processes the found files and automatically creates corresponding Kody Rules. Exception:
.kody/rules/**andrules/**/*.mdtemplate files are imported verbatim — no LLM conversion — so your instructions, examples and identifiers are preserved exactly as authored.
Ongoing Synchronization
- Automatic Updates: Sync happens automatically when a Pull Request is closed
- File Changes Detected:
- New rule files → Creates new Kody Rules
- Modified rule files → Updates existing Kody Rules
- Deleted rule files → Removes corresponding Kody Rules
Manual Sync (Toggle Disabled)
You can sync individual rule files without enabling auto-sync:- Add
@kody-syncanywhere in your rule file - Commit the change
- Kody will sync only that specific file
Excluding a file (@kody-ignore)
To keep a rule/guidance file in your repository but stop Kody from turning it into Kody Rules, add @kody-ignore anywhere in the file:
- Add
@kody-ignoreanywhere in the rule file (case-insensitive) - Commit the change
@kody-ignore marker (or add @kody-sync). Use this to keep house-style docs like a CLAUDE.md or AGENTS.md in the repo without them becoming enforced review rules.
Verifying sync and rule evaluation (self-hosted)
On self-hosted deployments the API logs carry grep-able markers for debugging:[kody-rules-sync]— per-run sync summary: which files were imported, skipped (with the reason) or removed.[kody-rules-eval]— per-file evaluation trace during a review: exactly which rules (uuid + title) were selected into the prompt for each reviewed file.
[kody-rules-eval] for the files you expect, check its Path glob — a rule only runs on files matching its path.