Home / Guides / Managing Claude Code sessions

여러 Claude Code 세션을 동시에 관리하는 법

Managing multiple Claude Code sessions at once: worktrees, naming, permissions, hooks and a process monitor

한국어 · English

최종 업데이트 2026-10-07 · 작성: SETLOG · 읽는 시간 10분

Claude Code에 익숙해지면 터미널 창이 자연스럽게 늘어납니다. 한쪽에서는 테스트를 고치게 하고, 다른 쪽에서는 문서를 정리하게 하고, 세 번째 창에서는 리팩터링 계획을 짜게 합니다. 처리량은 늘지만 대가가 따릅니다. 어느 창이 무슨 일을 하는지 잊고, 끝난 줄 모르고 방치하고, 두 세션이 같은 파일을 동시에 고쳐 충돌하기도 합니다. 이 글은 병렬 세션을 굴릴 때 겪는 문제를 격리, 이름, 권한, 알림, 가시성, 컨텍스트의 여섯 축으로 나눠 공식 문서에 근거한 습관으로 정리한 것입니다. 마지막에는 프로세스 수준 모니터인 ClaudeMiner를 한계와 함께 소개합니다.

Claude Code는 빠르게 바뀌는 도구입니다. 아래 내용은 2026-10-07에 code.claude.com 공식 문서에서 확인한 것이며, 명령과 단축키는 버전에 따라 다를 수 있습니다. 문서에 "v2.1.xxx 이상"이라고 적힌 기능은 그렇게 표기했습니다. 막히면 공식 문서의 해당 쪽을 먼저 확인하세요.

병렬 실행 방식 먼저 고르기

"여러 개를 동시에"라고 해도 방식이 하나가 아닙니다. 공식 문서도 worktree, 서브에이전트, 백그라운드 세션(에이전트 뷰), 에이전트 팀을 서로 다른 도구로 설명합니다. 작업 성격에 맞는 쪽을 고르면 관리 부담이 크게 줄어듭니다.

병렬 작업 방식 비교
방식무엇을 나누나잘 맞는 경우주의
터미널 창 여러 개 + worktree작업 폴더와 브랜치(파일 편집 격리)같은 저장소에서 기능·버그를 따로 진행의존성 설치와 .env는 worktree마다 따로 준비해야 함
서브에이전트한 세션 안의 컨텍스트조사·탐색을 맡기고 요약만 받기세션 자체를 늘리는 것이 아님
백그라운드 세션(에이전트 뷰)터미널 없이 도는 세션여러 세션을 한 화면에서 관리연구 프리뷰, v2.1.257 이상, 화면·단축키가 바뀔 수 있음
에이전트 팀, 세션 간 메시징세션끼리 협업복잡한 분업각각 별도 문서를 먼저 읽을 것

이 글은 개인 개발자가 가장 흔히 쓰는 첫 번째 방식, 즉 터미널 여러 개와 worktree를 중심에 두고 나머지는 보조 수단으로 다룹니다.

세션 하나에 작업 하나

가장 효과가 큰 규칙은 한 세션에 한 가지 목적만 주는 것입니다. 버그 수정과 기능 추가와 코드 리뷰를 섞으면 대화가 길어지고 앞의 맥락이 뒤 작업에 간섭합니다. 작업이 끝나면 세션을 정리하고 다음 일은 새 세션에서 시작하세요. 첫 프롬프트에 목표와 완료 기준을 한 줄로 적어 두면 한참 뒤 화면을 봐도 맥락을 복원하기 쉽습니다.

이름 붙이기

Claude Code는 세션에 이름을 붙이는 방법을 직접 제공합니다. 시작할 때 claude -n auth-refactor, 진행 중에는 /rename auth-refactor를 쓰고, 세션 선택 화면에서는 강조한 항목에서 Ctrl+R로 바꿀 수 있습니다. 이름을 붙이면 claude --resume auth-refactor나 /resume auth-refactor로 바로 돌아갑니다. 같은 이름을 쓰는 세션이 이미 살아 있으면 새 세션 이름 뒤에 두 단어짜리 접미사가 붙고 알려 주므로 이름이 겹치는 상황도 어느 정도 방지됩니다. 이름을 안 붙인 세션은 첫 프롬프트 요약으로 만든 제목이 생기지만 "작업 폴더 이름+두 글자" 같은 기본 표시명은 재개용 이름으로 쓸 수 없다고 문서가 설명합니다.

