Agent best practices - grind mode and various hooks
A comprehensive guide to working with coding agents, from starting with plans to managing context, customizing workflows, and reviewing code.
The article describes building a custom CLI coding agent using the Pydantic-AI framework combined with the Model Context Protocol (MCP) and Claude Sonnet 4 via AWS Bedrock.
The agent is designed to interact with codebases, run tests, provide targeted code fixes, and use pluggable MCP servers for capabilities like sandboxed Python execution. Instructions and development guidelines are embedded to enforce project-specific behavior and best practices.
This architecture allows rapid extension of agent functions while keeping user data local and secure.