에이전트형 AI 코드 도구
AI 코딩 도구는 단순한 자동 완성에서 출발해, 이제는 계획을 세우고 여러 파일을 수정하고 테스트를 돌리고 풀 리퀘스트까지 만들어내는 자율 에이전트로 발전했습니다. 이 튜토리얼에서는 대표적인 세 가지 도구인 Claude Code, Cursor, GitHub Copilot을 다룹니다.
1) "에이전트형"이란 무엇인가?
전통적인 AI 코드 완성은 다음 몇 줄을 제안합니다. 에이전트형 도구는 여기서 한 걸음 더 나아갑니다.
| 기능 | 자동 완성 | 에이전트형 |
|---|---|---|
| 범위 | 현재 줄/함수 | 코드베이스 전체 |
| 계획 | 없음 | 다단계 추론 |
| 실행 | 제안만 | 파일 수정, 명령 실행 가능 |
| 컨텍스트 | 현재 파일 | 저장소 전체 이해 |
| 워크플로 | 반응형 | 자율적인 작업 완수 |
에이전트형 도구는 프로젝트 구조 전체를 이해하고, 여러 파일에 걸친 변경을 계획하고, 그 변경을 실행하고, 테스트를 돌리고, 작업이 끝날 때까지 반복합니다.
2) 한눈에 비교: Claude Code vs Cursor vs Copilot
| 항목 | Claude Code | Cursor | GitHub Copilot |
|---|---|---|---|
| 인터페이스 | CLI, 웹, IDE 플러그인 | 완전한 IDE (VS Code 포크) | IDE 확장 |
| 컨텍스트 윈도우 | 큼 (롱컨텍스트 Opus) | 저장소 전체 인덱싱 | 작지만 개선 중 |
| 다중 파일 편집 | 강함 | 뛰어남 | 개선 중 |
| 플랜 모드 | 있음 | 있음 | 있음 (비교적 최근) |
| 가격 | Pro/Max 등급 | 크레딧 + 구독 | 구독 |
| 적합한 용도 | 아키텍처, 대규모 리팩터링 | 인터랙티브 개발 | 인라인 코딩 |
3) Claude Code 기본기
Claude Code는 Opus 4.8(현재 기본 모델)에서 동작하며 큰 컨텍스트 윈도우를 제공합니다. 설치하고 인증해 보세요.
# Claude Code 설치 (네이티브 설치 프로그램, 권장)
curl -fsSL https://claude.ai/install.sh | bash
# 또는 npm으로 설치 (Node 18+ 필요)
npm install -g @anthropic-ai/claude-code
# 인증: claude를 실행하고 브라우저 안내를 따르세요
claude
# 프로젝트에서 시작하기
cd your-project
claude기본 명령어
# 코드베이스에 대해 질문하기
claude "How is authentication implemented here?"
# 코드 생성하기
claude "Add a rate limiter middleware"
# 다중 파일 리팩터링
claude "Rename UserService to AuthService across the codebase"
# PR 생성하기
claude "Create a PR that adds input validation to all API endpoints"프로젝트 설정
프로젝트 컨텍스트는 저장소 루트의 CLAUDE.md 파일에 넣어 두세요. Claude Code는 매 세션 시작 시 이 파일을 자동으로 읽습니다.
# Project notes
- Language: TypeScript, formatted with Prettier
- Tests: Vitest, in tests/
- Don't touch node_modules/ or dist/도구 권한, 환경 변수, 훅 같은 기계가 읽는 설정은 .claude/settings.json에 들어갑니다. 예를 들어 파괴적인 도구가 실행되기 전에 승인을 요구하려면 권한을 여기서 설정하면 됩니다.
메모리와 컨텍스트
지속적인 프로젝트 컨텍스트는 CLAUDE.md 파일에 담기며, Claude Code는 매 세션 시작 시 이를 불러옵니다. 여기에 더해 Claude가 당신의 수정과 선호에 맞춰 스스로 업데이트하는 자동 메모리 저장소도 있습니다. 오래 유지될 컨텍스트를 주려면 일회성 "Remember:" 프롬프트를 넘기는 대신 CLAUDE.md를 편집하세요.
# CLAUDE.md
This is a monorepo. Shared code lives in packages/.세션 안에서 /clear 명령어를 쓰면 작업 컨텍스트를 초기화할 수 있습니다.
4) Cursor IDE의 에이전트 기능
Cursor는 에이전트형 워크플로를 중심으로 만들어졌습니다. 핵심 기능은 다음과 같습니다.
에이전트 모드
Cmd+Shift+I(Mac) 또는 Ctrl+Shift+I(Windows/Linux)를 눌러 에이전트 모드의 Composer를 엽니다.
Agent mode workflow:
1. Describe your task
2. Agent creates a plan
3. You approve or modify
4. Agent executes changes
5. Review and iterate플랜 모드
복잡한 작업에는 플랜 모드를 명시적으로 사용하세요.
@plan Add user authentication with:
- JWT tokens
- Refresh token rotation
- Password hashing with bcrypt
- Rate limiting on login attempts에이전트는 다음 순서로 동작합니다.
- 기존 코드를 조사합니다
- 상세한 구현 계획을 세웁니다
- 당신의 승인을 기다립니다
- 단계별로 실행합니다
컨텍스트 주입
특정 컨텍스트를 추가하려면 @를 사용하세요.
@file src/api/auth.ts
@folder src/middleware
@docs https://jwt.io/introduction
Implement JWT verification middleware following these patterns병렬 에이전트
서로 다른 브랜치에서 여러 에이전트를 동시에 실행할 수 있습니다.
# In Cursor:
1. Open Command Palette
2. "Cursor: New Agent in Worktree"
3. Each agent works in isolation
4. Compare results side-by-sideCursor 3에는 Agents Window가 추가되었습니다(Cmd+Shift+P를 누른 뒤 "Agents Window"로 엽니다). 이 창은 로컬 체크아웃, git worktree, 클라우드 환경에 걸쳐 여러 에이전트를 병렬로 실행합니다. /worktree 명령어는 각 에이전트를 격리된 자체 git worktree로 분리하고, /best-of-n은 같은 작업을 여러 모델에서 실행해 결과를 나란히 비교할 수 있게 해 줍니다.
일관성을 위한 규칙
.cursor/rules/project.mdc를 만드세요.
# Project Rules
## Code Style
- Use TypeScript strict mode
- Prefer functional components
- Use named exports, not default
## Testing
- Every feature needs tests
- Use describe/it blocks
- Mock external services
## Security
- Never commit secrets
- Validate all user input
- Use parameterized queries5) GitHub Copilot의 에이전트 기능
Copilot은 자동 완성을 넘어 발전했습니다.
Copilot Chat
채팅 패널을 열고 슬래시 명령어를 사용하세요.
/explain - Explain selected code
/fix - Fix issues in selection
/tests - Generate tests
/doc - Add documentation코딩 에이전트 (이슈에서 풀 리퀘스트로)
# On GitHub:
1. Open a GitHub issue
2. Assign it to "Copilot" as the assignee
3. The coding agent works in the background:
analyzes the issue, edits files, runs tests
4. It opens a pull request for your review이는 VS Code나 JetBrains에서 당신과 동기적으로 함께 작동하는 Copilot의 IDE 내 에이전트 모드와는 다릅니다.
이제 Copilot은 자율 작업을 두 가지로 나눕니다. 에이전트 모드는 IDE(VS Code와 JetBrains) 안에서 동기적으로 실행되며 어떤 파일을 수정할지 결정하고 터미널 명령을 실행하고 오류를 반복해서 고칩니다. 코딩 에이전트는 클라우드에서 비동기로 실행되며, 할당받은 이슈를 가져가 당신이 다른 일을 하는 동안 풀 리퀘스트를 만들어 줍니다.
컨텍스트를 활용한 인라인 제안
Copilot은 코드베이스를 읽습니다. 주석으로 힌트를 주세요.
// Authentication middleware that:
// - Extracts JWT from Authorization header
// - Validates token signature
// - Attaches user to request
// - Returns 401 if invalid
export function authMiddleware(req, res, next) {
// Copilot generates the implementation
}6) 모든 도구에 적용되는 모범 사례
명확한 프롬프트 작성하기
❌ Bad: "Fix the bug"
✅ Good: "Fix the null pointer exception in UserService.getById
when the user doesn't exist. Return null instead of throwing."
❌ Bad: "Add tests"
✅ Good: "Add unit tests for the CartService covering:
- Adding items to empty cart
- Removing items
- Calculating totals with discounts
- Edge case: negative quantities"복잡한 작업에는 플랜 모드 쓰기
For any task touching 3+ files, always:
1. Ask for a plan first
2. Review the plan
3. Approve or modify
4. Let the agent execute
5. Review changes before committing아키텍처 컨텍스트 제공하기
Before major work, brief the agent:
"This is a microservices architecture:
- api-gateway: Routes requests
- auth-service: JWT, sessions
- user-service: User CRUD
- notification-service: Email, push
Services communicate via Redis pub/sub.
Database is PostgreSQL with Prisma ORM."에이전트와 함께하는 테스트 주도 개발
1. Write failing test first:
"Write a test for user registration that expects email validation"
2. Let agent see the failing test:
"Implement registration to make this test pass"
3. Iterate until green:
"Fix the remaining test failures"7) 보안 고려 사항
에이전트형 도구에는 진짜 힘이 있습니다. 경계를 설정하세요.
승인 게이트
// .claude/config.json
{
"safety": {
"requireApproval": [
"rm",
"git push",
"npm publish",
"database migrations",
"env file changes"
]
}
}샌드박싱
# Run agents in isolated environments
docker run -v $(pwd):/workspace -it claude-sandbox
# Or use git worktrees for isolation
git worktree add ../feature-branch feature-branch민감한 파일
# .cursorignore / .claudeignore
.env
.env.*
secrets/
credentials/
*.pem
*.key모든 변경 검토하기
# Before accepting agent changes:
git diff --stat
git diff
# Use interactive staging
git add -p
# Never auto-merge without review8) 실제로 통하는 워크플로 패턴
패턴 1: 탐색, 계획, 실행
Session 1: "How does the payment system work?"
→ Agent explores, you learn
Session 2: "What would it take to add Stripe?"
→ Agent creates plan
Session 3: "Implement the Stripe integration"
→ Agent executes plan패턴 2: 병렬 탐색
# In Cursor with parallel agents:
Agent 1: "Implement caching with Redis"
Agent 2: "Implement caching with Memcached"
Agent 3: "Implement caching with in-memory LRU"
→ Compare implementations, pick best approach패턴 3: 점진적 마이그레이션
Step 1: "Identify all uses of deprecated API"
Step 2: "Create adapter for new API"
Step 3: "Migrate module A to use adapter"
Step 4: "Migrate module B..."
...
Step N: "Remove adapter, use new API directly"패턴 4: 테스트 우선 기능 개발
1. "Write acceptance tests for user profile editing"
2. "Write unit tests for profile validation"
3. "Implement to pass the tests"
4. "Add integration tests"
5. "Refactor for clarity"9) 언제 어떤 도구를 쓸까
| 상황 | 추천 도구 |
|---|---|
| 실시간 코딩, 인라인 도움 | GitHub Copilot |
| 대규모 리팩터링, 아키텍처 | Claude Code |
| 풀타임 개발 세션 | Cursor |
| 코드에 대한 빠른 질문 | 아무 채팅 인터페이스 |
| 이슈에서 PR 만들기 | Copilot Workspace |
| 복잡한 다중 파일 변경 | Cursor Agent |
| API 설계, 문서화 | Claude Code |
| 새 코드베이스 학습 | Cursor 또는 Claude Code |
10) 효과 측정하기
에이전트형 도구를 평가하려면 다음 지표를 추적하세요.
const metrics = {
// Productivity
suggestionsAccepted: 'percentage of suggestions you kept',
timeToFeature: 'hours from start to merged PR',
linesPerHour: 'code velocity (use carefully)',
// Quality
bugsIntroduced: 'defects traced to AI-generated code',
testCoverage: 'coverage of AI-generated code',
reviewChanges: 'how much you modify AI suggestions',
// Cost
apiCosts: 'monthly spend on AI tools',
creditsUsed: 'Cursor credits consumed',
// Learning
newPatternsLearned: 'techniques you picked up from AI',
codebaseUnderstanding: 'how well AI helped you learn',
}11) 흔한 함정
에이전트를 과신하기
❌ Accepting large changes without review
❌ Letting agents run destructive commands
❌ Not understanding the code before shipping
✅ Review every change
✅ Understand what you ship
✅ Use agents as collaborators, not replacements컨텍스트 오염
❌ Huge prompts with irrelevant context
❌ Not clearing context between unrelated tasks
❌ Including generated files in context
✅ Keep prompts focused
✅ Use specific @file references
✅ Exclude build artifacts프롬프트 모호함
❌ "Make it better"
❌ "Fix the issues"
❌ "Add some tests"
✅ "Reduce time complexity from O(n²) to O(n log n)"
✅ "Handle the null case on line 45 by returning early"
✅ "Add tests for edge cases: empty input, max length, unicode"12) 시작하기 체크리스트
## Setup Checklist
### Claude Code
- [ ] Install CLI: `npm install -g @anthropic/claude-code`
- [ ] Authenticate: `claude login`
- [ ] Create `.claude/config.json`
- [ ] Add `.claudeignore` for sensitive files
### Cursor
- [ ] Download from cursor.com
- [ ] Import VS Code settings
- [ ] Configure `.cursor/rules/`
- [ ] Learn `Cmd+Shift+I` for Agent mode
### GitHub Copilot
- [ ] Install extension in your IDE
- [ ] Enable Copilot Chat
- [ ] Try Copilot Workspace for issues
- [ ] Configure `.github/copilot-instructions.md`
### All Tools
- [ ] Set up approval gates for destructive operations
- [ ] Create ignore files for secrets
- [ ] Establish review workflow
- [ ] Track metrics from day one관련 글
- 빠르게 로드되는 웹 게임 출시하기
- 게임 로직을 위한 웹 워커
- 게임 잼 & 해커톤 — AI 코드 도구는 48시간 잼에서 가능한 일의 범위를 바꾸고 있습니다
- 웹 게임 엔진 비교 — AI 보조 워크플로와 잘 맞는 엔진 고르기