Loading image...Kiro
  • CLI
  • Powers
  • Autonomous agent
  • Enterprise
  • Pricing
  • Docs
SIGN INDOWNLOADS
Loading image...Kiro
Loading image...Kiro
Product
  • About Kiro
  • CLI
  • Powers
  • Autonomous agent
  • Pricing
  • Downloads
For
  • Enterprise
  • Startups
Resources
  • Documentation
  • Blog
  • Changelog
  • FAQs
  • Report a bug
  • Suggest an idea
  • Billing support
Social
Site TermsLicenseResponsible AI PolicyLegalPrivacy PolicyCookie Preferences
  1. Docs
  2. CLI
  3. Code Intelligence

Code Intelligence

On this page
  • Supported languages
  • Built-in features
  • Codebase overview
  • LSP integration (optional)
  • How it works
  • Installing language servers
  • Initialize LSP
  • Using language servers
  • Custom language servers
  • Troubleshooting
  • Best Practices
  • Limitations

Kiro CLI provides out-of-the-box code intelligence for 18 languages without requiring any setup. Agents can search symbols, get document symbols, lookup definitions, and perform structural code searches immediately.

For enhanced features like find references, hover documentation, and rename refactoring, you can optionally enable LSP integration.

Supported languages

Bash, C, C++, C#, Elixir, Go, Java, JavaScript, Kotlin, Lua, PHP, Python, Ruby, Rust, Scala, Swift, TSX, TypeScript

Built-in features

  • Symbol search - Find functions, classes, and variables across your codebase
  • Document symbols - List all symbols in a file
  • Symbol lookup - Jump to definitions instantly
  • Pattern search - AST-based structural code search (e.g., find all async functions, match specific call patterns)
  • Pattern rewrite - Automated code transformations using AST patterns
  • Codebase map - Explore directory structure and understand code organization

Codebase overview

Get a quick overview of any workspace:

bash
/code overview

Use --silent for cleaner output:

bash
/code overview --silent

This is useful for:

  • Onboarding to new codebases
  • Q&A sessions about project structure
  • Understanding unfamiliar packages quickly

LSP integration (optional)

For enhanced code intelligence features like find references, hover documentation, and rename refactoring, you can enable LSP integration.

How it works

Kiro CLI spawns LSP server processes in the background that communicate via JSON-RPC over stdio. When you initialize a workspace, it detects languages from project markers (like package.json, Cargo.toml) and file extensions, then starts the appropriate language servers. These servers continuously analyze your code and maintain an index of symbols, types, and references. When you make queries, Kiro translates your natural language into LSP protocol requests, sends them to the relevant server, and formats the responses back into readable output.

Here's how you can enable Kiro CLI to use LSP servers:

  1. Install language servers
  2. Enable the LSP integration
  3. Ask code related questions to use language servers

Installing language servers

Default LSP configurations are included for: C/C++, Go, Java, Kotlin, Python, Ruby, Rust, TypeScript/JavaScript

Supported Languages

LanguageExtensionsServerInstall Command
TypeScript/JavaScript.ts, .js, .tsx, .jsxtypescript-language-servernpm install -g typescript-language-server typescript
Rust.rsrust-analyzerrustup component add rust-analyzer
Python.pyjedi-language-servernpm install -g pyright or pip install pyright
Go.gogoplsgo install golang.org/x/tools/gopls@latest
Java.javajdtlsbrew install jdtls (macOS)
Ruby.rbsolargraphgem install solargraph
C/C++.c, .cpp, .h, .hppclangdbrew install llvm (macOS) or apt install clangd (Linux)

Initialize LSP

Workspace-scoped configuration

Code intelligence is configured per workspace, not globally. Each project maintains its own LSP settings independently.

Run this slash command in your project root:

/code init

This creates .kiro/settings/lsp.json configuration and starts language servers.

What you'll see:

✓ Workspace initialization started Workspace: /path/to/your/project Detected Languages: ["python", "rust", "typescript"] Project Markers: ["Cargo.toml", "package.json"] Available LSPs: ○ clangd (cpp) - available ○ gopls (go) - not installed ◐ jdtls (java) - initializing... ✓ jedi-language-server (python) - initialized (687ms) ✓ rust-analyzer (rust) - initialized (488ms) ○ solargraph (ruby) - not installed ✓ typescript-language-server (typescript) - initialized (214ms)

Status indicators:

  • ✓ - Initialized and ready
  • ◐ - Currently initializing
  • ○ available - Installed but not needed for detected languages
  • ○ not installed - Not installed on your system

Restart LSP servers: If language servers shut down or become unresponsive, use /code init -f.

