Overview
Understanding how Qoder CLI CN works helps you better predict its behavior, write more effective prompts, and control or correct it properly when needed.
At the core of Qoder CLI CN is an Agent: it receives your request, understands the intent, plans the steps, invokes tools to interact with your project and environment, and keeps adjusting its strategy based on the result of each step until the task is done. The whole process revolves around four elements working together — the Agent, tools, permissions, and context.
The Agent main loop
When Qoder CLI CN handles a request, it roughly goes through this loop:
- Receive the request: read your input and understand what you want to achieve, combined with the current context (conversation history, project instructions, memory).
- Plan the next step: the model decides what to do next — read files to understand the current state, search the code, edit directly, or run a command to verify.
- Invoke tools: the Agent performs concrete actions through tools, such as reading files, editing code, running Shell commands, searching code, or fetching web pages.
- Observe the result: feed the tool's result back into the context.
- Continue or finish: judge from the result whether the task is complete. If not, go back to step 2 and plan the next step; if complete, provide a summary.
You can use --max-turns to limit the maximum number of conversation turns per run, preventing infinite loops in automation scenarios.
Tools
The Agent itself only thinks and makes decisions; all actual operations on the outside world are performed through tools. Qoder CLI CN ships with a set of common tools:
- Files: read, write, and edit files; browse directories.
- Execution: run Shell commands.
- Search: search code by content (Grep), find files by name (Glob).
- Information: web search and web page fetching.
Permissions
Tool calls can have side effects — modifying files, running commands, accessing the network. To keep you in control at all times, Qoder performs a permission check before every tool call, with only three possible outcomes:
- allow: execute the tool immediately.
- ask: require confirmation before executing.
- deny: block the call.
ask differently: an interactive terminal pops up a confirmation prompt, headless (non-interactive) mode converts ask into a denial, and SDK and IDE integrations hand the decision over to the host program.
For a complete description of permission modes, rule configuration, and directory trust, see Permissions and Directory Trust.
Context
Qoder reconstructs the context for every session. The background information it relies on for decisions comes mainly from three layers:
- Conversation context: the history of messages, tool calls, and results in the current session. Context accumulates as the conversation goes on.
- Project instructions: static memory maintained by you or your team, such as
AGENTS.mdand rules, describing project structure, development standards, and collaboration conventions. - Long-term memory: information retained across sessions, including team conventions and optional auto-memory.