My tips for using LLM agents to create software
a day ago
- #software development
- #LLM tips
- #AI coding agents
- Use Anthropic’s Claude Sonnet model for complex coding tasks.
- Experiment with various agents and models; be adaptable as the field evolves quickly.
- Use pay-as-you-go pricing for heavy users; free or subscription-based chatbots for light users.
- Provide the AI model with relevant context to improve results, but avoid irrelevant content.
- Store context in a fixed place and update standing prompts to guide the agent.
- Reinforce instructions or add special instructions in comments within source code files.
- Monitor context size to avoid 'out of context' errors and session failures.
- Use tools to extract only relevant information from large files to save tokens.
- Start new sessions instead of compaction to save tokens and maintain focus.
- Generate context upfront for challenging areas to assist the agent.
- Communicate clearly with agents; explanations are only needed if they reveal new goals or guidelines.
- Have a design in mind and document it to guide the agent and avoid random refactoring.
- Use 'think deeply' or 'analyze deeply' to enter deep reasoning mode for planning.
- Collaborate with the agent to create and update planning and tracking documents.
- Enable inter-agent communication to resolve integration problems between different codebases.
- Implement extensive logging to help the agent diagnose issues and understand program flow.
- Use defensive prompts to ensure the agent completes tasks without errors.
- Prevent agents from disabling tests; ensure they diagnose and fix failures.
- Use git defensively: frequent commits, new branches for big changes, and prevent unauthorized git actions.
- Break big tasks into small tasks and use TODO lists to track progress.
- Interrupt the agent with corrections if it starts doing something undesirable.
- Review and refine agent-created tests to ensure they catch bugs.
- Build custom tools to help the agent perform complex tasks more efficiently.
- Avoid asking the agent for opinions on design as it can be inconsistent.
- Resist the urge to implement all suggested improvements; focus on solving existing problems.