Auto-initialization: After the first /code init, Kiro CLI automatically initializes code intelligence on startup when .kiro/settings/lsp.json exists in the workspace.

Disabling code intelligence: Delete .kiro/settings/lsp.json from your project to disable. You must restart your session for this change to take effect. Re-enable anytime with /code init.

Using language servers

Language servers provide semantic code intelligence through natural language queries. You can search symbols, navigate definitions, find references, rename across files, get diagnostics, view method documentation, and discover available APIs on classes and objects.

Find a symbol:

> Find the UserRepository class Searching for symbols matching: "UserRepository" 1. Class UserRepository at src/repositories/user.repository.ts:15:1

Find all references:

> Find references of Person class Finding all references at: auth.ts:42:10 1. src/auth.ts:42:10 - export function authenticate(...) 2. src/handlers/login.ts:15:5 - authenticate(credentials) 3. src/handlers/api.ts:89:12 - await authenticate(token)

Go to definition:

> Find the definition of UserService src/services/user.service.ts:42:1: export class UserService { ...

Get file symbols:

> What symbols are in auth.service.ts? Getting symbols from: auth.service.ts 1. Class AuthService at auth.service.ts:12:1 2. Function login at auth.service.ts:25:3 3. Function logout at auth.service.ts:45:3 4. Function validateToken at auth.service.ts:62:3

Rename with dry run:

> Dry run: rename the method "FetchUser" to "fetchUserData" Dry run: Would rename 12 occurrences in 5 files

Get diagnostics:

> Get diagnostics for main.ts 1. Error line 15:10: Cannot find name 'undefined_var' 2. Warning line 42:5: 'result' is declared but never used

Get hover documentation:

> What's the documentation for the authenticate method in AuthService? Type: (credentials: Credentials) => Promise<AuthResult> Documentation: Authenticates a user with the provided credentials. Returns an AuthResult containing the user token and profile. @param credentials - User login credentials @throws AuthenticationError if credentials are invalid

Discover available methods:

> What methods are available on the s3Client instance? Available completions: 1. putObject - Function: (params: PutObjectRequest) => Promise<PutObjectOutput> 2. getObject - Function: (params: GetObjectRequest) => Promise<GetObjectOutput> 3. deleteObject - Function: (params: DeleteObjectRequest) => Promise<DeleteObjectOutput> 4. listObjects - Function: (params: ListObjectsRequest) => Promise<ListObjectsOutput> 5. headObject - Function: (params: HeadObjectRequest) => Promise<HeadObjectOutput>

Custom language servers

Add custom language servers by editing .kiro/settings/lsp.json in your project:

json
{ "languages": { "mylang": { "name": "my-language-server", "command": "my-lsp-binary", "args": ["--stdio"], "file_extensions": ["mylang", "ml"], "project_patterns": ["mylang.config"], "exclude_patterns": ["**/build/**"], "multi_workspace": false, "initialization_options": { "custom": "options" } } } }

Fields:

  • name: Display name for the language server
  • command: Binary/command to execute
  • args: Command line arguments (usually ["--stdio"])
  • file_extensions: File extensions this server handles
  • project_patterns: Files that indicate a project root (e.g., package.json)
  • exclude_patterns: Glob patterns to exclude from analysis
  • multi_workspace: Set to true if the LSP supports multiple workspace folders (default: false)
  • initialization_options: LSP-specific configuration passed during initialization
  • request_timeout_secs: Timeout in seconds for LSP requests. Default is 60.

After editing, restart KIRO CLI to load the new configuration.

Troubleshooting

IssueCause(s)Solution
Workspace is still initializingLSP servers are starting upWait and try again. If servers crashed, use /code init -f to restart.
LSP initialization failedCheck logs for details: /code logs -l
No symbols foundLanguage server is still indexing or File has syntax errors or Symbol name doesn't matchCheck file for errors, try broader search terms.
No definition foundPosition doesn't point to a symbol. Solution: Verify the row and column numbers point to a symbol name.

Best Practices

  1. Initialize once per project - Run /code init in project root
  2. Use exact positions - Row and column must point to the symbol
  3. Use dry_run for renames - Preview changes before applying
  4. Check diagnostics first - Syntax errors can prevent analysis
  5. Be specific in searches - "UserService" > "user"
  6. Ask for documentation naturally - "What does the login method do?" instead of specifying coordinates
  7. Discover APIs conversationally - "What methods does s3Client have?" to explore external library functionality

Limitations

  1. LSP feature support varies by language server - not all servers support every operation (e.g., some may not support rename or formatting)
  2. Large codebases may have slow initial indexing
Page updated: January 15, 2026
Auto complete
Billing for individuals