Programmer/AI

Claude Code 생산성 10배 올리기: 키보드부터 자동화까지

MoreLean 2026. 1. 21. 01:17
반응형

키보드 단축키부터 외우세요. Cmd+K는 퀵 액션, Cmd+Shift+P는 명령 팔레트, Cmd+/는 주석 토글, Cmd+D는 같은 단어 선택... 이런 거 손에 익으면 마우스 안 쓰고도 코딩할 수 있어요. 처음엔 느려도 1주일만 연습하면 2배는 빨라져요.


TL;DR

  • 키보드 단축키: Escape(중단), Double-Escape(되감기), Tab(자동완성)
  • 프롬프트: 구체적 + 컨텍스트 = 최고의 결과물
  • 자동 커밋: Stop Hook으로 세션 종료 시 자동 커밋
  • PR 템플릿: .github/pull_request_template.md로 표준화
  • /clear 자주: 새 작업마다 컨텍스트 리셋
  • 커스텀 명령어: 반복 작업을 한 줄로

1. 키보드 단축키 마스터하기

Claude Code 핵심 단축키

"Press Escape to interrupt Claude during any phase (thinking, tool calls, file edits), preserving context so you can redirect or expand instructions." — Anthropic Best Practices

단축키 기능 사용 시점

Escape 작업 중단 Claude가 잘못된 방향으로 갈 때
Escape × 2 히스토리 되감기 이전 프롬프트로 돌아가기
Tab 파일/폴더 자동완성 @src/c + Tab → @src/components/
Shift+Tab Permission 모드 순환 normal → auto-accept → plan 모드
↑ / ↓ 명령 히스토리 이전 명령 재사용
Ctrl+C × 2 강제 종료 완전히 나가기
Ctrl+R 히스토리 검색 과거 명령 찾기

Bash 스타일 편집

Ctrl+A        → 줄 맨 앞으로
Ctrl+E        → 줄 맨 뒤로
Option+F      → 단어 앞으로 (→)
Option+B      → 단어 뒤로 (←)
Ctrl+W        → 이전 단어 삭제
Ctrl+U        → 줄 전체 삭제

macOS 팁: Option 키가 안 먹힌다면 터미널 설정에서 "Use Option as Meta Key" 활성화하세요.

  • iTerm2: Settings → Profiles → Keys → Left Option → Esc+
  • Terminal.app: Settings → Profiles → Keyboard → Use Option as Meta Key

멀티라인 입력

Shift+Enter로 여러 줄 프롬프트 작성:

> "1. 로그인 버튼 만들어줘
   2. 파란색 배경에 흰 글씨
   3. 호버하면 진한 파란색
   4. 클릭하면 /auth/login API 호출"

팁: iTerm2, WezTerm, Ghostty, Kitty에서는 기본 작동. VS Code나 Alacritty에서는 /terminal-setup 실행 필요.

셸 Alias 설정

# ~/.zshrc 또는 ~/.bashrc
alias c="claude"
alias cc="claude --continue"
alias cr="claude --resume"
alias cy="claude --dangerously-skip-permissions"  # 주의!

# 프로젝트별 단축키
alias dev="claude 'Start development session'"
alias review="claude '/review'"
alias commit="claude '/commit'"

2. 프롬프트 작성의 기술

구체적일수록 좋다

"The difference between a vague instruction and a well-crafted prompt can mean the gap between generic outputs and exactly what you need." — Claude Blog

❌ 나쁜 예:

버튼 만들어줘

✅ 좋은 예:

파란색(#3B82F6) 배경에 흰 글씨, 
호버하면 진한 파란색(#2563EB), 
클릭하면 /auth/login API 호출하는 로그인 버튼 만들어줘.
이 버튼은 로그인 폼에 들어가고, 
로딩 중에는 스피너 표시해야 해.
Tailwind CSS 사용하고 있어.

컨텍스트 제공하기

┌─────────────────────────────────────────────────────────────┐
│               효과적인 프롬프트 구조                              │
│                                                             │
│  1. 무엇을 (WHAT)     → "로그인 버튼 만들어줘"                     │
│  2. 어디에 (WHERE)    → "이 버튼은 로그인 폼에 들어가"               │
│  3. 어떻게 (HOW)      → "파란색 배경, 흰 글씨"                    │
│  4. 왜 (WHY)          → "사용자가 쉽게 찾을 수 있도록"             │
│  5. 제약사항          → "Tailwind CSS, TypeScript 사용"        │
└─────────────────────────────────────────────────────────────┘

@ 태그로 파일 참조

# 파일 직접 참조
@src/components/Button.tsx 이 버튼 스타일 참고해서 만들어줘

# 폴더 참조
@src/styles/ 여기 있는 스타일 컨벤션 따라줘

# Tab 자동완성 활용
@src/c[Tab] → @src/components/

이미지로 설명하기

"Paste screenshots (pro tip: hit cmd+ctrl+shift+4 in macOS to screenshot to clipboard and ctrl+v to paste)." — Anthropic Best Practices

# 1. 스크린샷 찍기 (macOS)
cmd+ctrl+shift+4  # 클립보드에 저장

# 2. Claude Code에 붙여넣기
ctrl+v  # (주의: cmd+v 아님!)

# 3. 프롬프트와 함께
"이 디자인 목업 보고 똑같이 만들어줘"

문제 해결 가이드

문제 해결책

응답이 주제에서 벗어남 목표를 더 명시적으로 설명
형식이 불일치 예시(few-shot) 추가
작업이 너무 복잡 여러 프롬프트로 분할
불필요한 서론 "서론 없이 바로 답변해줘"
정보를 지어냄 "모르면 모른다고 해도 돼"
제안만 하고 구현 안 함 "이 함수를 수정해줘" (명령형)

3. /clear 습관 들이기

왜 /clear가 중요한가?

"Use the /clear command frequently between tasks to reset the context window." — Anthropic Best Practices

┌─────────────────────────────────────────────────────────────┐
│              컨텍스트 오염 문제                                  │
│                                                             │
│  긴 세션 동안:                                                 │
│  • 오래된 대화가 쌓임                                            │
│  • 관련 없는 파일 내용이 쌓임                                     │
│  • 이전 명령 출력이 쌓임                                         │
│                                                             │
│  결과:                                                       │
│  • 성능 저하                                                  │
│  • Claude가 산만해짐                                           │
│  • 토큰 낭비                                                  │
└─────────────────────────────────────────────────────────────┘

/clear 사용 타이밍

# 새 작업 시작할 때
/clear

# 완전히 다른 주제로 넘어갈 때
/clear

# Claude가 이상하게 행동할 때
/clear

# 긴 디버깅 세션 후
/clear

Pro tip: "Every time you start something new, clear the chat. You don't need all that history eating your tokens." — Builder.io


4. 자동 커밋 설정

작업 끝날 때마다 자동으로 커밋되게 하면 안전해요. 커밋 메시지 나중에 정리하면 되고, 일단 작업 내역이 계속 쌓이니까 실수로 날려도 복구 가능하거든요.

Stop Hook으로 자동 커밋

// .claude/settings.json
{
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "git add -A && git commit -m 'auto: WIP checkpoint' --allow-empty || true"
          }
        ]
      }
    ]
  }
}

프롬프트 내용을 커밋 메시지로

"It's fairly straightforward to change the notification into a git commit -m checkpoint... However, let's make it slightly better by using the prompt itself as the commit message." — GitButler Blog

#!/bin/bash
# .claude/hooks/auto-commit.sh

# Hook input에서 프롬프트 추출
INPUT=$(cat)
PROMPT=$(echo "$INPUT" | jq -r '.prompt // "WIP checkpoint"' | head -c 72)

# 변경사항 있으면 커밋
if ! git diff --quiet HEAD 2>/dev/null; then
    git add -A
    git commit -m "auto: $PROMPT"
fi
// .claude/settings.json
{
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "bash .claude/hooks/auto-commit.sh"
          }
        ]
      }
    ]
  }
}

GitButler 통합 (고급)

"GitButler uses a mix of PreToolUse, PostToolUse, and Stop hooks to automatically stage file changes and create new commits. They can even isolate work from different Claude sessions into separate branches automatically." — eesel.ai

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|MultiEdit|Write",
        "hooks": [{ "type": "command", "command": "but claude pre-tool" }]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Edit|MultiEdit|Write",
        "hooks": [{ "type": "command", "command": "but claude post-tool" }]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [{ "type": "command", "command": "but claude stop" }]
      }
    ]
  }
}

결과: 여러 Claude 세션을 동시에 돌려도 각 세션의 변경사항이 별도 브랜치로 자동 분리!


5. PR 템플릿 만들기

