공유 에이전트 세션
이름이 붙은 세션으로 여러 에이전트, 터미널, 실행 사이에 파일시스템을 공유할 수 있어요. 모든 참여자가 프로젝트의 동일한 copy-on-write 뷰를 보게 돼요.
출처: 문서
본문
세션 만들기
--session으로 이름 붙은 세션을 만들어요:
agentfs run --session my-project /bin/bash
이 명령은 my-project라는 세션을 만들어요. 모든 변경 사항은 .agentfs/my-project.db에 저장돼요.
세션 재개하기
같은 명령을 다시 실행하면 중단했던 곳에서 이어서 할 수 있어요:
# First run - make some changes
agentfs run --session my-project /bin/bash
$ echo "hello" > test.txt
$ exit
# Second run - changes are still there
agentfs run --session my-project /bin/bash
$ cat test.txt
hello
멀티 터미널 협업
여러 터미널이 같은 세션을 동시에 공유할 수 있어요:
# Terminal 1
agentfs run --session shared-work /bin/bash
# Terminal 2 - joins the same filesystem
agentfs run --session shared-work python3 agent.py
# Terminal 3 - also sees the same files
agentfs run --session shared-work vim
모든 터미널이 같은 copy-on-write 파일시스템을 공유해요. 한 터미널에서 이루어진 변경은 다른 터미널에 즉시 보여요.
활용 사례
반복 개발
여러 세션에 걸쳐 작업하기:
# Morning session
agentfs run --session feature-x /bin/bash
# ... work on the feature, then exit for lunch
# Afternoon session - continue where you left off
agentfs run --session feature-x /bin/bash
안전한 실험
세션을 만들고 위험한 시도를 해본 뒤, 유지할지 결정하세요:
agentfs run --session experiment /bin/bash
# ... try some changes
# Option A: Happy with changes
agentfs diff experiment # Review
# Apply changes to real filesystem (manually or via script)
# Option B: Discard everything
rm .agentfs/experiment.db
에이전트 감독
에이전트를 실행하고 다른 터미널에서 작업을 지켜보기:
# Terminal 1: Run the agent
agentfs run --session agent-task python3 agent.py
# Terminal 2: Watch what it's doing
agentfs run --session agent-task /bin/bash
$ watch ls -la # See files being created
$ tail -f agent.log # Monitor logs
세션 관리
세션의 파일 목록 보기:
agentfs fs ls my-session
세션 변경 내역 보기:
agentfs diff my-session
세션 삭제하기:
rm .agentfs/my-session.db
세션 저장소
세션은 .agentfs/ 안에 SQLite 데이터베이스로 저장돼요:
.agentfs/
├── my-project.db
├── experiment.db
└── shared-work.db
각 데이터베이스에는 다음이 들어 있어요:
- 수정된 모든 파일
- 삭제된 파일 마커 (whiteouts)
- 도구 호출 감사 로그
- 키-값 저장소 데이터
더 알아보기 (Learn more)
- 변경 감사 — 세션에서 무슨 일이 있었는지 검토하기
- 오버레이 파일시스템 — copy-on-write 작동 방식
- 동기화 — 세션을 Turso Cloud에 동기화하기
- 샌드박스 — 에이전틱 코딩 워크플로