Claude Code × Obsidian: Complete Guide to Creating 15 AI "External Brain" Alter Egos

@claudecode84
TIẾNG NHẬT1 ngày trước · 11 thg 7, 2026
374K
256
17
2
753

TL;DR

This comprehensive guide explains how to build an autonomous AI External Brain by combining Claude Code and Obsidian. It details the AI Loop framework for self-correcting task execution and project management via GitHub Actions.

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.

Claude code研究ラボ - inline image

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

  1. Obsidian: A knowledge management tool for local Markdown notes.
  2. Git: A version control system to manage notes in a GitHub repository.
  3. Claude Code: The AI agent execution environment using Anthropic's Claude API.
  4. GitHub Account: Required for remote storage and automation via GitHub Actions.

1.3 Recommended Directory Structure

text
1.claude/ # Claude Code commands and config
2 commands/ # Custom command scripts
3 config.yaml # Claude Code settings
400_Inbox/ # Temporary notes and unorganized info
510_Projects/ # Directories for ongoing projects
6 ProjectA/
7 README.md
8 tasks.md
920_Areas/ # Ongoing domains (e.g., Development, Marketing)
1030_Resources/ # Reference materials and learning resources
1140_Archives/ # Completed projects and old info
12README.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

  1. DISCOVER: Identify issues and gather info.
  2. PLAN: Create an action plan.
  3. EXECUTE: Perform the work.
  4. VERIFY: Objectively evaluate results.
  5. ITERATE: Correct and retry based on verification.
Claude code研究ラボ - inline image

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:

python
1# verify_code_quality.py
2import subprocess
3import sys
4from pathlib import Path
5
6def 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.stdout
11
12def verify_implementation():
13 print("--- Starting Code Verification ---")
14 # Run mypy and pytest...
15 return True, "All code quality checks passed."
16
17if __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.

Claude code研究ラボ - inline image

Part 4: Always-On Automation

Using GitHub Actions, we can make the AI work periodically without human intervention.

Claude code研究ラボ - inline image

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.

Claude code研究ラボ - inline image

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.

Viết lại trong YouMind

Turn one viral article into a full content workflow

Collect the source, decode the pattern, create assets, draft the story, and distribute from one AI workspace.

Explore YouMind
Dành cho nhà sáng tạo

Biến Markdown của bạn thành bài viết 𝕏 gọn gàng

Khi bạn đăng bài viết dài của riêng mình, việc định dạng hình ảnh, bảng và khối mã cho 𝕏 rất mệt mỏi. YouMind biến cả bản nháp Markdown thành một bài viết 𝕏 gọn gàng, sẵn sàng để đăng.

Thử Markdown sang 𝕏

Thêm pattern để giải mã

Bài viết viral gần đây

Khám phá thêm bài viết viral