돌아오기

worktree로 파일 충돌 막기

여러 세션이 같은 저장소의 같은 폴더에서 일하면 서로의 수정을 덮어쓰거나 반쯤 끝난 변경을 읽게 됩니다. git worktree는 하나의 저장소에서 브랜치마다 별도 작업 폴더를 만들어 이 문제를 정면으로 푸는 기능이고, Claude Code는 이를 플래그 하나로 지원합니다.

claude --worktree feature-auth     # 또는 -w feature-auth

기본 동작은 이렇습니다. 저장소 루트의 .claude/worktrees/feature-auth/에 새 체크아웃을 만들고 worktree-feature-auth 브랜치를 새로 만듭니다. 이름을 생략하면 bright-running-fox 같은 이름을 자동으로 붙입니다. 다른 터미널에서 다른 이름으로 같은 명령을 실행하면 두 번째 격리 세션이 됩니다. 알아 둘 점이 몇 가지 있습니다.

git을 직접 쓰고 싶다면 git worktree add ../project-feature-a -b feature-a로 만든 폴더에서 평소처럼 claude를 실행해도 됩니다. 목록은 git worktree list, 정리는 git worktree remove입니다. 같은 파일을 반드시 고쳐야 하는 작업이라면 worktree로 나누는 대신 순서를 정해 한 세션씩 진행하는 편이 합칠 때 덜 아픕니다.

권한 모드: 세션마다 신뢰 수준 다르게

세션이 여러 개일 때는 모든 세션이 같은 권한 모드일 필요가 없습니다. 공식 문서가 정리한 모드는 아래와 같습니다. 설정 파일의 값은 영문 이름이고, 질문마다 확인하는 모드는 화면에서 "Manual"로 불리지만 값은 default입니다.

Claude Code 권한 모드(공식 문서 기준)
모드묻지 않고 하는 일병렬 작업에서의 쓰임새
default (Manual)읽기만민감한 작업, 처음 보는 저장소
acceptEdits읽기, 파일 편집, mkdir·mv 같은 기본 파일 명령worktree 안에서 코드를 반복 수정하며 diff를 직접 검토할 때
plan읽기(계획 제안만, 승인 전 편집 없음)조사·설계 세션
auto전부 실행하되 분류 모델이 백그라운드에서 안전 검사오래 걸리는 작업에서 확인 피로를 줄일 때
dontAsk읽기와 사전 승인 도구만(나머지는 거부)CI, 스크립트
bypassPermissions전부격리된 컨테이너·VM에서만

세션 안에서는 Shift+Tab으로 모드를 순환합니다. 문서 기준으로 auto에서 한 번 누르면 default, 이어서 acceptEdits, plan 순이며 상태 표시줄에 현재 모드가 나옵니다. 시작할 때는 claude --permission-mode plan처럼 지정합니다. 문서의 설명에 따르면 deny 규칙은 bypassPermissions에서도 적용되고, 보호 경로에 대한 쓰기는 이 모드가 아니면 자동 승인되지 않습니다. 또 재개할 때 터미널에서 --continue나 --resume을 쓰면 세션이 끝날 때의 모드가 대체로 복원되지만 bypassPermissions는 복원되지 않으니, 모드는 재개 후 상태 표시줄로 확인하는 습관이 안전합니다.

제 권장은 이렇습니다(공식 규칙이 아니라 경험에서 나온 의견입니다). 조사·설계 세션은 plan, 별도 worktree에서 도는 구현 세션은 acceptEdits나 auto, 운영 설정이나 삭제가 걸린 세션은 default로 둡니다. --dangerously-skip-permissions류의 전면 우회는 일회용 컨테이너 밖에서는 쓰지 마세요.

