Guides

Agent Mode

Autonomous coding with 40+ tools, 6 operating modes, SEARCH/REPLACE matching, and multi-agent routing.

Operating Modes

QCoder supports six distinct operating modes, each with different tool access levels:

ModeDescriptionTools Available
---------
AgentFull autonomous coding. Can read, write, execute, and browse.All 40+ tools
AskRead-only assistant. Answers questions but cannot modify files.Read-only tools
PlanAnalysis and planning. Can read files and analyze code but not edit.Read + analysis tools
EditFile editing only. Can read and write files but not execute commands.Read + write file tools
Apps BuilderFull Agent plus application scaffolding tools.All + app-specific tools
PRDStory-driven development. Creates feature branches and follows PRD specs.All + PRD workflow tools

Switch modes using the mode selector in the chat header. The current mode determines which tools the AI can access during the conversation.

Tool System Overview

QCoder provides 40+ built-in tools organized into categories:

File Operations: - read_file -- Read the contents of a file - write_to_file -- Create or overwrite a file - replace_in_file -- Apply targeted SEARCH/REPLACE edits - list_files -- List files in a directory (recursive or shallow) - search_files -- Search file contents with regex patterns

Execution: - execute_command -- Run shell commands in the integrated terminal - run_type_checks -- Run the project's type checker (tsc, mypy, etc.)

Git: - git_status -- Show working tree status - git_diff -- Show file diffs - git_commit -- Create a commit with a message - git_log -- View commit history

Browser: - browser_action -- Control a headless browser (navigate, click, type) - web_fetch -- Fetch content from a URL - web_search -- Search the web for information

Memory: - save_memory -- Persist information across sessions - search_memory -- Retrieve previously saved context - workspace_map -- Generate a map of the workspace structure

Security: - scan_secrets -- Scan for leaked secrets and credentials - scan_dependencies -- Check dependencies for known vulnerabilities - scan_code_security -- Run static analysis security testing (SAST) - scan_iac -- Scan infrastructure-as-code files

Agent: - delegate_task -- Hand off a sub-task to a specialized agent - ask_followup_question -- Ask the user for clarification - attempt_completion -- Signal that the task is complete

SEARCH/REPLACE Matching

The replace_in_file tool uses an 8-tier matching system to reliably find and replace code, even when the AI's output does not perfectly match the file contents:

  1. Exact match -- The search string matches the file content character-for-character.
  2. Line-trimmed match -- Leading/trailing whitespace on each line is ignored.
  3. Block-anchor match -- The first and last lines of the search block are used as anchors to locate the region.
  4. Normalized whitespace -- All whitespace sequences are collapsed before comparison.
  5. Indent-agnostic match -- Indentation differences are ignored entirely.
  6. Fuzzy line match -- Individual lines are matched using similarity scoring.
  7. Context-window match -- A sliding window scans the file for the best partial match.
  8. LLM-assisted match -- As a last resort, the AI is asked to identify the correct location.

This tiered approach means that even if the AI hallucinates minor formatting differences, the edit still applies correctly.

Multi-Agent Routing

When multi-agent routing is enabled, QCoder can delegate tasks to specialized sub-agents:

  • Coder -- Writes and edits code. The default agent for most tasks.
  • Reviewer -- Reviews code for bugs, style issues, and best practices.
  • Planner -- Creates implementation plans and breaks down complex tasks.
  • Debugger -- Diagnoses errors, reads logs, and suggests fixes.
  • Docs Writer -- Generates documentation, comments, and README files.

The primary agent (usually Coder) can use the delegate_task tool to hand off sub-tasks. For example, after writing code, Coder might delegate to Reviewer for a code review before marking the task complete.

You can see which agent is active via the agent indicator in the chat header.