매번 PR 설명 쓰기 귀찮잖아요. 템플릿 만들어두면 빈칸만 채우면 돼요. 팀원들도 리뷰하기 편해져요.

기본 템플릿

<!-- .github/pull_request_template.md -->

## 📋 변경 사항
<!-- 이 PR에서 변경된 내용을 설명해주세요 -->


## 🎯 관련 이슈
<!-- Closes #123 형식으로 연결 -->
Closes #

## ✅ 테스트 방법
<!-- 이 변경사항을 어떻게 테스트할 수 있나요? -->
1. 
2. 
3. 

## 📸 스크린샷 (UI 변경 시)
<!-- 변경 전/후 스크린샷을 첨부해주세요 -->
| Before | After |
|--------|-------|
|        |       |

## ✔️ 체크리스트
- [ ] 코드가 프로젝트 스타일 가이드를 따름
- [ ] 셀프 리뷰 완료
- [ ] 테스트 추가/수정 완료
- [ ] 문서 업데이트 (필요시)

## 💡 리뷰어에게
<!-- 리뷰어가 특히 봐줬으면 하는 부분이 있나요? -->

Claude가 PR 자동 생성하게 하기

<!-- .claude/commands/pr.md -->
---
description: "PR 생성하기"
allowed-tools: ["Bash(git:*)", "Bash(gh:*)"]
---

# PR 생성

현재 브랜치의 변경사항으로 PR을 생성해줘.

## 단계
1. `git diff main...HEAD`로 변경사항 확인
2. 변경 내용 분석하여 PR 제목과 설명 작성
3. `.github/pull_request_template.md` 양식 따르기
4. `gh pr create` 명령으로 PR 생성

## PR 제목 형식
`<type>: <description>`

Types: feat, fix, docs, style, refactor, test, chore

## 인자
$ARGUMENTS

사용:

> /pr 로그인 기능 추가

Claude로 PR 자동 리뷰

"Claude will add a claude-code-review.yml file with a prompt already in it." — Builder.io

# GitHub App 설치
/install-github-app

설치 후 PR에 @claude 멘션하면 자동 리뷰!


6. 커스텀 슬래시 명령어

반복되는 워크플로우를 명령어로 저장하면 한 줄로 복잡한 작업을 실행할 수 있어요.

명령어 저장 위치

~/.claude/commands/       # 개인용 (모든 프로젝트)
.claude/commands/         # 프로젝트용 (팀 공유)

실용적인 명령어 예시

빠른 커밋:

<!-- .claude/commands/commit.md -->
---
description: "AI가 커밋 메시지 작성"
allowed-tools: ["Bash(git:*)"]
---

1. `git status`와 `git diff`로 변경사항 확인
2. Conventional Commit 형식으로 메시지 작성
3. 형식: `<emoji> <type>: <description>`
   - ✨ feat, 🐛 fix, 📝 docs, ♻️ refactor
4. `git commit` 실행

빠른 테스트:

<!-- .claude/commands/test.md -->
---
description: "변경된 파일 관련 테스트 실행"
---

1. `git diff --name-only`로 변경된 파일 확인
2. 관련 테스트 파일 찾기
3. 해당 테스트만 실행
4. 실패하면 수정 제안

GitHub 이슈 처리:

<!-- .claude/commands/fix-issue.md -->
---
description: "GitHub 이슈 분석하고 수정"
allowed-tools: ["Bash(gh:*)", "Bash(git:*)"]
---

GitHub 이슈 #$ARGUMENTS 분석하고 수정해줘:

1. `gh issue view $ARGUMENTS`로 이슈 내용 확인
2. 관련 코드 찾기
3. 수정 구현
4. 테스트 작성
5. 커밋하고 PR 생성
6. PR을 이슈에 연결

사용:

> /fix-issue 123

7. 세션 관리

세션 이어가기

# 가장 최근 세션 이어가기
claude --continue
# 또는
claude -c

# 특정 세션 재개
claude --resume abc123

"claude -c preserves previous context when resuming work, making it effective for long refactoring sessions or phased feature implementations." — SmartScope

세션 저장 팁

긴 작업 전에 CLAUDE.md에 상태 저장:

<!-- CLAUDE.md 추가 -->

## Current Task
- 로그인 기능 구현 중
- 완료: API 엔드포인트
- 진행중: 프론트엔드 폼
- TODO: 에러 핸들링

## Session Notes
- 2024-01-15: OAuth 연동 시작
- 이슈: 리프레시 토큰 만료 처리 필요

