How I build agents that work the night shift

Brian Castle presents the “night shift” design pattern, where AI agents autonomously perform recurring business tasks on a set schedule, allowing humans to provide focused feedback during brief review sessions and thereby increasing productivity while reducing manual oversight. He illustrates this with examples like an SEO agent updating website tags and a GitHub agent managing pull requests, emphasizing the importance of upfront system design and encouraging delegation of repetitive tasks to AI agents across various platforms.

In this video, Brian Castle introduces the “night shift” design pattern for AI agents, a system where AI agents autonomously perform recurring tasks in a business without constant human prompting. Unlike traditional AI interactions that require opening a chat and manually prompting the AI, the night shift model treats agents as teammates who show up, do their work on a set schedule, and present results for human review. This approach allows the human operator to provide focused feedback in short sessions, enabling the agent to continue progressing tasks independently, thereby increasing productivity and reducing repetitive manual oversight.

The night shift system consists of three key components: a shared interface that acts as the single source of truth for communication and data storage between the human and the agent; the human operator who provides high-leverage input during brief review sessions; and the AI agent equipped with a skill—a step-by-step process it follows on a recurring schedule. Brian emphasizes that the real effort lies in designing this system upfront, including building or using tools like markdown files or custom apps with APIs to facilitate seamless interaction between humans and agents.

Brian shares two practical examples from his own business to illustrate the night shift pattern. The first example involves an SEO agent that reviews and updates meta title and description tags across his website to ensure optimal search engine visibility. This agent runs every two weeks, accesses the website’s backend via API, identifies gaps or suboptimal tags, makes corrections, and generates a detailed markdown report for Brian to review. This automation plugs SEO holes that might otherwise be overlooked, maintaining the health of his site’s search presence with minimal manual effort.

The second example focuses on managing open-source contributions on GitHub. Brian’s agent regularly reviews pull requests, evaluates their quality based on predefined rules, and drafts recommendations for merging or closing them. The agent also posts personalized comments to contributors, streamlining the maintenance of his open-source projects. Brian reviews the agent’s recommendations via markdown reports and approves actions with simple checkboxes, allowing the agent to execute decisions autonomously afterward. This significantly reduces the time and tedium involved in code review while maintaining quality control.

Brian concludes by addressing common questions about platform compatibility and scheduling, noting that the night shift pattern is adaptable across various AI ecosystems like Claude and OpenAI. He encourages viewers to identify repetitive tasks they perform regularly as prime candidates for delegation to AI agents using this model. By shifting the mindset from “how can I do this faster?” to “who can I delegate this to?”, builders can leverage AI agents to handle routine work, freeing themselves to focus on higher-value activities. Brian invites viewers to subscribe for more practical AI building patterns and to join his Builder Methods Pro community for deeper learning and support.