Claude Code에 2개의 계정이 있는데 둘 사이를 전환하는 것이 불편합니까?
hackernews
|
|
📦 오픈소스
#claude
#claude code
#개발 도구
#계정 전환
#생산성
#작업 환경
#하드웨어/반도체
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
Claude Code 사용자들의 계정 전환 불편함을 해소하기 위해 단 한 번의 명령어로 즉각적인 프로필 전환을 가능하게 하는 오픈소스 도구 'claude-switch'가 공개되었습니다. 이 도구는 외부 종속성 없이 순수 bash 환경에서 작동하며, 모든 인증 정보는 macOS 키체인에 안전하게 저장됩니다. 약 8시간마다 만료되는 OAuth 토큰의 특성을 고려해 프로필 전환 시 토큰을 자동으로 갱신해주며, 사용자는 직접 `claude-switch setup` 명령어를 통해 개인 및 업무용 등 필요한 만큼의 계정을 자유롭게 등록하고 관리할 수 있습니다. 현재 macOS 환경의 bash 및 zsh 쉘 사용자를 지원하며 MIT 라이선스로 배포되고 있습니다.
본문
Switching between Claude Code accounts sucks. You have to log out, log back in, wait, do it again when you want to switch back. If you have a work account and a personal account, you know the pain. This fixes that. One command to switch, instant, done. $ c status Profiles ──────────────────────────────────── ● personal max 1.7h left ○ work team 7.2h left $ c work ● Switched to work Pure bash, zero dependencies, credentials stored securely in macOS Keychain. brew install Mamdouh66/tap/claude-switch Then add to your ~/.zshrc : source $(brew --prefix)/share/claude-switch.zsh curl -fsSL https://raw.githubusercontent.com/Mamdouh66/claude-switch/main/install.sh | bash git clone https://github.com/Mamdouh66/claude-switch.git cd claude-switch ./install.sh First install runs a guided setup automatically. You can also run it anytime with claude-switch setup . It asks you to: - Pick a shortcut — c ,cc ,code , whatever you want - Name your accounts — call them anything, not limited to "work" and "personal" - Add as many accounts as you need Or do it manually: # You're logged into your first account claude-switch save work # Log into the other one claude auth logout && claude auth login claude-switch save personal c work # switch to work + launch claude c personal # switch to personal + launch claude c status # show all profiles and token health c refresh # refresh active profile's token c # launch claude with current profile c -p "hello" # any flags pass through to claude The shortcut name is configurable: claude-switch alias cc # now it's `cc work`, `cc status`, etc. All commands also work directly: claude-switch # switch to a profile claude-switch status # show profiles and token health claude-switch setup # guided setup wizard claude-switch save # save current credentials as a profile claude-switch list # list profile names claude-switch remove # delete a profile claude-switch refresh # refresh active token claude-switch alias [name] # show or change shell shortcut Claude Code uses OAuth tokens that expire after about 8 hours. Here's how claude-switch deals with that: - When you switch away from a profile, it saves the current credentials (which Claude may have silently refreshed during your session) back to that profile's Keychain entry. - When you switch to a profile with an expired token, it automatically triggers a refresh and saves the new token. claude-switch refresh lets you manually refresh the active profile whenever you want. This keeps things working smoothly as long as you switch between profiles regularly. Important: There's a separate refresh token that Claude Code uses behind the scenes to get new access tokens. This refresh token lasts much longer (weeks/months), but if you don't use a profile for a very long time and the refresh token expires, you'll need to log in again with claude auth login and re-save the profile withclaude-switch save . In normal use this shouldn't happen. - macOS (uses Keychain for secure credential storage) - Claude Code CLI installed and authenticated - bash or zsh MIT
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유