"As you approach your token budget limit, save your current progress and state to memory before the context window refreshes." — Claude Docs


8. 헤드리스 모드 (CI/CD 자동화)

비대화형 실행

"Claude Code includes headless mode for non-interactive contexts like CI, pre-commit hooks, build scripts, and automation." — Anthropic Best Practices

# 단일 명령 실행
claude -p "이 코드 보안 취약점 검사해줘"

# JSON 출력
claude -p "코드 분석해줘" --output-format json

# 도구 제한 + 턴 제한
claude -p "보안 리뷰해줘" \
  --allowedTools Read,Grep,Glob \
  --max-turns 3 \
  > security_report.json

Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: claude-review
        name: Claude Code Review
        entry: claude -p "이 diff에서 버그나 보안 이슈 찾아줘" --max-turns 2
        language: system
        pass_filenames: false

GitHub Actions 연동

# .github/workflows/claude-review.yml
name: Claude Review
on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Claude Review
        run: |
          claude -p "PR 변경사항 리뷰해줘: $(git diff origin/main)" \
            --output-format json \
            > review.json

9. 생산성 극대화 패턴

패턴 1: 병렬 세션

"You could have one session working on a new feature, another fixing a bug, and a third refactoring some old code, all without the usual pain of stashing changes." — eesel.ai

# 터미널 1: 새 기능
cd ~/project && git worktree add ../feature-login feature-login
cd ../feature-login && claude

# 터미널 2: 버그 수정
cd ~/project && git worktree add ../bugfix-auth bugfix-auth
cd ../bugfix-auth && claude

# 터미널 3: 리팩토링
cd ~/project && git worktree add ../refactor-api refactor-api
cd ../refactor-api && claude

패턴 2: Claude가 Claude 리뷰

"A simple but effective approach is to have one Claude write code while another reviews or tests it." — Anthropic Best Practices

# 터미널 1: 코드 작성
claude "로그인 기능 구현해줘"

# 터미널 2: 리뷰
claude "src/auth/ 폴더 코드 리뷰해줘. 보안 이슈 중점으로."

패턴 3: 온보딩 가속

"At Anthropic, using Claude Code in this way has become our core onboarding workflow, significantly improving ramp-up time." — Anthropic Best Practices

# 새 프로젝트 이해하기
claude "이 프로젝트 구조 설명해줘"
claude "인증 시스템이 어떻게 작동하는지 설명해줘"
claude "이 함수가 왜 이렇게 설계됐는지 git 히스토리 보고 알려줘"

10. 체크리스트

매일 아침

  • [ ] 어제 세션 이어가기: claude -c
  • [ ] CLAUDE.md에 오늘 할 일 업데이트
  • [ ] /clear로 깨끗한 시작

새 작업 시작 시

  • [ ] /clear
  • [ ] 목표 명확하게 설명
  • [ ] 관련 파일 @ 태그로 참조
  • [ ] 제약사항 명시 (언어, 프레임워크 등)

작업 완료 시

  • [ ] 자동 커밋 확인
  • [ ] 커밋 메시지 정리 (squash/reword)
  • [ ] /pr로 PR 생성

키보드 연습 (1주일)

  • [ ] Day 1-2: Escape, Tab, ↑/↓ 익히기
  • [ ] Day 3-4: Ctrl+A/E, Ctrl+W 익히기
  • [ ] Day 5-7: 셸 alias 설정하고 사용

마무리

생산성은 작은 습관의 축적이에요.

오늘 당장 해볼 것:

  1. 터미널 설정 — Option을 Meta로 설정
  2. 셸 alias 추가 — c, cc, cr
  3. 자동 커밋 Hook — Stop 이벤트에 git commit
  4. PR 템플릿 — .github/pull_request_template.md

기억하세요:

  • Escape — 잘못 가면 바로 중단
  • Double-Escape — 되감기
  • Tab — 파일 자동완성
  • /clear — 새 작업마다 리셋
  • 구체적 프롬프트 — 컨텍스트가 생명

"Pro tip: use /clear often. Every time you start something new, clear the chat. You don't need all that history eating your tokens." — Builder.io

처음엔 느려도 1주일만 연습하면 2배는 빨라져요. 마우스 안 쓰고 키보드만으로 코딩하는 그 날이 올 거예요. 화이팅! 🚀


참고 자료

Anthropic 공식

커뮤니티 가이드

도구


 

반응형