AI Coding Tip 003 - Force Read-Only Planning

Written by mcsee | Published 2026/01/17
Tech Story Tags: ai-coding | clean-code | ai-coding-tips | ai-coding-assistants | hackernoon-top-story | force-read-only | read-only-planning-cyclr | ai-coding-help

TLDRSet your AI code assistant to read-only state before it touches your files.via the TL;DR App

Think first, code later

TL;DR: Set your AI code assistant to read-only state before it touches your files.

Common Mistake โŒ

You paste your failing call stack to your AI assistant without further instructions.

The copilot immediately begins modifying multiple source files.

It creates newย issuesย because it doesn't understand your full architecture yet.

You spend the next hour undoing its messy changes.

Problems Addressed ๐Ÿ˜”

The AI modifies code that doesn't need changing.

The copilot starts typing before it reads the relevant functions.

The AI hallucinates when assuming a library exists without checking yourย package.json.

Large changes make code reviews and diffs a nightmare.

How to Do It ๐Ÿ› ๏ธ

Enter Plan Mode: Use "Plan Mode/Ask Mode" if your tool has it.

If your tool doesn't have such a mode, you can add a meta-prompt

Read this and wait for instructions / Do not change any files yet.

Ask the AI to read specific files and explain the logic there.

After that, ask for aย step-by-stepย implementation plan for you to approve.

When you like the plan, tell the AI: "Now apply step 1."

Benefits ๐ŸŽฏ

Better Accuracy: The AI reasons better when focusing only on the "why."

Full Control: You catch logic errors before they enter your codebase.

Lower Costs: You use fewer tokens when you avoid "trial and error" coding loops.

Clearer Mental Model: You understand the fix as well as the AI does.

Context ๐Ÿง 

AI models prefer "doing" over "thinking" to feel helpful. This is calledย impulsive coding.

When you force it into a read-only phase, you are simulating a Senior Developer's workflow.

You deal with the Artificial Intelligence first as a consultant and later as a developer.

Prompt Reference ๐Ÿ“

Bad prompt ๐Ÿšซ

Fix the probabilistic predictor
in the Kessler Syndrome Monitor component 
using this stack dump.

Good prompt ๐Ÿ‘‰

Read @Dashboard.tsx and @api.ts. Do not write code yet.

Analyze the stack dump.

When you find the problem, explain it to me.

Then, write a Markdown plan to fix it, restricted to the REST API..

[Activate Code Mode]

Create a failing test representing the error.

Apply the fix and run the tests until all are green

Considerations โš ๏ธ

Some simple tasks do not need a plan.

You must actively read the plan the AI provides.

The AI might still hallucinate the plan, so verify it.

Type ๐Ÿ“

[X] Semi-Automatic

Limitations โš ๏ธ

You can use this for refactoring and complex features.

You might find it too slow for simple CSS tweaks or typos.

Some AIs go the other way around, beingย too confirmativeย before changing anything. Be patient with them.

Tags ๐Ÿท๏ธ

  • Complexity

Level ๐Ÿ”‹

[X] Intermediate

Request small, atomic commits.

Conclusion ๐Ÿ

You save time when you think.

You must force the AI to be your architect before letting it be your builder.

This simple strategy prevents hours of debugging later. ๐Ÿง 

More Information โ„น๏ธ

https://github.blog/ai-and-ml/github-copilot/copilot-ask-edit-and-agent-modes-what-they-do-and-when-to-use-them/?embedable=true

https://www.thepromptwarrior.com/p/windsurf-vs-cursor-which-ai-coding-app-is-better?embedable=true

https://aider.chat/docs/usage/modes.html?embedable=true

https://opencode.ai/docs/modes/?embedable=true

Also Known As ๐ŸŽญ

Read-Only Prompting

Consultant Mode

Tools ๐Ÿงฐ

Tool

Read-Only Mode

Write Mode

Mode Switching

Open Source

Link

Windsurf

Chat Mode

Write Mode

Toggle

No

https://windsurf.com/

Cursor

Normal/Ask

Agent/Composer

Context-dependent

No

https://www.cursor.com/

Aider

Ask/Help Modes

Code/Architect

/chat-mode

Yes

https://aider.chat/

GitHub Copilot

Ask Mode

Edit/Agent Modes

Mode selector

No

https://github.com/features/copilot

Cline

Plan Mode

Act Mode

Built-in

Yes (extension)

https://cline.bot/

Continue.dev

Chat/Ask

Edit/Agent Modes

Config-based

Yes

https://continue.dev/

OpenCode

Plan Mode

Build Mode

Tab key

Yes

https://opencode.ai/

Claude Code

Review Plans

Auto-execute

Settings

No

https://code.claude.com/

Replit Agent

Plan Mode

Build/Fast/Full

Mode selection

No

https://replit.com/agent3

Disclaimer ๐Ÿ“ข

The views expressed here are my own.

I am a human who writes as best as possible for other humans.

I used AI proofreading tools to improve some texts.

I welcome constructive criticism and dialogue.

I shape these insights through 30 years in the software industry, 25 years of teaching, and writing over 500 articles and a book.


This article is part of theย AI Coding Tipย series.


Written by mcsee | Iโ€™m a sr software engineer specialized in Clean Code, Design and TDD Book "Clean Code Cookbook" 500+ articles written
Published by HackerNoon on 2026/01/17