C.W.K.
Stream
Lesson 02 of 13 · published

Interaction Mode — Interactive, -p, -c, -r

~16 min · modes, interactive, print, continue, resume, scripting

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

flag 4개로 95% 쓰임 커버

Claude Code 의 interaction 모델은 의도적으로 작아: 기본 모드 하나, flag 로 토글되는 변종 셋. "이 일에는 어느 거?" 즉답 가능해지면 도구랑 안 싸우게 돼.

기본 — interactive. flag 없이 claude 하면 streaming REPL 떨어져. 지속 대화, 멀티턴 도구 호출, 자유 탐색. 생각하기 좋은 모드.

-p / --print. 단발. prompt in, stdout 으로 답, exit. Unix 세계에 자연스럽게 파이프돼. cron job, GitHub Actions, AI 단계가 필요한 모든 스크립트의 모드.

-c / --continue. 마지막 세션을 터미널 안 닫은 것처럼 resume. 대화 history 그대로. "책상 돌아왔어" 명령어.

-r <id> / --resume. 특정 세션 resume. 병렬 스레드 여러 개 굴리고 있을 때 골라서 잡아. claude --list-sessions 가 인벤토리 보여줘.

Code

Print mode is the secret weapon·bash
# Trivial: one-shot Q&A
claude -p "what does jq -r do?"

# Real: pipe the staged diff into AI review
git diff --staged | claude -p "review for bugs and missing tests"

# Compose: read a file in, write to another
claude -p "convert this README to a one-paragraph elevator pitch" \
  < README.md > pitch.md

# JSON for downstream parsing
claude -p "list every TODO in src/" --output-format json | jq '.result'
Resume after a long break·bash
# Pick up the last conversation, full context restored
claude -c

# Continue with a follow-up
claude -c "now write the integration tests for what you just wrote"

# Multiple parallel projects? List and pick
claude --list-sessions
claude -r "abc123def456"

External links

Exercise

실제 branch 의 실제 diff 잡아. 두 가지로 리뷰 돌려: interactive (claude 켜고 diff 붙여넣고 리뷰 요청) 와 git diff | claude -p. 워크플로우 차이 적어 — 어느 게 어느 일에 맞았어?

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.