끝났다는 신호를 놓치지 않기: 훅 알림

병렬 작업의 이점은 기다리는 동안 다른 일을 하는 것인데, 끝났는지 보려고 창을 계속 오가면 그 이점이 사라집니다. 가장 확실한 방법은 Claude Code 자체의 훅(hooks)입니다. 훅은 수명주기의 특정 시점에 실행되는 사용자 정의 셸 명령입니다. 문서가 소개하는 시작 예시는 ~/.claude/settings.json에 Notification 훅을 넣는 것입니다. 이 이벤트는 Claude가 입력이나 권한을 기다릴 때 발생합니다. macOS에서는 다음과 같이 씁니다.

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}

설정한 뒤 프롬프트에서 /hooks를 입력하면 등록된 훅 목록에서 확인할 수 있습니다. 시험은 Shift+Tab으로 Manual 모드로 바꾸고 권한이 필요한 일을 시킨 다음 다른 앱으로 전환해 알림이 오는지 보면 됩니다. 문서가 주의를 주는 점이 하나 있습니다. osascript는 스크립트 편집기를 통해 알림을 보내는데 이 앱에 알림 권한이 없으면 명령이 조용히 실패하고 macOS도 권한을 묻지 않습니다. 알림이 안 뜨면 터미널에서 osascript -e 'display notification "test"'로 먼저 점검하세요.

"응답이 끝났을 때"도 알고 싶다면 Stop 이벤트(Claude가 응답을 마칠 때 실행)를 씁니다. 같은 hooks 객체 안에 형제 키로 넣어야 하며 기존 hooks 키를 통째로 덮어쓰지 않도록 주의하세요.

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude finished responding\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}

다만 두 알림이 모두 켜져 있으면 세션이 많을 때 알림이 쏟아져 오히려 둔감해집니다. 저는 사람의 입력이 필요한 시점(Notification)만 켜 두고, 완료 알림은 오래 걸리는 세션에만 쓰는 것을 권합니다. 터미널 앱이 제공하는 벨·알림 기능을 켜는 방법도 있습니다.

한 화면에서 보기: 에이전트 뷰와 외부 모니터

에이전트 뷰(claude agents)

공식 기능으로 claude agents 명령이 있습니다. 문서는 이를 연구 프리뷰이며 v2.1.257 이상에서 쓸 수 있고 인터페이스와 단축키가 바뀔 수 있다고 설명합니다. 터미널을 붙들지 않는 백그라운드 세션들을 한 화면의 표로 보여 주고, 각 줄에 세션 이름, 현재 활동 한 줄 요약, 경과 시간, 상태가 나옵니다. 상태는 작업 중, 입력 필요, 유휴, 완료, 실패, 중지로 구분됩니다. 백그라운드 세션은 claude --bg "프롬프트"나 세션 안의 /bg로 시작합니다. Claude Code 내부 상태를 읽어 "입력이 필요함"을 알려 준다는 점이 외부 도구와 가장 큰 차이입니다.

프로세스 수준의 외부 모니터

평소처럼 여러 터미널 창에서 세션을 돌리는 경우에는 에이전트 뷰가 보여 주지 못하는 영역이 있습니다. 이때 운영체제의 프로세스 정보로 한눈에 보려는 도구가 아래에서 소개할 ClaudeMiner입니다. 도구 없이도 터미널에서 ps -axo pid,tty,%cpu,command | grep '[c]laude' 같은 명령으로 Claude Code 프로세스와 연결된 터미널(TTY) 열을 볼 수 있습니다. macOS에서 TTY가 ??로 나오면 터미널이 없는 프로세스일 가능성이 큽니다.

멈춘 세션과 좀비 프로세스

세션이 오래 반응하지 않을 때는 먼저 정말 멈췄는지 확인합니다. 큰 작업이나 느린 명령을 실행 중일 수 있습니다. 출력이 더 나오지 않고 CPU도 계속 바닥이면 입력 대기이거나 멈춘 것일 수 있습니다. 한편 터미널 창을 닫았는데 프로세스가 남는 경우가 있습니다. 연결된 터미널이 없는 프로세스는 아무도 볼 수 없어 자원만 쓰는 고아가 되기 쉽습니다. 종료하기 전에 그 프로세스가 진행 중인 작업이 없는지 반드시 확인하세요. 프로세스 종료는 되돌릴 수 없고, 아직 저장되지 않은 대화 상태가 사라질 수 있습니다.

