Shared sessions are publicly accessible to anyone with the link. Review content before sharing to avoid exposing sensitive information.
How Session Sharing Works
Create or select a session
Work on your code in a session as usual. The session contains:
- Full conversation history (your prompts + AI responses)
- File diffs and code changes
- Tool use records (file reads, writes, bash commands)
- Session metadata (title, creation date, model used)
Unique URL generated
OpenCode creates a unique share URL:The URL is automatically copied to your clipboard (TUI) or returned in the API response.
Data synced to cloud
Session data is uploaded to OpenCode’s servers:
- All messages and responses
- File diffs (not full file contents)
- Session configuration
- Metadata (timestamps, model info)
Sharing Modes
OpenCode supports three sharing modes to match different workflows and security requirements.Manual (Default)
Sessions are not shared automatically. You explicitly control when to share.opencode.json
When to use Manual mode
When to use Manual mode
- Default safe mode for most users
- Working with proprietary code
- Only sharing specific debugging sessions
- Explicit control over what gets shared
Auto-share
Every new session is automatically shared upon creation.opencode.json
When to use Auto-share mode
When to use Auto-share mode
Disabled
Sharing is completely disabled. The/share command will not work.
opencode.json
When to use Disabled mode
When to use Disabled mode
- Enterprise environments with strict data policies
- Highly sensitive projects (healthcare, finance, defense)
- Compliance requirements (HIPAA, SOC 2, ISO 27001)
- Air-gapped or offline development
For team-wide enforcement, commit
opencode.json with "share": "disabled" to version control.Using the Share API
Share a Session
Unique identifier for the shared session (prefixed with
s_).Full public URL to the shared session.
Unshare a Session
Remove public access and delete cloud data:shareID and shareURL become null after unsharing. The link will return 404.Check Share Status
Query whether a session is currently shared:What Gets Shared
When you share a session, the following data is uploaded:Conversation History
Conversation History
- All user prompts (your messages)
- All AI responses (assistant messages)
- Tool use records (file operations, bash commands)
- Timestamps and message order
- Model and provider information
File Diffs
File Diffs
- Diffs of changed files (hunks with context)
- File paths relative to project root
- Not full file contents, only changes made during the session
Session Metadata
Session Metadata
- Session title
- Creation and update timestamps
- Parent session ID (if forked)
- Agent used (e.g.,
task,research) - Model configuration
Todo Lists
Todo Lists
- Task breakdown and planning
- Task completion status
- Task descriptions
What is NOT Shared
Privacy and Security
Data Retention
Shared sessions remain accessible indefinitely until explicitly unshared.Automatic expiration is not currently supported. Always manually unshare sessions when collaboration is complete.
Access Control
Shared sessions use URL-based access (no authentication required):- ✅ Simple sharing (no account needed)
- ✅ Works with any browser
- ❌ Anyone with the link can access
- ❌ Cannot restrict to specific users
Securing Shared Sessions
Securing Shared Sessions
Compliance Considerations
For regulated industries (healthcare, finance, government):HIPAA
Do not share sessions containing PHI (Protected Health Information). Use
"share": "disabled" for HIPAA-regulated projects.GDPR
Shared sessions may contain personal data. Ensure compliance with:
- Data processing agreements
- User consent requirements
- Right to erasure (use
/unshare)
SOC 2
Sharing may violate data residency or access control policies. Audit
"share": "auto" configurations.Export Control
Government/defense contractors: Verify that sharing complies with ITAR, EAR, or similar regulations.
Recommendations by Project Type
- Open Source
- Private Startup
- Enterprise
✅ Auto-share enabledBenefits:
opencode.json
- Community can learn from your process
- Easy debugging help from maintainers
- Transparent development
Use Cases
Remote Debugging
Share a session showing the bug reproduction steps. Teammates can see the full context without screenshots.
Code Review
Link to the session in your PR description. Reviewers see the reasoning behind changes.
Documentation
Create “how we built X” posts by sharing sessions. Perfect for engineering blogs.
Onboarding
Share sessions demonstrating common workflows. New hires learn by example.
Support Tickets
When asking for help in GitHub issues, share the session to provide full context.
Teaching
Instructors can share sessions as interactive tutorials. Students see the AI’s reasoning.
Enterprise Features
For organizations needing advanced sharing controls:Self-Hosted Sharing
Self-Hosted Sharing
Deploy your own share server:
- Data never leaves your infrastructure
- Integrate with SSO (SAML, OAuth)
- Custom retention policies
- Audit logs for compliance
SSO-Protected Shares
SSO-Protected Shares
Share Analytics
Share Analytics
Troubleshooting
/share command does nothing
/share command does nothing
Share URL returns 404
Share URL returns 404
Cannot unshare session
Cannot unshare session
Accidentally shared sensitive data
Accidentally shared sensitive data
Best Practices
Review before sharing
Skim the session for sensitive data:
- API keys or tokens
- Internal URLs or hostnames
- Customer data or PII
- Proprietary algorithms
Share early in collaboration
Share at the start of debugging/pairing sessions, not after. Collaborators see your thought process in real-time.
Next Steps
Server API
Use the
/session/:id/share API programmatically.Configuration
Configure sharing modes in
opencode.json.Enterprise
Self-hosted sharing and SSO integration.
Privacy Policy
Review how shared data is handled.