Claude Code is an AI Agent operating on a Perception → Action → Observation loop, organized into 6 layers
SaferSkills independently audited claude-code-architecture (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Phân tích kiến trúc hệ thống Claude Code — tài liệu kỹ thuật + thư viện scaffold sẵn sàng cho production. Architectural analysis of the Claude Code system — technical documentation + production-ready scaffold library.
<img width="1456" height="940" alt="unnamed (1)" src="https://github.com/user-attachments/assets/733f1525-bb79-454c-8d68-3a8ba6ff60ca" />
| Thành phần · Component | Mô tả · Description |
|---|---|
| [Architecture Doc](claude-code-architecture.md) | Phân tích kiến trúc 6 layer chi tiết (song ngữ VI/EN) · Detailed 6-layer architecture analysis (bilingual VI/EN) |
| [Visual Architecture](architecture-visual.html) | Trang HTML trực quan hóa kiến trúc, responsive & animated · Interactive HTML architecture visualization |
| [claude-code-structure](structủe-readme.md) | Thư viện npm/pip tạo cây thư mục chuẩn cho Claude Code · npm/pip library to scaffold Claude Code directory structure |
Claude Code là một AI Agent vận hành trên vòng lặp Perception → Action → Observation, được chia thành 6 layer: Claude Code is an AI Agent operating on a Perception → Action → Observation loop, organized into 6 layers:
┌─────────────────────────────────────────────────────────┐
│ ① Input & Permission Tiếp nhận & kiểm soát quyền │
│ ② Knowledge Layer Bộ não ngữ cảnh & bộ nhớ │
│ ③ Master Agent Loop Vòng lặp Perceive→Act→Observe │
│ ④ Integration Layer MCP Runtime & Tool Dispatch │
│ ⑤ Multi-Agent Layer Subagent & Worktree Isolation │
│ ⑥ Observability Layer Event Bus & Feedback Loop │
└─────────────────────────────────────────────────────────┘User Request → Session Manager → Permission Gate
→ Knowledge Layer (compress + enrich context)
→ Agent Loop (perceive → act → observe)
→ Tool Dispatch / Spawn Subagents
→ Verify & Output → Update Memory → Return Result📖 Xem chi tiết: claude-code-architecture.md · Full details in the architecture doc 🎨 Xem trực quan: mở architecture-visual.html trong browser · Open the visual HTML in your browser
Thư viện claude-code-structure giúp bạn tạo nhanh cấu trúc dự án chuẩn cho Claude Code chỉ với 1 lệnh: The [`claude-code-structure`](https://www.npmjs.com/package/claude-code-structure) library lets you scaffold a production-ready Claude Code project in one command:
npx claude-code-structure # tạo tại thư mục hiện tại · scaffold in current dir
npx claude-code-structure ./my-app # tạo tại thư mục chỉ định · scaffold in specific dirpip install claude-code-structure
claude-init # tạo tại thư mục hiện tại · scaffold in current dir
claude-init ./my-app # tạo tại thư mục chỉ định · scaffold in specific diryour-project/
├── CLAUDE.md ← Load mỗi phiên · Loaded every session
├── CLAUDE.local.md ← Override cá nhân (gitignored) · Local overrides
├── .mcp.json ← Tích hợp MCP · MCP integrations
└── .claude/
├── settings.json ← Quyền & cấu hình · Permissions & config
├── rules/ ← Quy tắc code · Code style rules
│ ├── code-style.md
│ ├── testing.md
│ └── api-conventions.md
├── commands/ ← Lệnh slash · Slash commands
│ ├── review.md
│ └── fix-issue.md
├── skills/ ← Kỹ năng auto-inject · Auto-injected skills
│ └── deploy/
├── agents/ ← Agent con · Sub-agents
│ ├── code-reviewer.md
│ └── security-auditor.md
└── hooks/ ← Script sự kiện · Event scripts
└── validate-bash.shMỗi layer trong kiến trúc tương ứng với các file/thư mục cụ thể: Each architecture layer maps to specific files/directories:
| Layer | Files | Vai trò · Role |
|---|---|---|
| ① Input & Permission | .claude/settings.json | Quyền truy cập, model selection · Permissions, hooks |
| ② Knowledge | CLAUDE.md, .claude/rules/, .claude/skills/ | Ngữ cảnh, quy tắc, kỹ năng · Context, rules, skills |
| ③ Agent Loop | Claude Code runtime (built-in) | Vòng lặp AI chính · Core orchestration |
| ④ Integration | .mcp.json, .claude/hooks/ | MCP servers, event scripts |
| ⑤ Multi-Agent | .claude/agents/*.md | Định nghĩa agent con · Subagent definitions |
| ⑥ Observability | .claude/hooks/, Event scripts | Giám sát & feedback · Monitoring & feedback |
cd your-project
npx claude-code-structureCập nhật tech stack, package manager, và build commands cho dự án của bạn: Update the tech stack, package manager, and build commands for your project:
# CLAUDE.md
## Tech Stack
- Language: TypeScript / Python
- Framework: Next.js / FastAPI
- Package Manager: pnpm / uv
- Build: pnpm build / make build
- Test: pnpm test / pytestChỉnh sửa các file trong .claude/rules/ theo convention của team: Edit files in `.claude/rules/` to match your team's conventions:
Thêm token và cấu hình vào .mcp.json: Add tokens and configuration to `.mcp.json`:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
}
}
}Tạo agent con chuyên biệt trong .claude/agents/: Create specialized sub-agents in `.claude/agents/`:
claude-code-architecture/
├── README.md ← Bạn đang đây · You are here
├── claude-code-architecture.md ← Kiến trúc 6 layer chi tiết · Detailed architecture
├── architecture-visual.html ← Trực quan hóa HTML · Visual HTML page
├── architecture.md ← Hướng dẫn build & publish · Build guide
├── structủe-readme.md ← README cho thư viện npm/pip · Library README
└── CLAUDE.md ← Quy tắc hành vi AI · AI behavioral guidelinesgit checkout -b feat/my-featureCreate feature branch
Push and open a Pull Request
MIT © TechSphereX TA
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.