컨텍스트를 작게 유지하기

대화가 길어질수록 응답 품질과 속도에 부담이 갑니다. 세션 안에서 쓸 수 있는 문서화된 도구는 다음과 같습니다.

Pro·Max 요금제에서 한 시간 넘게 쉰 100,000토큰 이상의 세션을 재개하면 요약 후 재개할지, 그대로 재개할지 묻는 창이 열릴 수 있다고 문서가 설명합니다. 이 시점에는 프롬프트 캐시가 이미 만료되어 첫 요청에 전체 기록을 다시 처리하므로, 오래 쉰 세션은 이어 가기보다 요약하거나 새로 시작하는 쪽이 대체로 저렴합니다.

ClaudeMiner: 프로세스 수준 모니터

ClaudeMiner는 컴퓨터에서 돌아가는 Claude Code 프로세스를 캐릭터로 보여 주는 오픈소스(MIT) 모니터입니다. SETLOG가 만든 앱이며, Claude Code의 제작사와는 무관한 독립 프로젝트입니다. 자세한 사용법은 ClaudeMiner 사용 가이드에 있고 여기서는 이 글의 맥락에서 필요한 부분만 정리합니다.

ClaudeMiner 창. 상단에 전체 세션 4, 작업 중 0, 휴식 4, 좀비 0 카운터가 있고 가운데 영역에 PID 번호가 붙은 자는 얼굴 아이콘 4개가 겹쳐 있다
ClaudeMiner 메인 화면. 세션 4개가 모두 휴식(자는 얼굴) 상태이고 각 아이콘에 프로세스 ID(PID)가 붙습니다. 아이콘이 가까우면 라벨이 겹쳐 보일 수 있습니다.

무엇을 보여 주나

정직한 한계

잘 맞는 경우

  • 터미널을 여러 개 열어 두고 "지금 누가 CPU를 쓰는지" 한눈에 보고 싶은 사람
  • 터미널을 닫은 뒤 남는 프로세스가 신경 쓰이는 사람

굳이 필요 없는 경우

  • 세션이 한두 개뿐인 사람
  • 훅 알림이나 에이전트 뷰만으로 충분한 사람
  • Windows·Linux에서 좀비 판정까지 기대하는 사람

시작용 체크리스트

  1. 오늘 할 작업을 세 개 이하로 적고, 작업마다 브랜치와 worktree(claude -w 이름)를 만든다.
  2. 세션 이름(-n 또는 /rename)을 작업 이름과 맞춘다.
  3. 조사 세션은 plan, 구현 세션은 worktree 안에서 acceptEdits 이상으로 시작한다.
  4. Notification 훅을 설정하고 /hooks로 확인한다.
  5. 푸시하지 않은 커밋이 필요한 작업은 worktree.baseRef를 먼저 확인한다.
  6. 작업이 끝나면 병합하고 worktree를 정리하며 세션은 /clear하거나 닫는다.
  7. 하루가 끝나면 남은 세션과 TTY 없는 낯선 프로세스를 점검한다.

출처 및 더 읽을거리

  1. Claude Code Docs: Run parallel sessions with worktrees
  2. Claude Code Docs: Manage sessions (naming, resume, branch, context commands)
  3. Claude Code Docs: Automate actions with hooks
  4. Claude Code Docs: Choose a permission mode
  5. Claude Code Docs: Agent view (background sessions)
  6. Claude Code Docs: Common workflows
  7. Claude Code Docs: Best practices
  8. ClaudeMiner GitHub repository (README, MIT license)

자주 묻는 질문

동시에 몇 개까지 돌리는 게 좋은가요?

정해진 숫자는 없습니다. 각 결과를 제때 검토할 수 있는 개수가 한계이고, 검토 대기가 쌓이기 시작하면 이미 많은 것입니다. 보통 두세 개로 시작해 보세요.

