Session Recovery & Resume
Never lose progress when switching models
Hit a rate limit? Model error? Learn how to resume sessions, export context, and seamlessly continue your work.
Understanding Sessions
Every conversation with Claude Code creates a session with a unique ID. Sessions are stored locally per project.
~/.claude/history.jsonl # Find your session ID from history cat ~/.claude/history.jsonl | tail -5 # Look for sessionId in the JSON object # Example output: {"display":"/clear","timestamp":1765163522956,"project":"...","sessionId":"74f292c0-49fa-41c0-a2d8-dd2c3ef9c4be"} # Sessions are stored per-project in: # ~/.claude/projects/{project-path-encoded}/{session-id}.jsonl
Session Sharing
ImportantDefault Claude, API profiles, and CLIProxy share session storage. CCS sub-accounts have separate isolated sessions.
- β’ Default Claude β API profiles (GLM, Kimi)
- β’ API profiles β CLIProxy (gemini, codex, agy)
- β’ Default Claude β CLIProxy
- β’ All stored at ~/.claude/projects/{project}/
- β’ CCS sub-accounts (work, personal,...)
- β’ Each instance has separate folder: ~/.ccs/instances/{name}/
- β’ Cannot switch to other sub-accounts
- β’ Cannot switch to Default Claude/API profiles/CLIProxy
Option 2: Copy session .jsonl file to target config directory (e.g., ~/.claude/projects/{project}/ β ~/.ccs/instances/{name}/projects/{project}/).
Resume Sessions
Default Claude, API profiles (GLM, Kimi), and CLIProxy (gemini, codex, agy) can /resume each other. See Session Sharing above for details.
> /resume > /resume 74f292c0-49fa-41c0-a2d8-dd2c3ef9c4be ccs glm --resume ccs agy --resume 74f292c0-49fa-41c0-a2d8-dd2c3ef9c4be
Export Context
For Bloated SessionsWhen your session context is too large (100K+ tokens), /resume just moves the problem. Use /export to start fresh with only the essential context.
Use /export when context is bloated, OR when switching to/from CCS sub-account (isolated).
Model Fallback Strategies
Set up multiple terminals with providers ready. Default Claude, API profiles, CLIProxy can /resume each other. Only CCS sub-accounts are isolated.
Pro Tips
Power UserAdvanced tricks for seamless session recovery when you need them most.
# During your session, rename it: /rename auth-feature # Later resume by name OR UUID (both work): /resume auth-feature # β Easy to remember /resume 74f292c0... # β Still works # Or run directly from terminal: ccs glm/agy "/resume auth-feature"
# If you got kicked out of a session for any reason: ccs glm/agy/work --continue continue # This automatically resumes and continues your last session
# Inside your current session, when you hit rate limit: /login # Select a different Claude sub-account # Then type "continue" to resume your work continue
Emergency Recovery Checklist
Bookmark this. When things go wrong mid-task, follow these steps:
DON'T PANIC
Your work isn't lost. Sessions are saved locally.
ASSESS CONTEXT SIZE
Check if session is bloated (slow responses = likely bloated)
IF CONTEXT HEALTHY β /RESUME
Use /resume (Default Claude, API profiles, CLIProxy all share sessions)
IF CONTEXT BLOATED β /EXPORT
Export and start fresh
CONTINUE WORKING!
You're back in action.
Save 80%+ on Costs
Start complex tasks with Claude, then /resume with GLM (API profile) for routine implementation at 81% lower cost.
No Downtime
Don't let rate limits stop your flow. /resume in a compatible provider and continue working.