No results found.

Optimizing Agentic Coding: How to use Claude Code

Cem Dilmegani
Cem Dilmegani
updated on Nov 28, 2025

AI coding tools have become indispensable for many development tasks. In our tests, popular AI coding tools like Cursor have been responsible for generating over 70% of the code required for tasks. As AI agents are still in an early stage of maturity, several workflow patterns have emerged during product trials that can help optimize their usage.

Explore how to optimize these AI IDEs and analyze Cursor system prompts for agentic coding workflows.

How to develop an agentic coding approach?

Over recent months, coding workflows supported by AI tools have been systematically refined, particularly in the areas of vibe coding, rapid prototyping, and mid-level code editing. Various AI coding, including Claude, Cursor, Replit, and Codeium’s Windsurf Editor, were used and benchmarked.

The resulting agentic coding framework and associated workflows have proven consistently effective:

Optimizing agentic coding

When to apply this approach: This approach is not necessary for simple tasks like basic bug fixes, which can be solved with a straightforward prompt. For these situations, you can skip creating planning steps on your own and instead jump straight into the coding process execution mode after refining and accepting the plan by your AI code assistant.

1. Choosing what tools & platforms to use:

You can choose between AI-assisted code editors (agentic IDEs) and agentic command-line interfaces (agentic CLIs), depending on the level of automation, planning, and workflow orchestration required.

In addition, markdown files can be used to maintain project-specific guidelines and contextual information, while standard version-control platforms may optionally support code reviews and pull-request workflows.

2. Creating the plan

Claude proved the most effective planning environment, due to its contextual memory capabilities, task-delegation features, and read-only file exploration. During planning, Claude is used to:

  • Read files and examine code
  • Search through codebases
  • Analyze project structure
  • Gather information from web sources
  • Review documentation

Planning methodology:

Write clear and precise prompts: Clear and specific instructions improve contextual understanding. For instance, instead of requesting a generic UI design, specifying “a Linear-style app interface” yields more accurate outputs. Avoid sharing excessive information as it may lead to confusion instead.

Start new conversations regularly: Fresh sessions using /clear reduced prompt-drift and prevented context contamination from earlier tasks.

Make sure the AI assistant reads the docs: Prior to execution, the planning environment should read API references, framework guides, or architectural documentation. This step ensures that the subsequent plan aligns with accurate and up-to-date constraints.

3. Choosing the architecture

Choosing the right architecture is crucial for keeping the project structured.

In AI code editing, a flow-based architecture was used for most AI-driven code-editing tasks. This model organizes the system into discrete nodes, each responsible for a specific function, such as decision-making, file manipulation, code analysis, or code modification. Task progression between nodes occurs automatically.

The flow from one task to another is handled automatically. For example:

  • User input: Describing the type of website (e.g., a blog or e-commerce site).
  • Design node: AI generates layout based on user preferences.
  • Content generation node: Text and image generation based on inputs.
Source: Huang, Zachary1

For building scalable systems like screenshot-to-code tools, a service-oriented architecture (SOA) is recommended to be adopted. In this configuration, major components (e.g., UI extraction, code generation) can be scaled independently.

In this hybrid approach, the flow-based approach manages the flow of tasks across distinct nodes, where each node handles a specific function, such as screenshot to code generation. For instance:

  • UI extraction node processes the screenshot.
  • Code generation node converts the identified UI components into structured code.

4. Refining the plan

Once the initial plan has been generated, the refinement phase ensures alignment with overall project objectives. This phase typically includes the following steps:

  • Document key findings and context: All relevant contextual information, insights, and project constraints are documented by Claude. This lays out as a reference and helps to ensure necessary information is readily available during the coding process.
  • Create phase breakdown: After documenting the plan, I ask Claude to create a phase breakdown. This file (named phase.md) will list the distinct phases of the project.
  • Refine task lists: After the plan is documented, Claude generates a structured phase breakdown (phase.md), outlining the sequential development stages for the project.
  • Context and memory management: A dedicated memory.md document captures the current state of the project. This file functions as a continuity layer, especially when development is distributed across multiple working sessions.
  • Clarifying the plan: During refinement, Claude is prompted to surface any additional clarifying questions to validate the completeness and accuracy of the plan before implementation begins.