worktree는 꼭 필요한가요?

같은 저장소에서 동시에 코드를 고치는 경우에만 필요합니다. 읽기 위주의 조사 세션은 별도 폴더 없이도 됩니다. claude --worktree 이름 으로 만들 수 있습니다.

새 worktree에 방금 만든 커밋이 없습니다.

기본 설정(worktree.baseRef: fresh)은 원격의 기본 브랜치에서 새로 갈라지므로 푸시하지 않은 로컬 커밋은 포함되지 않습니다. 설정을 head로 바꾸거나 git으로 원하는 브랜치에서 직접 worktree를 만드세요.

작업이 끝나면 알림을 받으려면 어떻게 하나요?

~/.claude/settings.json에 Notification 훅(입력·권한 대기 시)이나 Stop 훅(응답 종료 시)을 추가하고 /hooks로 확인합니다. macOS에서 osascript 알림이 안 뜨면 스크립트 편집기의 알림 권한을 확인하세요.

한 세션에서 오래 이어가는 것은 나쁜가요?

같은 목적이 이어진다면 괜찮지만 대화가 길수록 앞의 맥락이 간섭하고 비용이 늘 수 있습니다. 목적이 바뀌면 /clear나 새 세션을 권합니다.

ClaudeMiner가 꼭 필요한가요?

아닙니다. 훅 알림이나 에이전트 뷰만으로 충분할 수 있습니다. 여러 터미널의 프로세스 상태(CPU 기준)를 한 화면에서 보고 싶을 때 고려할 선택지이며, 세션 이름이나 입력 대기 여부는 알려 주지 못합니다.

Once you get used to Claude Code, terminal windows multiply. One fixes tests, another tidies documentation, a third drafts a refactoring plan. Throughput rises, but so does the cost: you forget which window is doing what, leave finished work unattended, and sometimes two sessions edit the same file and collide. This article breaks the problem into six axes (isolation, names, permissions, notifications, visibility and context) and gives habits grounded in the official documentation. It ends with ClaudeMiner, a process-level monitor, and its honest limits.

Claude Code changes quickly. Everything below was checked against the official code.claude.com documentation on 2026-10-07, and commands and shortcuts may differ by version. Where the docs state a minimum version, it is noted. If something does not work, read the relevant docs page first.

Choose the way you run in parallel

"Several at once" is not a single technique. The official docs describe worktrees, subagents, background sessions (agent view) and agent teams as different tools, and choosing the right one reduces management effort a lot.

Ways to run work in parallel
ApproachWhat it separatesGood forWatch out
Several terminals + worktreesWorking directory and branch (file-edit isolation)A feature and a bug fix in the same repoDependencies and .env must be prepared per worktree
SubagentsContext inside one sessionDelegating research and getting a summary backDoes not add sessions
Background sessions (agent view)Sessions that run without a terminalManaging many sessions on one screenResearch preview, v2.1.257 or later, UI may change
Agent teams, cross-session messagingCollaboration between sessionsComplex division of laborRead their own docs first

This article centers on the approach most solo developers start with, several terminals plus worktrees, and treats the others as supporting tools.

One session, one task

The most effective rule is to give a session a single purpose. Mixing a bug fix, a new feature and a code review makes the conversation long and earlier context interferes with later work. When a task ends, wrap up the session and start the next one fresh. A one-line goal and a definition of done in the first prompt makes it easy to recover the context when you look at the window later.

Naming

Claude Code gives you several ways to name a session. At startup use claude -n auth-refactor; during a session use /rename auth-refactor; in the session picker highlight an entry and press Ctrl+R. A named session can be resumed with claude --resume auth-refactor or /resume auth-refactor. If another live session already uses the name, Claude Code keeps it with that session, gives yours a two-word suffix and tells you. Sessions you do not name get a generated title from your first prompt, but the docs say the default display name (working directory plus two characters) cannot be used to resume.

Coming back

Prevent file collisions with worktrees

