Misar IO Docs

Configuration

Permission modes, AI personas, key settings, and pattern-based permission grants.

Configuration

Misar Code behavior is controlled through VS Code settings, the active permission mode, your chosen AI persona, and per-project rules in .misar/MISAR.md.

Permission Modes

Permission modes control how much autonomy Misar Code has when taking actions in your workspace.

| Mode | Behavior | |------|----------| | default | Asks for confirmation before dangerous or destructive operations (file deletion, running shell commands, git push) | | acceptEdits | Auto-accepts all file edits without prompting; still asks for shell commands | | plan | Plans tasks and describes what it would do, but executes nothing — no files written, no commands run | | bypassPermissions | Skips all confirmation prompts; all tools run without approval | | explore | Fully read-only: all write tools (edit, create, delete, run_command, git write ops) are blocked |

bypassPermissions is intended for trusted automation scripts and CI workflows. Do not use it in interactive sessions unless you have reviewed what the agent plans to do.

Set the permission mode in settings:

Cmd+, → search "misar.permissionMode"

Or switch modes mid-session using the slash commands /explore (enter read-only) and /plan (enter plan-only mode).

Pattern-Based Permission Grants

For fine-grained control, you can pre-approve specific tool calls using glob patterns in the misarCode.alwaysAllowed setting. This avoids repeated prompts for safe, routine operations.

{
  "misarCode.alwaysAllowed": [
    "run_command:git *",
    "run_command:npm test",
    "read_file:src/**",
    "glob:**/*.ts"
  ]
}

Pattern format: tool_name:argument_glob. The argument is matched against the first argument passed to the tool. Standard glob syntax applies (*, **, ?, {a,b}).

AI Personas

Personas adjust the agent's communication style and focus. Select the one that matches your current task.

| Persona | Best For | |---------|----------| | default | General-purpose coding assistance | | senior_dev | Production-quality output with trade-off analysis and architecture awareness | | code_reviewer | Finding bugs, security issues, and code quality problems | | tutor | Step-by-step explanations — good for learning unfamiliar code | | architect | System design, module boundaries, and scalability decisions | | quick | Minimal output, just the code — no explanations |

Set your default persona in settings:

Cmd+, → search "misar.persona"

Switch personas mid-session by typing /persona <name> in the chat input.

Key Settings

| Setting | Default | Description | |---------|---------|-------------| | misar.apiKey | — | Your Misar API key | | misar.apiBaseUrl | https://api.misar.dev | API endpoint | | misar.autoAcceptChanges | false | Auto-apply file edits | | misar.showDetailedProgress | true | Per-tool progress in sidebar | | misarCode.codeLens | true | CodeLens actions above symbols | | misar.inlineCompletions | true | Inline completions as you type | | misar.persona | default | Active AI persona | | misar.systemPrompt | — | Extra instructions appended to every request | | misarCode.inlineEditMode | diff | diff shows preview; direct applies immediately | | misarCode.restoreSessionHours | 24 | Hours of conversation history to restore | | misarCode.autoContext | true | Include open editor files in agent context | | misarCode.alwaysAllowed | [] | Pattern-based pre-approved tool calls |

Project Rules — MISAR.md

The .misar/MISAR.md file in your project root is loaded into every agent session as project-level context. Use it to tell the agent about your codebase conventions, patterns to follow, and constraints to respect.

Example:

# Project Rules

## Stack
- Next.js 15 App Router, TypeScript strict mode
- Tailwind CSS for styling — no inline styles
- Zod for all input validation

## Conventions
- Component files: PascalCase in `src/components/`
- API routes: kebab-case in `src/app/api/`
- Never use `as any` — fix the root type instead

## Testing
- Vitest for unit tests, Playwright for E2E
- Every new utility function needs a unit test

A global rules file at ~/.misar/MISAR.md applies across all projects. Project-level rules override global ones where they conflict.

On first activation in a new project, Misar Code auto-generates .misar/MISAR.md by analyzing your codebase. Review and edit it to make the rules accurate for your project.

Hooks

Lifecycle hooks are shell scripts placed in .misar/hooks/:

| File | Runs | |------|------| | session-start.sh | Once when a new chat session begins | | pre-tool-use.sh | Before every tool call; receives tool name and args via env vars | | post-tool-use.sh | After every tool call; receives tool name, args, and result |

Example pre-tool-use.sh that blocks git push on the main branch:

#!/bin/bash
if [ "$MISAR_TOOL_NAME" = "git_push" ] && echo "$MISAR_TOOL_ARGS" | grep -q '"branch":"main"'; then
  echo "Blocked: direct push to main is not allowed"
  exit 1
fi

Make hook scripts executable: chmod +x .misar/hooks/*.sh