Skills now live in .agents/skills/ — the standard convention aligned with Pi, OpenAI Codex, and the Agent Skills spec. .claude/skills is a symlink back to .agents/skills/ so Claude Code still discovers them. Updated CLAUDE.md to document the setup.
2.1 KiB
2.1 KiB
Session Management
cmux uses isolated browser contexts per surface. Treat each browser surface as its own session.
Related: authentication.md, SKILL.md
Contents
- Surface-Based Sessions
- Isolation Properties
- State Persistence
- Common Patterns
- Cleanup
- Best Practices
Surface-Based Sessions
# session A
cmux browser open https://app.example.com/login --json
# -> surface:7
# session B
cmux browser open https://example.com --json
# -> surface:8
cmux browser surface:7 get url
cmux browser surface:8 get url
Isolation Properties
Each surface has independent:
- cookies
- localStorage/sessionStorage
- tab list and active tab
- navigation history
State Persistence
Save State
cmux browser surface:7 state save /tmp/auth-state.json
Load State
cmux browser surface:8 state load /tmp/auth-state.json
cmux browser surface:8 goto https://app.example.com/dashboard
Common Patterns
Reuse Auth Across New Surface
cmux browser open https://app.example.com/login --json
# login on surface:7 ...
cmux browser surface:7 state save /tmp/auth.json
cmux browser open https://app.example.com --json
# assume surface:8
cmux browser surface:8 state load /tmp/auth.json
cmux browser surface:8 goto https://app.example.com/dashboard
Parallel Multi-Site Tasks
cmux browser open https://site-a.example --json
cmux browser open https://site-b.example --json
cmux browser open https://site-c.example --json
cmux browser surface:11 get text body > /tmp/a.txt
cmux browser surface:12 get text body > /tmp/b.txt
cmux browser surface:13 get text body > /tmp/c.txt
Cleanup
cmux close-surface --surface surface:7
cmux close-surface --surface surface:8
rm -f /tmp/auth-state.json
Best Practices
- Name/log surfaces in your script output so actions stay attributable.
- Keep one task per surface to avoid ref churn.
- Save state after successful auth milestones.
- Re-snapshot after switching tabs/pages inside a surface.