When several sessions work in the same folder of the same repository, they overwrite each other's edits or read half-finished changes. A git worktree gives each branch its own working directory, which solves that directly, and Claude Code supports it with one flag.

claude --worktree feature-auth     # or -w feature-auth

By default Claude Code creates a new checkout at .claude/worktrees/feature-auth/ under the repository root on a new branch named worktree-feature-auth. If you omit the name, it generates one such as bright-running-fox. Running the same command with another name in a second terminal starts a second isolated session. A few things to know:

If you prefer plain git, create a folder with git worktree add ../project-feature-a -b feature-a and run claude there as usual. git worktree list shows them and git worktree remove cleans up. If two tasks must edit the same file, serializing them one session at a time hurts less at merge time than splitting them across worktrees.

Permission modes: different trust per session

With several sessions, they need not all share one permission mode. The official modes are below. Config values are English names, and the mode that asks about every action is displayed as "Manual" but its value is default.

Claude Code permission modes (per the official docs)
ModeRuns without askingUse in parallel work
default (Manual)Reads onlySensitive work, unfamiliar repositories
acceptEditsReads, file edits and basic filesystem commands such as mkdir and mvIterating on code inside a worktree while you review the diff
planReads (proposes a plan, no edits before approval)Research and design sessions
autoEverything, with background safety checks by a classifierLong tasks, reducing prompt fatigue
dontAskReads and pre-approved tools only (the rest is denied)CI and scripts
bypassPermissionsEverythingIsolated containers and VMs only

Inside a session, Shift+Tab cycles modes. Per the docs, from auto the first press goes to default, then acceptEdits, then plan, and the status bar shows the current mode. At launch, pass for example claude --permission-mode plan. The docs also explain that deny rules apply even in bypassPermissions, and that writes to protected paths are not auto-approved except in that mode. When you resume from a terminal with --continue or --resume, the mode the session ended in is generally restored, but bypassPermissions is not, so it is safest to glance at the status bar after resuming.

My suggestion (an opinion from experience, not an official rule): run research and design sessions in plan, implementation sessions in their own worktrees in acceptEdits or auto, and anything touching production settings or deletions in default. Do not use blanket bypass flags such as --dangerously-skip-permissions outside a disposable container.

Do not miss "finished": hook notifications

The point of parallel work is doing something else while you wait, and walking between windows to check on progress throws that away. The most dependable option is Claude Code's own hooks, user-defined shell commands that run at specific points in its lifecycle. The docs' starter example adds a Notification hook to ~/.claude/settings.json; that event fires when Claude is waiting for input or permission. On macOS it looks like this.

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}

After saving, type /hooks at the prompt to see the registered hooks. To test, press Shift+Tab until Manual mode, ask for something that needs permission, and switch to another app to see whether a notification arrives. The docs warn about one pitfall: osascript routes notifications through Script Editor, and if that app lacks notification permission the command fails silently and macOS does not prompt you. If nothing appears, test with osascript -e 'display notification "test"' in a terminal first.

If you also want to know when a response finishes, use the Stop event (runs when Claude finishes responding). Add it as a sibling key in the same hooks object, taking care not to overwrite an existing hooks key.

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude finished responding\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}

With many sessions, having both alerts on can flood you and make you numb to them. I suggest keeping only the moment a person is needed (Notification) and using the completion alert only for long-running sessions. Turning on your terminal app's own bell or notification feature is another option.

One screen: agent view and external monitors

Agent view (claude agents)

The official claude agents command is described in the docs as a research preview, available in v2.1.257 or later, with an interface and shortcuts that may change. It shows background sessions, which run without holding a terminal, in a single table with the session name, a one-line summary of current activity, age and state. States are working, needs input, idle, completed, failed and stopped. You start a background session with claude --bg "prompt" or /bg inside a session. The key difference from external tools is that it reads Claude Code's own state and can tell you "needs input".

A process-level external monitor

If you run sessions the usual way in several terminal windows, there is a region agent view does not cover. A tool that tries to give a glance from operating-system process data is ClaudeMiner, introduced below. Even without a tool you can run something like ps -axo pid,tty,%cpu,command | grep '[c]laude' to see Claude Code processes and their terminal (TTY) column. On macOS a TTY of ?? suggests a process without a terminal.

