Skip to content

The Deska blog

Ask the Agent What It Still Needs to Know

Improve AI coding results by learning how to ask the agent what it still needs to know before starting a complex task.

10 min read

Modern software development with AI has moved past simple completion. When you work with advanced tools, the most effective strategy is often to ask the agent what it still needs to know before it begins writing code. This shift from giving orders to initiating a dialogue ensures that the agent understands the full architectural context, existing patterns, and potential constraints of your specific project.

The Problem With Immediate Execution

Most developers are used to a linear workflow. You provide a prompt, and the agent attempts to fulfill it immediately. For small functions or standalone scripts, this works well. However, when dealing with a large codebase or a complex refactor, immediate execution leads to hallucinations or code that ignores project specific conventions.

The agent usually has a limited context window. Even if it can browse files, it might not know which ones are relevant to your specific business logic. By forcing the agent to pause and audit its own knowledge, you prevent wasted tokens and incorrect implementations. You are essentially asking the agent to perform a gap analysis on its own context.

Implementing the Inquiry Strategy

Instead of saying "Implement a new authentication middleware," try a two stage process. Start by describing the goal, then follow up with a specific request for the agent to list its missing information. This allows the agent to identify missing files, environment variables, or architectural decisions that you might have forgotten to mention.

A typical inquiry prompt might look like this:

"I want to migrate our database layer from Sequelize to Prisma. Before you generate any code or run any migrations, tell me what information you are missing regarding our current schema, deployment constraints, or custom types."

This approach forces the agent to analyze the current state of the workspace. It might ask to see the package.json to check versions, or look for specific configuration files in the root directory.

Managing Context in a Visual Workspace

One of the challenges of agentic workflows is keeping track of what the agent is actually looking at. When using tools like Deska, you can place terminals, code editors, and agent panels side by side. This visual organization helps you verify the information the agent claims to have.

If you are using coding agents like Claude Code or OpenCode, you can see their thoughts and file access logs in real time. If the agent asks for a specific file, you can open it in a Monaco editor panel next to the agent thread to verify the content yourself.

Key Benefits of the Ask First Approach

  • Higher accuracy: The agent spends more time analyzing and less time guessing.
  • Reduced technical debt: By knowing the patterns, the agent matches your existing style.
  • Security: You can catch instances where the agent might be looking for sensitive files before it processes them.
  • Cost efficiency: If you use pricing models based on tokens, avoiding re-runs saves significant resources.

Comparing Agentic Interaction Styles

Different tools handle context differently. Some IDE extensions index your entire project in the background, which is helpful but can sometimes feel like a black box. Other tools require manual file attachments. The following table compares how different interaction styles impact the need for this prompting technique.

Interaction StyleContext DiscoveryWhen to Ask What It Needs
Chat SearchVector index basedAlways, to ensure the index found the right files
Agentic CLIActive file system searchBefore any write operations or heavy refactoring
Manual AttachmentUser selected filesWhen the task spans multiple architectural layers
Visual CanvasSide by side panelsWhen coordinating between browser and terminal

In a local-first environment, the agent has direct access to your files, but it still needs guidance on where to focus its attention. Using the Ask Deska assistant can help bridge the gap by allowing you to drive the workspace via voice or chat to set up the necessary context for a specialized coding agent.

Structural Verification Before Execution

Once the agent lists what it needs, you should provide that information systematically. You might run a command in one of the terminals to show a directory structure or open a specific browser widget to show a third party API documentation.

If the agent asks for information that is currently running in a live session, you can use the workspace to show it. For example, if the agent needs to know the current state of a React component, you can keep the browser panel open and active while the agent analyzes the source code.

FAQ

How do I prompt an AI agent for a gap analysis?

You should explicitly instruct the agent to identify missing context before it performs any actions. Use a phrase like "List every file, variable, or architectural detail you need to see before you can complete this task with 100% accuracy."

Why does my coding agent keep making the same mistakes?

This usually happens because the agent is missing context about your project conventions. By asking the agent what it needs to know, you give it the opportunity to discover your eslint rules, tsconfig.json, or existing design patterns before it generates code.

Can I use this technique with local-first agents?

Yes. Even if the agent runs locally on your machine, it still operates within a context window. Asking it to verify its knowledge ensures it has pulled the right information from your local files into its active working memory.

Download Deska to Enhance Your Workflow

If you want to experiment with multi agent workflows in a flexible, infinite canvas, you can download Deska for free. It allows you to run multiple agents side by side while maintaining full control over your local files and environment. By organizing your work into workspaces, you can provide the visual and technical context these agents need to be successful.