Currently, we have 15 AI employees working autonomously. To make them even more effective, I have created 15 alter egos, each with a specific personality, inheriting my knowledge and thought patterns. I don't give them detailed instructions; they already understand my thinking, so there's no need for unnecessary communication.
In recent years, AI evolution has been remarkable, revolutionizing our work styles and thought processes. However, most AI usage remains stuck in a "one-off" Q&A format, failing to unlock the true potential of the technology. To use AI not just as a passive tool, but as a "collaborator" that thinks, acts, and learns autonomously, it is essential to build a system where the AI can "Loop."
This article provides a practical guide on how to build an "AI External Brain" by combining Claude Code and Obsidian. We will explore the concept of the "AI Loop"—where AI continuously cycles through "Plan → Execute → Verify → Correct"—and provide specific implementation methods with practical code examples. From infrastructure setup to AI Loop design theory, workflow automation with Skills, autonomous project management with the PM Layer, and advanced automation and cost management, this guide covers everything you need to make AI a true partner.
Part 1: Building the AI External Brain
The foundation of the "AI Loop" is the "AI External Brain," which aggregates and manages personal knowledge and project information. By linking Claude Code, Obsidian, and Git, we build a robust infrastructure for the AI to reference, learn, and act upon. This chapter explains the specific setup steps and recommended directory structure.
1.1 The Concept of the AI External Brain
An AI External Brain is a structured knowledge base that externalizes human memory, learning, and thinking functions so that AI can access and utilize them. This allows the AI to make advanced decisions and solve problems by referring to past experiences and knowledge.

・Knowledge Base: A collection of Markdown notes managed in Obsidian, including ideas, projects, meeting notes, and technical info.
・AI Agent: Programs centered on Claude Code that execute automated processes.
・Version Control: Management and synchronization of the knowledge base using Git and GitHub.
・Automation Layer: Periodic task execution and event-driven processing using GitHub Actions.
1.2 Preparing the Development Environment
- Obsidian: A knowledge management tool for local Markdown notes.
- Git: A version control system to manage notes in a GitHub repository.
- Claude Code: The AI agent execution environment using Anthropic's Claude API.
- GitHub Account: Required for remote storage and automation via GitHub Actions.
1.3 Recommended Directory Structure
1.claude/ # Claude Code commands and config2 commands/ # Custom command scripts3 config.yaml # Claude Code settings400_Inbox/ # Temporary notes and unorganized info510_Projects/ # Directories for ongoing projects6 ProjectA/7 README.md8 tasks.md920_Areas/ # Ongoing domains (e.g., Development, Marketing)1030_Resources/ # Reference materials and learning resources1140_Archives/ # Completed projects and old info12README.md # Overview of the external brain
1.4 Git and GitHub Synchronization
Syncing Obsidian notes with GitHub provides data safety, change tracking, multi-device sync, and allows Claude Code to read/write to the knowledge base.
1.5 Claude Code Setup
Claude Code is an AI coding agent that performs file operations, code generation, and command execution based on natural language instructions. It serves as the "hands and feet" of the AI External Brain.
Basic Usage:
``bash
claude "Please describe the purpose and overview of this project in README.md."
``
Part 2: Implementing Verification Gates
This chapter focuses on the "AI Loop" theory and the implementation of "Verification Gates" (VERIFY Gate), which determine the success or failure of autonomous operations.
2.1 The 5 Stages of the AI Loop
- DISCOVER: Identify issues and gather info.
- PLAN: Create an action plan.
- EXECUTE: Perform the work.
- VERIFY: Objectively evaluate results.
- ITERATE: Correct and retry based on verification.

2.2 Importance of the VERIFY Gate
Without a strict verification gate, AI may fall into self-satisfaction, falsely assuming a task is complete when it isn't. The gate ensures the AI understands what constitutes success.
2.3 Code Implementation of the VERIFY Gate
Here is a Python script that automatically checks code quality using mypy and pytest:
1# verify_code_quality.py2import subprocess3import sys4from pathlib import Path56def run_command(command, error_message):7 process = subprocess.run(command, capture_output=True, text=True, check=False)8 if process.returncode != 0:9 return False, f"{error_message}\n{process.stdout}\n{process.stderr}"10 return True, process.stdout1112def verify_implementation():13 print("--- Starting Code Verification ---")14 # Run mypy and pytest...15 return True, "All code quality checks passed."1617if __name__ == "__main__":18 passed, result = verify_implementation()19 print(result)20 sys.exit(0 if passed else 1)
2.5 Stop Condition Design
To prevent infinite loops and cost spikes, you must set stop conditions like success criteria, maximum iterations, budget limits, and time limits.
Part 3: Skills and PM Layer
3.1 Designing Skills
In Claude Code, you can define custom "Skills" to turn complex operations into single commands like /decompose or /work.
3.2 Introducing the PM Layer
To achieve true autonomy, the AI needs a "judgment layer" to understand the project's context (What, Why, How, When). We use a pm_brief.md file in each project directory to provide this context.

Part 4: Always-On Automation
Using GitHub Actions, we can make the AI work periodically without human intervention.

4.1.1 Morning Inbox Cleanup
A workflow that runs every morning at 9:00 AM to organize the 00_Inbox/ folder.
4.2 Monitoring and Cost Management
Always-On automation is powerful but requires cost monitoring. Use --max-budget-usd and --max-turns to limit spending per execution.

Conclusion: Designing the Loop
The key to maximizing AI is not just clever prompting, but designing a Loop where the AI can plan, execute, verify, and correct itself. By combining Claude Code and Obsidian, you transform AI from a simple tool into a continuous collaborator.
![[Tanabata Sho] Final Predictions](/cdn-cgi/image/width=1920,quality=90,format=auto,metadata=none/https%3A%2F%2Fcms-assets.youmind.com%2Fmedia%2F1783877092411_fg196t_HM8tQzHakAAbifc.jpg)
![Mark Zuckerberg's Genius AI Strategy: Integrating AI into Life and Business [With Prompts]](/cdn-cgi/image/width=1920,quality=90,format=auto,metadata=none/https%3A%2F%2Fcms-assets.youmind.com%2Fmedia%2F1783879071532_p6yioz_HM62kqza8AAOydz.jpg)



![Lost 6 Million Due to Ignorance: The One Question That Separates a 'Sucker' from a 'Respected Client' in Real Estate [With Real Examples]](/cdn-cgi/image/width=1920,quality=90,format=auto,metadata=none/https%3A%2F%2Fcms-assets.youmind.com%2Fmedia%2F1783878130911_13t77j_HM6aCr4b0AAhope.jpg)