Overview
Understanding how Qoder CLI works helps you better predict its behavior, write more effective prompts, and properly control and correct it when needed.
At its core, Qoder CLI is an Agent: it receives your requests, understands the intent, plans the steps, calls tools to interact with your project and environment, and continuously adjusts its strategy based on the results of each step until the task is complete. The entire process is driven by the collaboration of four core elements: the Agent, tools, permissions, and context.
Agent Main Loop
When Qoder CLI processes a request, it generally goes through the following loop:
- Receive request: Reads your input and combines it with the current context (Conversation History, project instructions, Memory) to understand what you want to achieve.
- Plan the next step: The model decides what to do next—whether to read a file to understand the current state, search the codebase, make direct modifications, or run a command for verification.
- Call tools: The Agent executes specific actions through tools, such as reading files, editing code, executing shell commands, searching code, or retrieving web pages.
- Observe results: Incorporates the results returned by the tools back into the context.
- Continue or finish: Determines whether the task is complete based on the results. If not, it returns to step 2 to plan the next step; if complete, it provides a summary.
You can use --max-turns to limit the maximum number of Conversation Turns for a single run, preventing infinite loops in automated scenarios.
Tools
The Agent itself is only responsible for thinking and decision-making; all actual operations on the external world are performed through tools. Qoder CLI includes a set of commonly used Built-in Tools:
- File operations: Read, write, and edit files, and browse directories.
- Execution: Run shell commands.
- Search: Search code by content (Grep) and find files by name (Glob).
- Information: Web search and Web Scraping.
Permissions
Tool calls may have side effects—modifying files, running commands, or accessing the network. To ensure you always remain in control, Qoder performs a permission check before every tool call. The outcome falls into one of three categories:
- allow: Execute the tool immediately.
- ask: Require confirmation before execution.
- deny: Block the call.
ask differently: an interactive terminal will prompt you for confirmation, non-interactive (Headless) mode will convert ask to a denial, and SDK and IDE integrations will delegate the decision to the Host Program.
For a complete explanation of permission modes, rule configurations, and directory trust, see Permissions.
Context
Qoder reconstructs the context for each session. The background information it relies on for decision-making primarily comes from three levels:
- Conversation Context: Historical messages, tool calls, and results within the current session. As the conversation progresses, the context continuously accumulates.
- Project instructions: Static memory maintained by you or your team, such as
AGENTS.mdand rules, which describe the project structure, development standards, and collaboration conventions. - Long-term memory: Information retained across sessions, including team conventions and optional Auto-Memory.