What are the current best practices for coding agents?
Current best practices for coding agents emphasize structured context management, skill-based specialization, and iterative agentic loops. Key practices include using CLAUDE.md files to document project conventions 178, building context with 7 components to boost productivity 8x 182, and employing agentic loops (plan → act → verify) for self-correction 262,317. The field is rapidly evolving with emerging tools like ECC 177 and Hermes 321 that enable multi-agent orchestration. However, many claims are based on single reports and lack broad corroboration.[6]
- Use a CLAUDE.md file to document project conventions, rules, and context to prevent common errors like over-engineering and hallucinating APIs 178.
- Build context with 7 components—memory, instructions, examples, files, previous actions, tool results, state—to increase Claude Code productivity 8x 182.
- Employ agentic loops (plan → act → verify → repeat) for self-correction and iterative improvement; Anthropic uses this loop to write over 40% of code 262.
- Use structured slash commands and workflows (e.g., /init, voice mode, planning, verification) to improve productivity 121.
- Provide a design system before generating screens to ensure consistent visual identity 225.
- Use the 'handoff' skill to compress session context into a markdown file, allowing fresh agents to continue without degradation from long context windows 226.
- Start simple with predefined workflows and add autonomy only when the task demands it 227.
- Use Fable for overall design, Opus for heavy reasoning, and Sonnet for execution to optimize cost and performance 125.
- Use loops instead of single prompts to automate work 112.
- Point Claude Code at an Obsidian vault to turn notes into a searchable wiki 111.[10]
Key tools include: Claude Code (primary agent), ECC (open-source config with 60 agents and 231 skills) 177, Hermes Agent Dashboard (supports custom plugins) 128, Codex OAuth (secure multi-agent orchestration) 320, Browser Use CLI 3.0 (6x token reduction) 217, and Fable (one-shot CLI coding agent) 135. For cost reduction: Freellmapi aggregates free tiers of 16 LLM providers 110, and converting code to PNG images reduces context token usage by ~80% 230. For multi-agent collaboration: OpenAI's codex-plugin-cc lets Claude Code delegate tasks to Codex 141, and Orca organizes agents into parallel teams 137. For security: iFixAi provides automated red-teaming 105. For local inference: a $400 rig of four GTX 1080 GPUs running Ollama can replace cloud subscriptions 127.[11]
Many claims are based on single reports and lack broad corroboration. For example: building a practical AI agent in under 10 minutes 224, generating a complete browser game from a single spec file 429, and achieving 624,900% margin on ad generation 116 are unverified. Claims about specific performance numbers (e.g., 5× faster shipping with Codex subagent harnesses 384, 50% reduction in engineering busywork 293) need independent validation. The effectiveness of using Claude Fable for final code review 314 and the claim that Claude Code power users achieve 'higher performance' 121 are vague. The claim that Anthropic runs 99% of engineers with 300+ self-improving agent swarms 129 is unverified. Users should treat these as emerging practices and test in their own contexts.[8]
Added corroborated practices: design system before screens (225), handoff skill (226), start simple (227), role delegation (125), loops over prompts (112), Obsidian wiki (111). Updated tooling with Browser Use CLI 3.0 (217), Fable (135), Freellmapi (110), PNG conversion (230), Codex plugin (141), Orca (137), iFixAi (105), local rig (127). Contested section expanded with new unverified claims (224, 429, 116, 384, 293, 314, 129).