The Deska blog
Agents in a Repo Heavy With Binary Assets
Learn strategies for managing AI agents in a repo heavy with binary assets while maintaining context window efficiency and performance.
11 min read
Managing AI agents in a repo heavy with binary assets presents a unique set of challenges for modern development workflows. When a project contains large textures, compiled binaries, PDFs, or media files, the automated reasoning of an LLM can easily become bogged down by noise. The core issue lies in how these agents index and traverse the file system. If an agent attempts to parse or summarize a 500MB blob as if it were source code, it wastes tokens, increases latency, and frequently hits context limits. This guide explores technical strategies to keep your agents lean and effective when working alongside heavy assets.
The Problem With Binary Blobs and AI Context
Large Language Models (LLMs) are designed to process text. When an agent encounters a binary file, it typically sees a stream of bytes that it cannot interpret. In a standard repository structure, an agent might attempt to read every file to understand the project architecture. If the repository contains hundreds of high resolution images or compiled .so and .dll files, the agent might spend several seconds or even minutes just listing and attempting to categorize these assets.
This overhead impacts the "reasoning density" of the session. Every unnecessary file metadata entry consumes space in the context window. When the agent is forced to ignore large chunks of the file tree, its ability to find the relevant .ts or .py files diminishes. Effective management requires a combination of strict exclusion rules and specialized tools that understand the difference between code and assets.
Strategic Repository Structuring
The first line of defense is how you organize the data. If binary assets are scattered throughout the source directories, agents will have a harder time filtering them out.
- Isolation: Move all non-text assets into a dedicated
/assetsor/public/staticdirectory. This allows you to tell an agent to ignore entire directory trees with a single command. - Git LFS: Using Git Large File Storage is essential. Agents often interact with the local file system rather than the git history, but LFS pointers are much easier for an agent to handle than the raw binary data if it accidentally reads a file.
- Manifest Files: Create a
README.mdor a JSON manifest inside asset folders. Instead of the agent scanning 1,000 PNG files, it reads one text file describing what those PNGs are for.
By keeping the "heavy" parts of the repo separated from the logic, you ensure that the agent spends its compute budget on the code it was meant to modify or debug.
Tooling and Workspace Environments
The choice of development environment significantly changes how agents interact with heavy repos. Standard IDEs often index everything by default, which can cause lag. Modern alternatives like Deska provide a more modular approach.
Deska is a local-first desktop application that uses an infinite canvas to organize work. Instead of one monolithic view, you can place multiple panels side by side. For a repo with heavy assets, you might have a terminal focused on the asset build pipeline in one corner and an agent panel focused strictly on the src directory in another.
Deska allows you to run agents like Claude Code or OpenCode in dedicated panels. Because it is local-first, your files stay on your machine. The agent interacts with your local file system, which is faster than cloud-based environments when dealing with large assets. You can also use Ask Deska, a voice and chat assistant, to navigate the workspace without manually scrolling through a massive file tree.
Filtering for Agent Efficiency
Most coding agents respect .gitignore files, but this is often not enough. You should use agent-specific configuration files (like .claudecodeignore or similar) to be even more aggressive.
Recommended Ignore Patterns
- Compiled binaries:
*.exe,*.o,*.pyc. - Media:
*.png,*.jpg,*.mp4,*.wav. - Design files:
*.psd,*.fig,*.sketch. - Package locks: While
package-lock.jsonis text, it is often too large for an agent to read comfortably. Tell the agent to ignore it unless it specifically needs to debug a dependency version.
When the agent has a clean view of the repository, it can produce more accurate code suggestions. If you are using coding agents in a multi-panel setup, you can have one agent looking at a subset of the code while another handles a different module, preventing either from becoming overwhelmed by the total size of the repository.
Comparison of Local vs. Cloud Agent Workflows
| Feature | Cloud-Based Agents | Local-First (Deska) |
|---|---|---|
| Latency | Higher due to file uploads | Zero (direct disk access) |
| Privacy | Files uploaded to third party | Files stay on your machine |
| Asset Handling | Often limited by upload sizes | Limited only by your disk |
| Cost | Usually subscription based | BYOK or Managed Options |
Cloud agents often struggle with repositories that exceed 1GB because of the time required to sync the environment. A local-first approach avoids this entirely. Your agents run against the files already sitting on your SSD, making the "index and search" phase almost instantaneous even in repos with tens of thousands of assets.
Remote Monitoring for Long Tasks
In heavy repositories, some tasks like refactoring or complex indexing can take time. This is where mobile integration becomes useful. Deska offers a mobile app that lets you monitor the progress of your agent threads through a secure relay. The devices pair directly, meaning no ports are exposed to the public internet. If an agent is processing a large batch of files in a heavy repo, you can step away from your desk and check the status from your phone, ensuring the process hasn't stalled or errored out.
FAQ
How to hide binary files from AI agents?
The most effective way is to use a combination of .gitignore and agent-specific ignore files. Most agents also allow you to specify a "target directory" upon initialization. Always point the agent to your src folder rather than the repository root to prevent it from scanning large asset directories.
Can AI agents edit binary files?
No, current LLMs cannot reliably edit binary files like images or compiled code. If an agent suggests "fixing" a binary file, it is likely hallucinating. You should handle asset updates manually or through dedicated scripts, using the agent only to write the code that interfaces with those assets.
Why is my coding agent slow in a large repo?
The bottleneck is usually the initial indexing phase. If the agent is trying to map out a repository with thousands of binary assets, it consumes CPU and memory. Use Deska's panels to isolate the agent to a specific subdirectory, reducing the amount of data it needs to track.
Start Building with Deska
Optimizing your workflow for heavy repositories requires the right balance of file organization and powerful tooling. By using a local-first workspace that supports multiple agents side by side, you can maintain high performance regardless of your project's size. Explore the infinite canvas and see how it changes your approach to complex projects.