How to Use AI Coding Assistants: 6 Habits That Actually Boost Your Productivity

    If you have installed an AI coding tool and learned the shortcuts but still find that AI only autocompletes a few lines of code each day, the problem is usually your approach, not the tool. Based on a 25-chapter AI coding usage guide compiled from real engineering practice, this article distills six battle-tested habits: choosing models by total cost rather than per-unit price, planning before coding, reviewing the plan before letting the AI run, doing context engineering so the model understands your project, building an "AI writes, machine tests, human reviews" verification loop, and dividing labor between humans and AI. It includes practical templates, cost formulas, sample prompts, project instruction files, verification scripts, and a step-by-step adoption roadmap for beginners. The goal is to use AI in an engineering-driven way instead of working by feel.

    Introduction: Having the Tool Installed Is Not the Same as Using It Well

    Have you ever had this experience? You have installed the AI coding tool and memorized the shortcuts, yet by the end of the day the work AI has actually taken over is still just autocompleting a few lines of code. The problem usually lies not in the tool itself, but in how you use it.

    An industry AI coding usage guide, compiled by the lead of a smart coding tool based on everyday practice, runs to 25 chapters. The most valuable takeaways for beginners are not any particular shortcut or parameter, but a handful of habits that have been repeatedly validated. This article distills 6 core habits from it and expands on each with engineering practice in mind. The cited points are paraphrased from the original; the accompanying examples are illustrative, and for specific usage please refer to the documentation of the tool you use.

    1. Calibrate Your Expectations: AI Coding Is “Collaboration,” Not “Ghostwriting”

    Poor efficiency gains often come from misplacing the tool. Three common mindsets stand out:

    • The ghostwriting mindset: You fire off a single sentence and expect perfect code in one shot. When the direction is slightly off, you fall into a loop of “revise, then revise again.”
    • The spectator mindset: You watch the tool produce code line by line without taking part in the design or preparing to verify the output. You neither learn anything nor save any time.
    • The omniscient mindset: You assume AI already knows your project structure, tech stack, and team conventions. Once the context is missing, it can only “guess”—and the more it guesses, the more mistakes it makes.

    The correct positioning is to treat AI as a collaborator who needs clear task instructions, whose work you must review, and who will make mistakes. The clearer the context you provide, the less rework you face; the more solid your verification, the more room you have to let go with confidence.

    2. Habit 1: Choose Models by Total Cost, Not by Unit Price

    1. The point: The most expensive model is often the most cost-effective

    Many people assume that “more capable models are expensive, so a cheaper one is good enough for daily use.” This intuition does not hold up on the calculator. Looking only at the per-call unit price, a stronger model is indeed more expensive; but if a task requires multiple rounds of conversation to complete, the real cost is the cumulative consumption across every round.

    For example, fixing a bug: a weaker model fails to fix it correctly across several attempts, and every round has to re-carry the context (code snippets, error messages, conversation history), so token consumption keeps accumulating. If a stronger model fixes it in one pass, the total consumption may actually be lower.

    More importantly, tokens are only part of the cost. Two other costs are equally impossible to ignore:

    1. The time cost of rework: With every extra round trip, you have to read through the changes once and describe the problem again;
    2. The risk cost of error propagation: A wrong fix may quietly affect other modules, and the cost of tracking that down far outweighs the call fees you saved.

    2. How to do it: Account for “total cost” and tier your model usage

    Use the following formula to roughly estimate the total cost of a task:

    1. Total cost = Σ(input tokens per round × input price + output tokens per round × output price)
    2. + manual review and rework time × hourly rate
    3. + risk cost from defects that slip through

    At the same time, tier your model choice by task type:

    Task type Examples Recommended strategy
    High difficulty Complex bug localization, cross-module refactoring, architecture design Prioritize the most capable model
    Medium difficulty Single feature development, adding unit tests Default to the strong model; switch to a lightweight one in simple cases
    Low difficulty Copy edits, formatting, minor tweaks Lightweight models are fine, to save cost

    To understand this, first recognize the mechanism of “rework amplification.” The longer the context and the later a change is caught, the more expensive a single correction becomes: the model has to re-understand the goal, and you have to re-check the diff. Many remote development environments support creating multiple isolated workspaces, each running on a different branch, precisely so that each task proceeds independently in a clean environment. The more workspaces you accumulate, the more consumption adds up. Getting the task right in one pass with a strong model—and opening fewer branches—actually lowers the total cost.

    In addition, different tools bill differently for input, output, and cached context. Before choosing, read the billing rules carefully, then run a small, low-cost comparison on a real task; that is more reliable than judging by feel. If you call model services through a cloud platform (such as Baidu AI Cloud’s model services), you can use the platform’s usage and cost monitoring to continuously track the real cost performance of different models.

    3. Habit 2: Plan Before You Code—Start Most Tasks in Plan Mode

    1. The point: Planning is the cheapest place to catch mistakes

    A saying widely circulated in practice goes: “Spending 30 minutes on structured planning can often turn a 10-hour build into a 3-hour one.” Viewed through the classic software engineering defect-cost curve, this is no exaggeration: problems found in the requirements and design phase cost far less to fix than rework after coding is complete. This is exactly where the value of plan mode lies:

    • What plan mode produces is a written description, which costs almost nothing to change when the direction is wrong;
    • Once you enter the coding phase, errors have already been committed across multiple files, and adjusting course then carries a real rework cost.

    2. How to do it: A good plan should contain at least seven items

    Most AI coding tools offer a plan mode, usually toggleable via a shortcut. Its feature is to present an implementation approach for your confirmation before actually changing any code. Here is a plan template you can apply directly:

    1. ## Requirement understanding
    2. Restate the goal in one or two sentences, and list uncertain points that need confirmation
    3. ## Scope of impact
    4. - Files involved: (list by directory, marking the type of change)
    5. - Dependent modules:
    6. ## Implementation steps
    7. 1. ... (each step maps to one small, verifiable change)
    8. 2. ...
    9. ## Edge cases and exceptions
    10. - How to handle empty input, timeouts, concurrency, insufficient permissions, etc.
    11. ## Verification plan
    12. - Tests to add/modify:
    13. - Manual verification path:
    14. ## Risks and rollback
    15. - Existing features that may be affected:
    16. - How to roll back if something goes wrong:

    Conversely, “write me a login feature” produces poor results because the goal, constraints, and acceptance criteria are all missing. The vaguer the requirement, the more room the model has to improvise, and the higher the chance of rework. An improved version might read:

    1. Add a login endpoint on top of the existing user module:
    2. 1. Use the auth component already present in the tech stack; do not introduce a new framework;
    3. 2. Store passwords as salted hashes; never store plaintext;
    4. 3. Return a unified message on login failure to avoid revealing whether an account exists;
    5. 4. Before making changes, list the files involved and the implementation steps, and wait for my confirmation before writing code;
    6. 5. After completion, add unit tests covering three cases: successful login, wrong password, and account not found.

    A reminder: not everything needs a plan. Small tasks like “edit the copy” or “adjust one parameter” can be executed directly. A reasonable principle is: the larger the surface of change and the stronger the irreversibility, the more worthwhile it is to plan first.

    4. Habit 3: Review the Plan First, Then Let It Run

    1. The point: Reviewing upfront is what lets you relax later

    Many people’s habit is to confirm the AI’s output segment by segment while it writes code. It looks responsible, but it actually overestimates the human capacity for sustained attention. Staring at the screen line by line is not only tiring but also slows you down in an invisible way.

    A more reasonable approach is to “review strictly during planning, and let go moderately during execution.” Practitioners’ experience is that once the plan is confirmed correct, you let the model execute and automatically accept edits, and a capable model can usually get it right in one pass. But note the prerequisites: the plan has been reviewed thoroughly, the model is capable enough, the task runs in an isolated environment, and verification means are already in place.

    2. How to do it: Build three “guardrails” before letting go

    • Environment isolation: Run in a separate branch or a separate workspace, and restrict the accessible directory scope, so that the model’s changes cannot directly touch the production environment.
    • Tightened permissions: Disable unnecessary system commands; for high-risk operations such as deletion, data migration, or changes to production configuration, always insist on manual confirmation.
    • Revertible changes: Commit once after completing each small, verifiable step, so that if something goes wrong you can quickly roll back to the last known-good state.

    With all three guardrails in place, you can confidently turn on auto-accept. But “letting go” does not mean “not paying attention”: after execution finishes, you still need to review the full diff and run the verification process.

    If your workflow already uses a version control system, you can also use the commit history for finer-grained review. Here is a conceptual example; the implementation varies with the tool you use:

    1. # Convention: AI-generated commits start with [AI] in the commit message
    2. log=$(git log --grep='^\[AI\]' --oneline --no-merges)
    3. if [ -n "$log" ]; then
    4. echo "AI-generated commits detected; review them one by one before merging:"
    5. echo "$log"
    6. fi

    5. Habit 4: Do Context Engineering So the Model “Understands” Your Project

    1. The point: The quality of AI output depends on the quality of your input

    AI does not natively understand your project. The project structure, tech stack, coding conventions, and business constraints all need to be provided proactively—this is “context engineering.” Doing it well breaks into three layers:

    1. Static context: Long-term, unchanging information such as team conventions, project structure, and common commands, which is best written into a project documentation file so the tool loads it automatically each time;
    2. Dynamic context: Code files, error logs, and API docs relevant to the current task, provided selectively as needed;
    3. External context: Via external tools or scripts, letting AI run tests, query data, and read logs.

    2. How to do it: A high-quality project instruction file

    The example below can serve as a skeleton for a project-root documentation file (the filename and loading method vary by tool):

    1. # Project guide (for AI to read)
    2. ## Tech stack and versions
    3. - Language/framework and version:
    4. - Package manager:
    5. ## Directory structure
    6. - src/: business code
    7. - tests/: unit tests
    8. ## Coding conventions
    9. - Function naming: snake_case
    10. - Exception handling: the business layer must not swallow exceptions; route them to a global handler for a unified response
    11. ## Common commands
    12. - Install dependencies: <command>
    13. - Run tests: <command>
    14. - Lint: <command>
    15. ## Prohibited actions
    16. - Do not modify legacy modules under src/legacy/
    17. - Do not add third-party dependencies that have not been reviewed
    18. - Do not commit secrets, config files, or other sensitive information
    19. ## Commit conventions
    20. - Commit message format: <type>: <description>

    When writing rules, follow three principles:

    • Specific and actionable: “Write clean code” is meaningless, whereas “keep functions under 50 lines; split them if they exceed that” is actionable;
    • Concise first: The longer the instruction file, the more easily the model loses the key points, so keep it within what is necessary;
    • Continuously maintained: Update the conventions as the project evolves, to avoid giving outdated information.

    3. Watch out for two common anti-patterns

    • Information overload: Stuffing the entire project’s code into the context at once. This not only slows down responses and drives up cost, but also drowns out the weight of key information. The right approach is to reference the relevant files precisely per task.
    • Repeated clarification: Not stating the background clearly before the task begins, and only discovering the direction is wrong several rounds into execution. Beyond making good use of plan mode, you can also add new information at any point in the conversation, for example, “this project uses framework X, version x.y.”

    6. Habit 5: Build a Verification Loop of “AI Writes, Machine Tests, Human Reviews”

    1. The point: Without verification, AI-written code is not done

    Between AI-generated code that “looks correct” and code that “is actually correct” lies a verification chain. A sound loop is:

    1. AI writes: Generates code or a modification plan;
    2. Machine tests: An automated pipeline performs static checks, unit tests, and integration tests;
    3. Human reviews: The developer reviews the key changes and edge cases;
    4. Feedback: When a test fails or a review finds a problem, hand the complete failure information back to the AI to keep fixing.

    In this loop, what the AI handles each round is clear, reproducible failure information, rather than a vague “this doesn’t seem right here.” The more complete the feedback, the higher the accuracy of the fix.

    2. How to do it: Make the verification script the AI’s “referee”

    Provide a unified verification script in the project that the AI can run on its own after each step:

    1. #!/usr/bin/env bash
    2. # verify.sh: a unified local verification entry point
    3. set -euo pipefail
    4. echo "[1/3] Formatting and static checks"
    5. <command to run the linter>
    6. echo "[2/3] Unit tests"
    7. <command to run the tests>
    8. echo "[3/3] Change overview"
    9. git --no-pager diff --stat
    10. echo "Verification passed"

    Alongside it, require the AI to follow “test-first“:

    1. For this change:
    2. 1. First add a failing test that reproduces the problem (or covers the new feature);
    3. 2. Then modify the implementation code until all tests pass;
    4. 3. Finally run verify.sh to confirm that all checks and tests pass;
    5. 4. Output a summary of the changes, listing what was changed in each file and why.

    If the project does not yet have automated tests, it is advisable to build up the “verification capability” first before scaling out AI usage. Otherwise, AI-produced code can only be confirmed by manually reading it line by line, and any efficiency gain is out of the question. If the project runs in the cloud, you can also use cloud monitoring, logging services, and other infrastructure to continuously observe the real behavior of changes after they go live.

    7. Habit 6: Define the Human–AI Division of Labor; Ship in Small Steps, Review Continuously

    1. The point: Humans own the “why,” AI owns the “how”

    AI excels at quickly producing implementation approaches, boilerplate code, and test cases. Developers, on the other hand, should focus their energy on:

    • Clarifying requirements and making value judgments;
    • Architecture and key design decisions;
    • Overseeing non-functional constraints such as security, compliance, and performance;
    • Reviewing and taking responsibility for the final result.

    In one sentence: humans set the direction, implementation can be handed to AI, but responsibility always stays with the human.

    2. How to do it: Three concrete practices

    • Break tasks down small: Each task should map to a single, independent, verifiable change rather than generating an entire module at once. The smaller it is, the easier the review and the lower the cost of rolling back.
    • Commit conventions: Commit in batches by logical unit, writing “what changed and why” in the commit message to make it easy to trace.
    • Periodic retrospectives: Each week, review which tasks AI did well and which it often got wrong, then adjust the division-of-labor boundary accordingly—even feeding rules back into the project instruction file.

    8. Adoption Roadmap: How Beginners Can Progress Step by Step

    Stage Time Key actions Acceptance criteria
    Onboarding Week 1 Get familiar with plan mode, permission settings, and auto-accept; complete 3 small tasks Can independently write a structured plan
    Standardization Weeks 2–3 Write the project instruction file; integrate a unified verification script AI understands project conventions without repeated follow-up questions
    Efficiency boost Week 4 onward Take on medium-complexity feature development and bug fixes; evaluate model choice by total cost Most tasks pass verification in one go after plan confirmation

    Note that task time varies from person to person, and the time in the table above is only a reference pace. What matters is whether each stage meets its acceptance criteria, not racing against the schedule.

    Conclusion

    Looking back at these 6 habits, they all point to the same main thread: use AI in an engineering-driven way, not by feel.

    • Choose models by total cost;
    • Plan first for complex tasks;
    • Let go and execute after the plan is confirmed;
    • Use context to make the model understand the project;
    • Use a verification loop to guarantee quality;
    • Use a clear division of labor to hold the line on responsibility.

    The tool is only an amplifier. Whether it amplifies good habits or bad ones depends on the person using it. For beginners, rather than rushing to memorize shortcuts, it is better to get this whole approach working first.