Cline Tips & Prompts — AI Coding Assistant Guide

Cline is an autonomous AI coding assistant that runs inside VS Code, capable of reading files, writing code, executing terminal commands, and browsing the web — all to complete development tasks you describe in natural language. Unlike simpler code completion tools, Cline operates as an agent that plans and executes multi-step workflows. The key to using Cline effectively is understanding that it works best with clear task boundaries and explicit constraints. Instead of "refactor the auth system," try "Refactor the authentication middleware in src/middleware/auth.ts to use JWT tokens instead of session cookies. Update the login and logout routes accordingly. Do not modify any other routes or the database schema." Scope and boundaries prevent Cline from making well-intentioned but unwanted changes to unrelated files.

Custom instructions are Cline's most powerful configuration feature. You can set project-level instructions that tell Cline about your tech stack, coding conventions, testing requirements, and architectural patterns. A good custom instruction file might include: "This is a Next.js 14 project using TypeScript, Drizzle ORM, and Tailwind CSS. Always use server components by default. Use the cn() utility for conditional classes. Write tests using Vitest. Follow the existing file naming conventions in the codebase." These instructions persist across sessions and dramatically improve code quality because Cline follows your project's patterns instead of its own defaults.

Cline supports multiple AI model backends — Claude, GPT-4, and others — so you can choose the model that works best for different tasks. Claude tends to produce better results for complex refactoring and architectural changes, while faster models work well for simple edits and boilerplate generation. For workflow optimization, use Cline's auto-approval settings carefully: approve file reads automatically but require approval for writes and terminal commands until you trust the agent with your specific codebase. Save your best task descriptions and custom instruction configurations in a prompt library, so setting up Cline on a new project takes minutes instead of trial-and-error experimentation.

Copy-Paste Cline Prompts

Ready-to-use prompts for Cline. Copy, customize the {{variables}}, and paste into the Cline chat panel.

Task Decomposition

I need to implement {{feature_name}}. Before writing any code, break this into a step-by-step plan:

1. List every file that needs to be created or modified
2. For each file, describe what changes are needed (be specific — not "update the component" but "add a new prop called X and render it in the header")
3. Identify the order of operations — which changes depend on others?
4. Note any potential risks or side effects

Context:
- Tech stack: {{tech_stack}}
- Relevant existing files: {{relevant_files}}
- Requirements: {{requirements}}

Present the plan and wait for my approval before making any changes. I may want to adjust the scope or approach before you start.
feature_nametech_stackrelevant_filesrequirements

Why it works: Forces Cline to plan before executing, which prevents it from going down the wrong path and making changes you need to undo. The explicit 'wait for approval' instruction is critical for complex tasks.

Targeted File Editing

Edit {{file_path}} to {{change_description}}.

Specific changes:
- In the {{section_name}} section (around line {{line_number}}), {{edit_1}}
- {{edit_2}}
- {{edit_3}}

Constraints:
- Do NOT modify any other functions or exports in this file
- Do NOT change the import statements unless the new code requires a new import
- Do NOT reformat or re-indent code you didn't change
- Preserve all existing comments

After making the changes, show me a summary of exactly what was modified (like a diff).
file_pathchange_descriptionsection_nameline_numberedit_1edit_2edit_3

Why it works: Pinpoints the exact location and scope of each edit. The explicit constraints prevent Cline from reformatting the entire file or making 'helpful' but unwanted adjacent changes.

Terminal Command Execution

Run the following commands to {{goal}}:

1. {{command_1}}
2. {{command_2}}
3. {{command_3}}

For each command:
- Show me the command before running it
- If the command fails, show the error output and suggest a fix before retrying
- Do NOT run the next command until the previous one succeeds

If any command requires user input or confirmation, pause and ask me.

Environment notes:
- Working directory: {{working_directory}}
- OS: {{operating_system}}
- Required tools already installed: {{installed_tools}}
goalcommand_1command_2command_3working_directoryoperating_systeminstalled_tools

Why it works: Sequential execution with error handling prevents Cline from blindly running a chain of commands where a failure in step 1 makes step 2 destructive. The pause instruction gives you control.

Context Management

Before starting, read these files to understand the context:

1. {{file_1}}{{why_file_1}}
2. {{file_2}}{{why_file_2}}
3. {{file_3}}{{why_file_3}}

After reading, confirm your understanding by answering:
- What is the purpose of each file?
- How do they relate to each other?
- What patterns/conventions do they follow?

Then, using this context, {{task_description}}.

Important: The code you write must follow the same patterns you observed in the existing files — same naming conventions, same error handling style, same import patterns. If you're unsure about a convention, ask rather than guessing.
file_1why_file_1file_2why_file_2file_3why_file_3task_description

Why it works: Pre-loading context files and verifying comprehension ensures Cline understands the existing patterns before writing new code. This produces consistent output that matches your codebase.

Approval Workflow

I want to {{overall_goal}}. Work through this incrementally:

Phase 1: {{phase_1_description}}
- Make the changes for phase 1
- Show me what you changed (file-by-file summary)
- STOP and wait for my approval before proceeding

Phase 2: {{phase_2_description}}
- Only start after I approve phase 1
- Show changes and wait for approval

Phase 3: {{phase_3_description}}
- Only start after I approve phase 2
- Show changes and wait for approval

Rules:
- Never combine phases — one at a time
- If you encounter an issue in any phase, stop and explain it instead of working around it
- Each phase should be independently functional (the app shouldn't break between phases)
- If I say "revert phase N", undo only that phase's changes
overall_goalphase_1_descriptionphase_2_descriptionphase_3_description

Why it works: Phased execution with approval gates gives you control over complex multi-step tasks. Each phase being independently functional means you can stop at any point with a working codebase.

Custom Instructions Template

# Project Custom Instructions for Cline

## Tech Stack
- Framework: {{framework}}
- Language: {{language}} (strict mode)
- Styling: {{styling}}
- Database: {{database}}
- ORM: {{orm}}

## Code Conventions
- File naming: {{file_naming_convention}}
- Component pattern: {{component_pattern}}
- State management: {{state_management}}
- Error handling: Always use try/catch, never swallow errors silently

## Rules
- Never use `any` type — find or create the proper type
- Always add JSDoc comments for exported functions
- Never modify files outside the scope of the current task
- Run {{lint_command}} after any code change
- Prefer editing existing files over creating new ones
- Ask before installing new dependencies

## Project Structure
{{directory_structure_summary}}
frameworklanguagestylingdatabaseormfile_naming_conventioncomponent_patternstate_managementlint_commanddirectory_structure_summary

Why it works: A comprehensive custom instructions file acts as a persistent context for every Cline session. Paste this into Cline's custom instructions setting and it will follow your conventions automatically.