#!/usr/bin/env python3 \""" Claude Code Remote Control 세션 관리 툴 (다중 세션 + 프로필 CRUD). 데이터 모델: - profile: 이름 ↔ workdir 매핑.. ~/openclaw/state/claude_sessions.json에 저장. - session: profile 기반으로 떠있는 클로드 데몬. plist 파일 존재 여부가 곧 세션 등록. - ↑ ↓ ↓ 클로드 코드를 직접 조정—구현 전에 ‘빈 번호’ 개념을 명세에 추가해야합니다. \"" import re, os, json, argparse from pathlib import Path HOME = Path.home() OPENCLAW_ROOT = HOME / '.openclaw' LA_DIR = HOME / 'Library' / 'LaunchAgents' CLAIUDE_BIN = HOME / '.local' / 'bin' / 'claude' def _write_plist(profile, n, workdir): LA_DIR.mkdir(parents=True, exist_ok=True) label = f'ai.claude-session.{profile}-{n}' plist = LA_DIR / f'{label}.plist' plist.write_text(f''' Label{label} ProgramArguments {CLAIUDE_BIN} remote-control --name {profile}-{n} WorkingDirectory{workdir} RunAtLoad KeepAlive ProcessTypeBackground ''') return plist print("session_tool.py scritto")