AI Chat
Conversational AI agent that understands your codebase, executes tools, and writes code through natural language.
Overview
The AI Chat panel is the primary interface for interacting with Misar Code. Type natural language requests and the agent autonomously executes tools, edits files, runs commands, and reports results — all without leaving VS Code.
Opening the Chat
Press Cmd+K Cmd+I (macOS) or Ctrl+K Ctrl+I (Windows/Linux) to open a floating quick-chat input.
Open the Command Palette (Cmd+Shift+P) and run Misar Code: Open Chat.
Context Injection
The agent automatically builds context before sending your message to the AI:
- Active file — the file currently open in the editor
- Selected text — highlighted code is included as the focal context
- Type definitions — imported types and interfaces for the active file
- Related tests — test files co-located with the active file (when
misar.autoContextis enabled) - Project rules —
.misar/MISAR.mdand~/.misar/MISAR.mdare loaded automatically - Session memory —
.misar/MEMORY.mdpersists learnings across sessions
Disable automatic context injection with "misar.autoContext": false in your VS Code settings if you prefer to supply context manually.
Session Persistence
Conversations are saved across VS Code restarts. Configure retention with misar.sessionRetentionHours (default: 24). Set to 0 to disable persistence.
Agent Limits
| Limit | Value | |-------|-------| | Max turns per run | 40 | | Loop detection (consecutive read-only turns) | 10 | | SWE pipeline timeout | 30 minutes |
When the agent detects a loop (10+ consecutive non-writing turns), it stops and reports the stall to you.
Slash Commands
Type / in the chat input to see all available commands:
| Command | Description |
|---------|-------------|
| /explore | Enters read-only mode — all write and destructive tools are blocked |
| /swe | Activates the structured 5-phase bug-fixing pipeline |
| /compose | Multi-file edit mode for refactors spanning 5–20 files |
| /review-pr <num> | Fetches and reviews a pull request by number |
| /test <file> | Generates tests for the given file and runs them (up to 3 retries on failure) |
| /symbols | Opens symbol search across the workspace |
| /debug | Integrates with VS Code's debugger for step-through assistance |
| /models | Opens the model store to browse and switch AI models |
| /skill-creator | Interactive wizard to create custom .skill slash commands |
| /inline-edit | Switches to inline edit mode for targeted single-block edits |
Context Menu Actions
Right-click any selected code in the editor to access quick AI actions:
Explain
Get a plain-language explanation of the selected code, including logic flow and edge cases.
Fix
Ask the agent to identify and repair bugs or issues in the selection.
Refactor
Improve structure, naming, and patterns while preserving behavior.
Generate Tests
Create unit tests for the selected function or class.
Stopping a Run
Click the Stop button (square icon) in the chat toolbar at any time to abort the current agent run. The agent completes its current tool call before stopping.
Tips
- Be specific about what you want changed — include file names and function names when relevant.
- Use
/explorebefore making large requests to let the agent survey the codebase first. - Pin important facts to
.misar/MEMORY.mdusing thesave_memorytool so the agent remembers them in future sessions.