5. Coding process

The coding workflow relies on a task-based execution model supported by a consistent prompting structure.

Key components:

  • Project memory: The memory.md file, populated during the planning refinement process, is continuously updated to reflect the active state of the project.
  • Development guidelines: These are the rules that define how tasks should be approached (e.g., creating code).

Implement practices for coding:

  • Start with Phase 1: Start a fresh conversation for each task and ask Claude to handle the first step of the implementation. Create a plan.md file to track implementation phases.
  • Iterative testing: When coding begins, test the code after every task. If the code does not align with your implementation, share more context or modify the plan as needed. This may iterate 3-5 times to ensure the plan is solid.

    When Cursor asks whether to accept or reject after writing code. If everything is directly accepted, it could lead to mistakes. It provides an explanation for the changes it made, and you should read that and approve it if it makes sense; otherwise, reject it.
  • Prompt feedback loop: As coding progresses, try to avoid prompting “fix this”. Detail what went wrong and what should have happened.
  • Memory management: Use memory.md to store essential context and re-align past decisions during the coding process.
  • Updating documentation: After each task, make sure to update both plan.md and phases.md to track progress and the current state of the project.
  • Optional: Leveraging GitHub integration: You can also integrate GitHub with tools like Cursor and Cline to streamline code reviews, commit tracking, and pull requests. 

How agentic coding works in your AI IDE (e.g., Cursor)?

The diagram illustrates the underlying mechanics of AI IDEs. These systems streamline the process for the main agent by shifting the “cognitive load” to other LLMs. 

When working with these IDEs, the system first injects @-tags into the context, which helps the model know where to look for specific data or instructions. 

It then calls on multiple tools to gather additional context and information, such as analyzing code or reviewing documentation.

After this, the IDE makes the necessary changes to the code using a special “diff syntax.” This means instead of rewriting entire sections of code, only the changed parts are sent with a clear indication of what has been modified. Finally, the IDE provides a summary response to the user, detailing what was updated or changed.2

Limitations of this agentic coding approach:

  1. Loss of context over time: As the conversation progresses, Claude may lose critical context.
  2. Difficulty with open-ended questions: Asking open-ended or vague questions can lead to ambiguous responses.
  3. Dependence on consistent input: The approach heavily relies on clear, detailed prompts and consistent task breakdowns. Any lack of clarity or missed details in the planning or coding process can result in misalignment.
Principal Analyst
Cem Dilmegani
Cem Dilmegani
Principal Analyst
Cem has been the principal analyst at AIMultiple since 2017. AIMultiple informs hundreds of thousands of businesses (as per similarWeb) including 55% of Fortune 500 every month.

Cem's work has been cited by leading global publications including Business Insider, Forbes, Washington Post, global firms like Deloitte, HPE and NGOs like World Economic Forum and supranational organizations like European Commission. You can see more reputable companies and resources that referenced AIMultiple.

Throughout his career, Cem served as a tech consultant, tech buyer and tech entrepreneur. He advised enterprises on their technology decisions at McKinsey & Company and Altman Solon for more than a decade. He also published a McKinsey report on digitalization.

He led technology strategy and procurement of a telco while reporting to the CEO. He has also led commercial growth of deep tech company Hypatos that reached a 7 digit annual recurring revenue and a 9 digit valuation from 0 within 2 years. Cem's work in Hypatos was covered by leading technology publications like TechCrunch and Business Insider.

Cem regularly speaks at international technology conferences. He graduated from Bogazici University as a computer engineer and holds an MBA from Columbia Business School.
View Full Profile

Be the first to comment

Your email address will not be published. All fields are required.

0/450