0Pricing
Claude Architect · 강의

@path 가져오기 구문

@./standards/coding-style.md 참조를 사용해 모듈화합니다

@path 가져오기 구문은(는) CoddyKit의 무료 Claude Architect 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Claude Architect 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Claude Architect 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Why Modularize CLAUDE.md

A single, ever-growing CLAUDE.md becomes hard to read and burns context tokens on every turn. The @path import syntax lets you split rules into focused files and pull them in by reference.

Instead of pasting 400 lines of coding standards directly, you write one line that imports them. The result: a lean top-level file that stays readable while the details live in dedicated, reusable modules.

The Basic Import

An import is just a line beginning with @ followed by a path. When Claude Code loads your CLAUDE.md, it inlines the referenced file's contents at that point.

Use a relative path from the file doing the importing. The example below pulls a shared coding-style module into the project memory.

# CLAUDE.md

## Project Standards

@./standards/coding-style.md
@./standards/testing.md

Relative vs Absolute Paths

Paths are resolved relative to the file that contains the import. @./standards/coding-style.md looks for a standards/ folder next to your CLAUDE.md.

  • @./standards/coding-style.md — sibling subfolder (most common, VCS-friendly)
  • @../shared/rules.md — parent directory
  • Keep imports inside the repo so teammates who clone the project get the same modules.

A Clean Modular Layout

Group related rules into small files under a standards/ directory, then import each one. Each module has a single responsibility, so you can update testing rules without touching style rules.

This mirrors good code design: small, named, composable units beat one giant file.

.
├── CLAUDE.md            # imports the modules below
└── standards/
    ├── coding-style.md
    ├── testing.md
    └── git-workflow.md

Imports Respect the Hierarchy

CLAUDE.md has layers: user-level ~/.claude/CLAUDE.md (personal, NOT shared via VCS), project-level ./CLAUDE.md (shared via VCS), and directory-level files scoped to a subtree.

@path imports work within any of these. Because a user-level file is not shared, new teammates miss it — so put rules that the whole team needs in a project-level file (and its imports), not in your personal one.

Shared, Not Personal

The whole point of importing @./standards/coding-style.md from a project CLAUDE.md is that the path and the file both live in version control. Clone the repo, and the standards come with it.

Contrast that with a rule buried in ~/.claude/CLAUDE.md: it only exists on your machine. A teammate's Claude session would never see it. Modular project imports keep guidance consistent across the team.

# Shared with the team (committed):
#   ./CLAUDE.md  ->  @./standards/coding-style.md

# Personal only (NOT committed, teammates miss it):
#   ~/.claude/CLAUDE.md

Imports Always Load

Anything you @import from CLAUDE.md is part of the context on every turn the file is active. That is great for rules that always apply — naming conventions, commit format, review expectations.

But it also means every imported line costs tokens continuously. Import what is always relevant; for rules that only matter sometimes, there is a better tool (next scene).

When @import Is the Wrong Tool

If a rule only applies while editing certain files, don't bloat the always-loaded context with it. Use .claude/rules/ files with YAML frontmatter instead.

A paths glob makes the rule load only when you edit a matching file — saving context and tokens versus a monolithic always-on CLAUDE.md.

---
paths:
  - "src/**/*.tsx"
---

# React component rules
Use function components and hooks; no class components.

Choosing Between Them

Two complementary mechanisms:

  • @path imports in CLAUDE.md — for rules that should always be in context (project-wide standards). Modularizes the file; everything still loads every turn.
  • .claude/rules/ with paths frontmatter — for rules that should load conditionally, only when editing matching files. Saves tokens.

An architect picks based on whether the guidance is universal or file-scoped.

Composing Modules

You can import several modules from one CLAUDE.md, mixing concerns cleanly. Keep the top file as an index that explains structure, and let each import carry the detail.

Because imports are plain references, you can reorder, add, or remove a module without rewriting the rest — exactly the maintainability win modular config is meant to deliver.

# CLAUDE.md

This project's rules are modular. See:

@./standards/coding-style.md
@./standards/testing.md
@./standards/git-workflow.md
@./standards/security.md

Editing and Persisting

You don't have to hand-edit memory files. The /memory command edits CLAUDE.md, and those changes persist across sessions — handy for adding a new @import line as your standards grow.

Keep the imported modules themselves under version control so the persisted rules and their references stay in sync for everyone on the team.

# In Claude Code:
/memory

# Add to CLAUDE.md, then save:
@./standards/coding-style.md

Quick Check

Apply what you've learned about @path imports and the CLAUDE.md hierarchy.

Recap

Key takeaways:

  • @path imports (e.g. @./standards/coding-style.md) modularize CLAUDE.md; paths resolve relative to the importing file.
  • Imported content loads on every turn — use it for universal, always-relevant rules.
  • Put shared standards in a project-level CLAUDE.md (shared via VCS), not user-level (~/.claude/, personal and missed by teammates).
  • For rules that apply only to certain files, prefer .claude/rules/ with a paths frontmatter glob to save context and tokens.
  • /memory edits CLAUDE.md and persists changes across sessions.

자주 묻는 질문

“@path 가져오기 구문” 강의는 무료인가요?

네 — “@path 가져오기 구문” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Claude Architect 강의 전체를 잠금 해제할 수 있습니다. Claude Architect 강의에는 총 4개의 강의가 포함되어 있습니다.

“@path 가져오기 구문”에서 뭘 배우나요?

@./standards/coding-style.md 참조를 사용해 모듈화합니다 브라우저에서 직접 실행하는 실습 코드로 Claude Architect을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Claude Architect을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Claude Architect은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“@path 가져오기 구문” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Claude Architect 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Claude Architect 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 사용자, 프로젝트 및 디렉터리 수준
  2. @path 가져오기 구문
  3. Frontmatter 경로가 있는 .claude/rules/
  4. 단일형 규칙과 모듈형 규칙
← Claude Architect(으)로 돌아가기