Getting Started with AI Coding Tools: Four Modes Explained and First-Time Configuration
This guide explains why a local AI coding tool starts with a disabled message box, walks through the correct first-time setup order, and compares four operating modes by autonomy level and scope of action. You will learn how to bind a workspace, inject model credentials safely, verify the setup with a minimal task, and choose the right mode for exploration, implementation, or batch execution. It also includes a troubleshooting checklist and guardrails for high-autonomy agent runs.
1. Why the Message Box Is Disabled on First Launch
Many developers see the same screen the first time they start a local AI coding tool: the chat area renders, but the input bar is disabled, and a banner at the top asks you to “select a workspace.” After clicking it, you are prompted to “add an API key to get started.” This is easy to mistake for a bug or a version problem, but it is a required precondition by design.
The reason is that this kind of tool differs fundamentally from a regular online chat product. It is not just a Q&A window; it is an agent runtime that needs to read and write local files, execute commands, and call model services. Until three things are in place, it cannot operate safely:
- Workspace directory: defines the boundary for file access and command execution, preventing out-of-scope access;
- Model access credentials (API key): determine which model service provides inference, along with quota and billing ownership;
- Runtime and permission policy: determine which actions run automatically and which require human confirmation.
So the “disabled” state is protective feedback, not a defect. Once that is clear, the setup order follows naturally: establish the workspace first, add credentials second, then adjust modes and permissions.
2. The Correct First-Run Order
2.1 Select and Bind a Workspace
Once you pick a local directory, it becomes the working location for the current session and the input bar unlocks. Avoid selecting your home directory or a disk root. Create a dedicated directory instead, for example:
~/workspace/demo-agent/├── src/├── tests/├── docs/└── .agent/└── config.example.yaml # commit the sanitized template only
This has three benefits: the permission scope is minimal, so mistakes stay contained; it aligns naturally with version control, so changes can be audited via diffs; and it makes switching context between projects quick.
2.2 Configure Model Access Credentials
Inject credentials through environment variables or a local config file that is excluded from version control, rather than hardcoding them into source:
export MODEL_API_KEY="<your-key>"export MODEL_BASE_URL="<your-endpoint>"
The committed config file keeps placeholders only, while real values go into an ignored local file:
# .agent/config.example.yamlmodel:api_key: ${MODEL_API_KEY}base_url: ${MODEL_BASE_URL}temperature: 0.2workspace:root: ./ # relative to the workspace rootallow_write: truepermissions:auto_run: false # commands require human confirmation by default
Credentials only answer “can I call the model.” They do not mean “anything can be executed.” Keeping auto-run off by default and leaving destructive commands to human confirmation is the safer starting point.
2.3 Verify Connectivity With a Minimal Task
After configuration, validate the chain with one small task, such as having the tool read a file and summarize its key points. If it fails, troubleshoot layer by layer in this order: credentials, network, workspace path, permission policy. This usually pinpoints the issue within a minute.
3. What Actually Differs Between the Four Modes
Naming varies across tools, but abstracting along two dimensions, autonomy level and scope of action, yields four common categories. Understanding these two dimensions is more valuable than memorizing specific names.
| Mode | Autonomy | Scope | Typical Use | Main Risk |
|---|---|---|---|---|
| Chat Q&A | Lowest | No side effects | Concept clarification, solution discussion | Conclusions may drift from the actual code |
| Code Explanation | Low | Read-only | Reading an unfamiliar project, mapping legacy systems | Misjudgment from insufficient context |
| Edit Collaboration | Medium | Single file or small-scope writes | Refactoring, adding tests, fixing defects | Missing cross-file dependencies |
| Agent Execution | Highest | Multiple files plus commands | End-to-end tasks, batch changes | Accidental deletion, privilege escalation, dependency pollution |
3.1 Chat Q&A: Align on the Problem Before Touching Code
This mode produces no file side effects and is suited to turning a vague requirement into an actionable description. Its value is low-cost trial and error: you can have the tool output an implementation approach, edge cases, and alternatives, confirm them, and only then move to writing code. The limitation is that it cannot see the full repository context, so its conclusions need validation against real code.
3.2 Code Explanation: Read-Only Analysis to Build a Global Picture
With an unfamiliar repository, having the tool first map directory responsibilities, module dependencies, and key call chains is far safer than letting it change code right away. The read-only nature means zero write risk, making it a good fit for onboarding, code review support, and incident triage. The key is to provide a clear entry point, such as a specific file or function, instead of asking vaguely “what does this project do.”
3.3 Edit Collaboration: Small Steps, Reviewable Changes
This is the most frequently used mode day to day. It can modify files within a controlled scope and fits refactoring, adding unit tests, and fixing well-defined defects. The key practice is to keep tasks small, focus each change, and land every round on a revertible commit:
git switch -c fix/parse-timeout# after one round of changesgit diff --stat && git add -p && git commit -m "fix: handle parse timeout"
Combined with test-driven work, adding a failing case before fixing the implementation significantly reduces the chance of “looks right, fails at runtime.”
3.4 Agent Execution: High Autonomy Needs Guardrails
This mode can modify multiple files and run commands, fitting end-to-end tasks such as batch migrations, scaffolding, and dependency upgrades. The payoff is largest and so is the risk, so guardrails are mandatory: run in a branch or an isolated container, restrict writable directories, forbid automatic execution of destructive commands, whitelist external network access, and inject secrets via environment variables rather than committing them. When the task finishes, accept it with both diffs and test results, not just the tool’s output description.
4. How to Choose: A Reusable Decision Path
- The requirement is not clear yet: start with Chat Q&A to align on the goal and acceptance criteria;
- The codebase is unfamiliar: switch to read-only Code Explanation and map dependencies and call chains first;
- The goal is clear and the scope is contained: use Edit Collaboration for small changes, one commit per step;
- The task spans multiple files and can be verified automatically: escalate to Agent Execution, keeping human confirmation points throughout.
A common mistake is using the highest-autonomy mode the whole time, which amplifies context noise and makes changes hard to review. A more effective rhythm is “low-autonomy exploration, medium-autonomy implementation, high-autonomy batch processing,” with a wrap-up at the end of each stage.
5. FAQ and Troubleshooting Checklist
- Input bar stays disabled: check whether a workspace is bound and whether credentials were injected successfully;
- Read works but write does not: confirm write permissions and the directory whitelist configuration;
- Changes deviate from expectations: add a project conventions file describing the tech stack, directory standards, and test commands;
- Context is drowned out by irrelevant files: use ignore rules to exclude build artifacts, dependency directories, and logs;
- Results are inconsistent: lower the randomness parameter and split large tasks into small, verifiable ones.
6. Summary
The key to getting started is not memorizing mode names but grasping the two dimensions of autonomy level and scope of action: complete the minimal workspace and credential setup first, then raise autonomy step by step in the order of exploration, implementation, and batch processing, always using version control and automated tests as the acceptance baseline. If model services are hosted on a cloud platform such as Baidu AI Cloud, credential management, permission isolation, and log auditing should likewise follow the least-privilege principle, keeping the tool productive within controllable boundaries.
