Skip to main content
Codanna is a local code intelligence MCP server and CLI for AI coding agents. Configuration lives in .codanna/settings.toml — embedding model, indexed paths, language resolvers, logging, and guidance templates.

Directory Structure

.codannaignore

Codanna respects .gitignore and adds its own .codannaignore:

Local Models

Remote Embedding Backend

Use an OpenAI-compatible HTTP server instead of local models:
Or override via environment variables (take precedence over config): See Semantic Search for provider examples and migration details.

Changing Models

Switching between local models or between local and remote requires re-indexing:

Indexed Paths

Manage via CLI:

Language Configuration

Project resolution reads build configuration files to determine source roots and module paths. This enables:
  • Correct module path generation (e.g., org.example.service for Java, Core for Swift)
  • Path alias resolution (e.g., @app/* in TypeScript)
  • Cross-package relationship tracking
Resolution rules are cached in .codanna/index/resolvers/. The cache rebuilds during codanna index when config file contents change (SHA-based invalidation). See Project Resolvers for configuration details for all 8 supported languages.

TypeScript

Reads tsconfig.json to resolve path aliases like @app/* and baseUrl settings.

Function wrappers

Many TypeScript codebases define functions through higher-order wrappers: const View = memo(() => {}), const Input = forwardRef((props, ref) => {}), const load = wrap("load")(function* () {}). By default the parser records these bindings as constants because the value is a call expression, so they carry no call graph. Declare the wrapper callee names to register such bindings as functions and index the wrapped body:
  • A declared name matches a member expression’s full dotted text (Effect.gen matches Effect.gen(...) only) or its final property name (memo matches both memo(...) and React.memo(...)). Curried chains (Effect.fn("name")(fn)) resolve through the innermost callee.
  • Calls inside the wrapped body attribute to the binding, so find_callers, get_calls, and analyze_impact cover wrapper-defined functions.
  • The list is empty by default; indexing behavior is unchanged until you declare names.
  • After editing the list, run codanna index --force — changing parser options changes what the index contains, and the emission gate does not detect configuration edits.
A value that is not an array of strings fails codanna index with an error naming this key.

Java

Reads Maven pom.xml or Gradle build.gradle to detect source roots (src/main/java, src/test/java). Generates module paths like org.springframework.samples.petclinic.owner.

Swift

Reads Swift Package Manager Package.swift to detect source roots. Uses SPM conventions (Sources/, Tests/) or custom path: specifications. Generates module paths like Networking, Cache, General.

Logging

Or via environment:

View Configuration

Next Steps

Project Resolvers

Configuration for Go, Python, Kotlin, PHP, C#, and more.

Debugging

Troubleshoot indexing and search issues.