Stuck sessions and zombie processes

When a session does not respond for a long time, first check whether it is really stuck; it may be running a big task or a slow command. If output stops and CPU stays at the floor, it may be waiting for input or hung. Separately, a process can remain after you close its terminal window. A process with no controlling terminal cannot be seen by anyone and easily becomes an orphan that only uses resources. Before terminating one, make sure it has no work in progress. Killing a process cannot be undone and unsaved conversation state may be lost.

Keep context small

As a conversation grows, both response quality and speed suffer. The documented tools inside a session are:

On Pro and Max plans, resuming a session that has been inactive for more than about an hour and is over 100,000 tokens can open a dialog asking whether to resume from a summary or as is, according to the docs. By then the prompt cache has expired and the first request reprocesses the full history, so for a long-idle session a summary or a fresh start is usually cheaper than continuing.

ClaudeMiner: a process-level monitor

ClaudeMiner is an open-source (MIT) monitor that shows each Claude Code process on your computer as a small character. It is made by SETLOG and is an independent project unaffiliated with the makers of Claude Code. The ClaudeMiner guide has the full walkthrough; here is only what matters in this article's context.

ClaudeMiner window with counters for 4 total sessions, 0 working, 4 resting and 0 zombie, and four sleeping-face icons with PID labels overlapping in the middle
ClaudeMiner main window. All four sessions are resting (sleeping face) and each icon carries its process ID (PID). Labels can overlap when icons sit close together.

What it shows

Honest limits

A good fit

  • You keep many terminals open and want to see who is using CPU at a glance
  • You worry about processes lingering after a terminal is closed

You may not need it

  • You run only one or two sessions
  • Hook notifications or agent view are enough
  • You expect zombie detection on Windows or Linux

Starter checklist

  1. Write down three tasks or fewer for the day and create a branch and worktree (claude -w name) per task.
  2. Match session names (-n or /rename) to task names.
  3. Start research sessions in plan, and implementation sessions inside worktrees in acceptEdits or higher.
  4. Set a Notification hook and confirm it with /hooks.
  5. For work that needs unpushed commits, check worktree.baseRef first.
  6. When a task ends, merge, clean up the worktree, and /clear or close the session.
  7. At the end of the day, review leftover sessions and unfamiliar processes with no TTY.

Sources and further reading

  1. Claude Code Docs: Run parallel sessions with worktrees
  2. Claude Code Docs: Manage sessions (naming, resume, branch, context commands)
  3. Claude Code Docs: Automate actions with hooks
  4. Claude Code Docs: Choose a permission mode
  5. Claude Code Docs: Agent view (background sessions)
  6. Claude Code Docs: Common workflows
  7. Claude Code Docs: Best practices
  8. ClaudeMiner GitHub repository (README, MIT license)

FAQ

How many sessions should I run at once?

There is no fixed number. The limit is how many results you can review on time; once review backlog starts to pile up you already have too many. Start with two or three.

Do I really need worktrees?

Only when several sessions edit code in the same repository at once. Read-mostly research sessions do not need a separate folder. Create one with claude --worktree name.

My new worktree is missing the commit I just made.

By default (worktree.baseRef: fresh) a worktree branches from the remote default branch, so unpushed local commits are not included. Set it to head, or create the worktree yourself from the branch you want with git.

How do I get notified when work finishes?

Add a Notification hook (waiting for input or permission) or a Stop hook (response finished) to ~/.claude/settings.json and verify with /hooks. If a macOS osascript notification does not appear, check Script Editor's notification permission.

Is a long-running session a bad idea?

Fine if the purpose stays the same, but the longer the conversation, the more earlier context interferes and the more it can cost. When the purpose changes, use /clear or start a new session.

Do I need ClaudeMiner?

No. Hook notifications or agent view may be enough. It is an option when you want CPU-based process states for many terminals on one screen; it cannot tell you session names or whether a session is waiting for input.