- Can AI write a better prompt than human?
- What does a good text-to-image prompt look like?
- AI-ready = non-interactive CLI + good
-h
- The breakthrough is some old technique, like S3, 6 hats, Design Sprints, etc.
- shadcn or create from scratch? library or custom?
When to use agents?
The primary purpose of agents is to save token space in your main context by offloading work and only retaining the relevant output in the context rather than the entire conversation history. They also allow for parallelization and choosing specific models for specific tasks, but the biggest thing is the context encapsulation. The key things to know about agents:
- Agents only receive the prompt that the outer context chooses to give them. They do NOT receive the full conversation prior to the agent being called. This means their responsibility needs to be well-defined and the main context should have a clear understanding of what to give them. This is especially relevant for agents that you want to write code for you, as code often requires a lot of context to write correctly. I personally only have agents write very simple code or make sure that they can get all the context they need by passing in pre-prepared plans in markdown files.
- The main context only sees the last message of the agent in its context stream. This is usually the final summary report from its task, but sometimes it can do things like update a TodoWrite as a final step and this messes up what the outer context sees.
My recommendations, based on my experience working with them:
- Agents are great for data gathering and consolidation (i.e. read-only tasks). I have a standard agent I use any time I want to gather context for a complicated task and this has helped a lot with removing all the codebase exploration from the working context of the main Claude.
- Agents are also great for wrapping tool calls that generate a lot of output, like building and unit tests. I have a standard build-test-engineer I use whose only job is run build/test, then consolidate the output to just what's relevant to the main Claude. I've found this has substantially improved performance during extended debugging of its own changes, as it keeps the actual work closer in context so that it doesn't get stuck trying to hack around bugs without a good memory of why it's trying to do that in the first place.
- To get the best results, use slash commands to automate requesting it to explicitly use specific agents. It's not always great on deciding to use agents on its own.
- I also include some explicit instructions for agent use cases in the
CLAUDE.md. So far I've gotten Claude to reliably use build-test-engineer and I also have it using batch-editor reasonably often (this is my agent for applying simple edits across a bunch of files, like for refactoring/cleanup tasks.)
Source