메인 콘텐츠로 건너뛰기

openclaw sessions

저장된 대화 세션을 나열합니다.
openclaw sessions
openclaw sessions --agent work
openclaw sessions --all-agents
openclaw sessions --active 120
openclaw sessions --verbose
openclaw sessions --json
범위 선택:
  • 기본값: 구성된 기본 에이전트 저장소
  • --verbose: 자세한 로깅
  • --agent <id>: 하나의 구성된 에이전트 저장소
  • --all-agents: 모든 구성된 에이전트 저장소 집계
  • --store <path>: 명시적 저장소 경로(--agent 또는 --all-agents와 함께 사용할 수 없음)
openclaw sessions --all-agents는 구성된 에이전트 저장소를 읽습니다. Gateway 및 ACP 세션 검색은 더 넓은 범위를 다룹니다. 기본 agents/ 루트 또는 템플릿화된 session.store 루트 아래에서 디스크에만 있는 저장소도 포함합니다. 이렇게 발견된 저장소는 에이전트 루트 내부의 일반 sessions.json 파일로 해석되어야 하며, 심볼릭 링크와 루트 외부 경로는 건너뜁니다. JSON 예시: openclaw sessions --all-agents --json:
{
  "path": null,
  "stores": [
    { "agentId": "main", "path": "/home/user/.openclaw/agents/main/sessions/sessions.json" },
    { "agentId": "work", "path": "/home/user/.openclaw/agents/work/sessions/sessions.json" }
  ],
  "allAgents": true,
  "count": 2,
  "activeMinutes": null,
  "sessions": [
    { "agentId": "main", "key": "agent:main:main", "model": "gpt-5" },
    { "agentId": "work", "key": "agent:work:main", "model": "claude-opus-4-6" }
  ]
}

정리 유지 관리

다음 쓰기 주기를 기다리지 않고 지금 유지 관리를 실행합니다:
openclaw sessions cleanup --dry-run
openclaw sessions cleanup --agent work --dry-run
openclaw sessions cleanup --all-agents --dry-run
openclaw sessions cleanup --enforce
openclaw sessions cleanup --enforce --active-key "agent:main:telegram:direct:123"
openclaw sessions cleanup --json
openclaw sessions cleanup은 config의 session.maintenance 설정을 사용합니다.
  • 범위 참고: openclaw sessions cleanup은 세션 저장소/transcript만 유지 관리합니다. cron/runs/<jobId>.jsonl의 cron 실행 로그는 정리하지 않습니다. 이러한 로그는 Cron configuration에 있는 cron.runLog.maxBytescron.runLog.keepLines로 관리되며, Cron maintenance에 설명되어 있습니다.
  • --dry-run: 쓰지 않고 얼마나 많은 항목이 정리/상한 적용될지 미리 봅니다.
    • 텍스트 모드에서 dry-run은 세션별 작업 표(Action, Key, Age, Model, Flags)를 출력하므로 무엇이 유지되고 제거될지 확인할 수 있습니다.
  • --enforce: session.maintenance.modewarn이어도 유지 관리를 적용합니다.
  • --fix-missing: transcript 파일이 없는 항목을 제거합니다. 일반적으로 아직 연령/개수 기준으로 정리 대상이 아니더라도 제거합니다.
  • --active-key <key>: 특정 활성 키가 디스크 예산으로 인해 제거되지 않도록 보호합니다.
  • --agent <id>: 하나의 구성된 에이전트 저장소에 대해 정리 실행
  • --all-agents: 모든 구성된 에이전트 저장소에 대해 정리 실행
  • --store <path>: 특정 sessions.json 파일을 대상으로 실행
  • --json: JSON 요약 출력. --all-agents와 함께 사용하면 저장소별 요약 하나씩이 출력에 포함됩니다.
openclaw sessions cleanup --all-agents --dry-run --json:
{
  "allAgents": true,
  "mode": "warn",
  "dryRun": true,
  "stores": [
    {
      "agentId": "main",
      "storePath": "/home/user/.openclaw/agents/main/sessions/sessions.json",
      "beforeCount": 120,
      "afterCount": 80,
      "pruned": 40,
      "capped": 0
    },
    {
      "agentId": "work",
      "storePath": "/home/user/.openclaw/agents/work/sessions/sessions.json",
      "beforeCount": 18,
      "afterCount": 18,
      "pruned": 0,
      "capped": 0
    }
  ]
}
관련 항목: