Computer scienceProgramming languagesKotlinAI engineering with KotlinAI tools & frameworksJetBrains AI tools

Working with JetBrains AI tools

You already know how to install and configure JetBrains AI tools. Now, let's explore the core features, operational modes, and integrations that you'll actually use while building your Kotlin Multiplatform app.

Basic usage

You interact with the AI Assistant through several interfaces, each optimized for different stages of the coding cycle. Next edit is the most immediate form of assistance. As you type, the AI Assistant analyzes the surrounding code and suggests single lines or entire blocks of code in gray ghost text. You can accept these suggestions by pressing Tab:

Autocomplete with AI Assistant

For interactive editing, use the Inline chat ( or Ctrl \). This brings up a prompt directly in the editor window — good for a quick, local change, like asking it to replace a for-loop with map/filter in a shared repository function, without leaving the editor. You'll see a diff view, allowing you to review changes before accepting them:

Inline edit with AI Assistant.

For additional actions, right-click anywhere in the editor window to bring up the context menu and select AI Actions:

AI Actions context menu.

These cover your basic developer needs, like code generation, refactoring, documentation, unit testing, and debugging. For conversational queries, the AI Chat tool window is your primary interface. You can ask open-ended questions, request features, brainstorm, and more. The chat maintains a history, letting you iterate on generated solutions. To unlock deep project context, toggle Codebase Mode. This gives models additional relevant context for better output — useful when a question spans multiple source sets, like "where does this shared model get used on the iOS side?"

Enabling codebase mode

Agent modes

While standard chat and autocomplete features are helpful, agent modes like Junie, Codex, and Claude excel at complex, multi-step tasks — for example, asking Junie to add a new Compose Multiplatform screen, wire it into your navigation graph, and write tests for the underlying commonMain logic, all in one go. Junie operates in two modes: Code and Ask. Ask is read-only — Junie can explore files and analyze code, but cannot edit code or run commands. This mode helps you explore your codebase and ask open-ended questions similar to the Chat mode.

In Code mode, Junie breaks tasks into steps and executes the plan. It can run commands, create files, write and edit code, test changes, and verify results autonomously:

Debugging with Junie

As Junie adds and edits files, you can view the changes in the diff viewer. Once done, you can review the changes and selectively accept or reject them. If Junie ran a terminal command, you can open the Junie terminal to view the output of the executed commands or provide input if needed. Junie also allows you to rollback to previous checkpoints and can pause to ask you for the strategy it should use:

Junie pauses for user to select the best strategy.

You can disable these questions or adjust how often you get them in Settings > Tools > Junie > Project settings > Frequency of questions from Junie.

Like Junie, the Claude agent also excels at complex multi-step tasks. It is built on Anthropic's Agent SDK, bringing Claude Code's capabilities to JetBrains IDEs:

Like the Claude Code agent, the Claude agent also offers Plan mode, which focuses on architectural reasoning. The agent generates a high-level, step-by-step plan before writing any code — worth using for a task like introducing a new shared module, where you want to review the proposed structure before any file gets touched. You can review and refine this plan to ensure the output aligns with your design intent before implementation begins.

To streamline routine tasks that need little supervision, enable Brave mode for agents. This mode allows them to execute terminal commands, run scripts, and modify files with fewer confirmation prompts, accelerating repetitive tasks. Additionally, you can include commands in Settings > Tools > Junie > Action Allowlist — for instance, your test or lint tasks — so that Junie can run them without requiring confirmation:

Context management

Regardless of the mode you use, providing the necessary context to LLMs is important. Use @ to mention specific files, database objects, commits, symbols, rules, problems, selections, and more. Press @ in the interface to see all available options, like @selection, @localChanges, etc. You can also use the + icon to add the needed context:

Sources of context

To allow the AI Assistant to perform web searches to retrieve updated information, use /web:

Using /web to check the latest version of IntelliJ IDEA

Whenever you select anything while the AI Assistant window is open, it is also automatically added to the context. This is useful when you need to quote the AI Assistant's own outputs or terminal outputs. However, remember that too much context can quickly deplete your quota or lead to irrelevant results. Only provide models with the context they need — pointing the assistant at the specific expect declaration and its existing actual implementations will get you a better result than dumping in the whole shared module.

MCP servers

As covered in the previous topic, the MCP protocol allows AI tools to communicate with external systems efficiently. You can configure MCP servers that the AI Assistant or agents can use to complete various tasks. The setup is the same for both Junie and the AI Assistant. Just head over to Tools > AI Assistant/Junie > MCP and provide the command or JSON config needed to start the server:

Adding Docker MCP server with docker mcp gateway rum

Once connected, you can see all the available tools:

Tools from configured Notion and Playwright MCP servers

The AI Assistant or agents can then select these servers when needed, or you can invoke them directly using / commands:

AI Assistant using AWS Documentation MCP to view the latest AWS documentation.

Other workflows

JetBrains AI Assistant also helps you with other workflows, like version control and database management. You can use it to review staged changes via the Commit tool window (Alt 0) before you commit them. You can also generate commit messages with the AI Assistant, review commits, and even explain them via the Git tool window (Alt 9):

Explain and self review AI Actions for Git

Furthermore, the AI Assistant can help generate titles and descriptions for pull and merge requests, create summaries for incoming PRs, and assist in resolving Git conflicts. As with Junie guidelines, you can define specific rules for AI self-reviews and set them in Settings > AI Assistant > Project Settings.

Check out an example of these guidelines from JetBrains.

When working with databases, the AI Assistant can help you generate and optimize SQL queries from natural language, as well as explain query plans.

AI Assistant explaining query plans.

This is directly useful later if you use SQLDelight for local persistence in your shared module — SQLDelight queries are plain SQL living in .sq files, so this feature works on them the same way it would on a regular database.

Conclusion

JetBrains AI tools offer a comprehensive suite of features to enhance your development workflow. With basic inline completion, interactive chats, and advanced agent modes like Junie and Claude, you can handle everything from simple code suggestions to complex multi-step operations. These integrations extend beyond coding too — supporting version control workflows and database work like the SQL in your persistence layer.

You now have everything you need to bring JetBrains AI tools into the rest of this course: from quick inline completions while you write a single function, to Junie or the Claude agent carrying out a multi-step change across your Kotlin Multiplatform project.

How did you like the theory?
Report a typo