Sessions in CyborgShell allow you to maintain persistent conversation context with AI services. This enables sophisticated multi-turn interactions where the AI "remembers" previous exchanges, making it ideal for building up knowledge bases, maintaining context across multiple queries, and creating reusable AI workflows.
Key Concept: Sessions are stored in browser memory and can be saved to files for persistence and sharing across devices or team members.
Browser Memory (Runtime)
    ↓
globals.chatgpt.sessions = {
    "default": [...conversation history...],
    "coding": [...conversation history...],
    "story": [...conversation history...]
}
    ↓
Files (Persistent Storage)
    chatgpt-session-coding.json
    chatgpt-session-story.json
1. CREATE    → First use of session name creates it
2. BUILD     → Add conversation entries via queries/training
3. USE       → Reference in interactive mode or transformers
4. SAVE      → Persist to file for later use
5. LOAD      → Restore from file when needed
6. CLEAR     → Empty session while keeping structure
7. DELETE    → Remove saved file
# Enter interactive mode
chatgpt
# or simply
!
# Now omit 'chatgpt' prefix
remember my name is Julian
what's my name?
tell me more about yourself
x    # Exit interactive mode
chatgpt 
coding: help me debug this function
coding: now optimize it for performance
coding: add error handling
story: write about a robot
story: make it more dramatic
story: what happened next?
Shorthand: Once in interactive mode, use sessionname: prefix:
# Still in interactive mode
math: calculate 2+2
math: what's the square root?
coding: back to the code problem
# ✅ CORRECT: Use named sessions when switching services
analysis: openai analyze this algorithm
analysis: claude now document it beautifully
analysis: gemini translate docs to Japanese
chatgpt save analysis-workflow
# ⚠️ AVOID: Switching services in same session
# This mixes different AI response styles and contexts
Best Practice: Create a new named session for each service or use separate sessions for different AI providers.
# Clear specific session
chatgpt clear coding
# Clear default session
chatgpt clear
# In transformer (passthrough input)
link 2 1 session myproject: clear
# Save specific session
chatgpt save coding
# Creates: chatgpt-session-coding.json
# Save all sessions
chatgpt save
# Creates: chatgpt-all-sessions.json
# In transformer
link 2 1 session myproject: save
# Load specific session
chatgpt load coding
# In transformer
link 2 1 session myproject: load
# List all sessions with stats
chatgpt sessions
# Output:
# Session: coding (45 entries, 123 KB)
# Session: story (12 entries, 34 KB)
# Session: default (3 entries, 8 KB)
Training allows you to pre-load sessions with context from files or other sessions, creating reusable knowledge bases that inform all subsequent queries.
# Train with a file
chatgpt train coding style-guide.txt
# Train with multiple files
chatgpt train coding style-guide.txt,best-practices.txt
# Train from another session
chatgpt train fullstack coding:,frontend:,backend:
# Train with mixed sources
chatgpt train project docs.txt,api:,database:
# Format:
chatgpt train <session-name> <source1>,<source2>,<source3>
# Sources can be:
# - Files: filename.txt
# - Sessions: sessionname:
# - Mixed: file1.txt,session1:,file2.md,session2:
# Create base knowledge
chatgpt train common style-guide.txt,naming-conventions.txt
# Create specialized knowledge
chatgpt train php laravel-docs.txt,php-best-practices.txt
chatgpt train js react-docs.txt,typescript-guide.txt
# Compose into comprehensive session
chatgpt train fullstack common:,php:,js:
# Save for reuse
chatgpt save fullstack
# Explore PHP best practices interactively
chatgpt 
php: what are Laravel's routing best practices?
php: explain middleware patterns
php: how should I structure controllers?
# The conversation builds up in the 'php' session
chatgpt sessions
# php (12 entries, 45 KB)
# Augment with static docs
chatgpt train php php:,laravel-internal-docs.txt
# Save the curated knowledge
chatgpt save php
# Later: use in pipelines
link 2 1 chatgpt openai session: php review this Laravel code
# Developer A: Builds PHP expertise
chatgpt php: [interactive exploration]
chatgpt train php php:,laravel-internal-docs.txt
chatgpt save php
# Developer B: Builds React expertise
chatgpt react: [interactive exploration]  
chatgpt train react react:,company-component-library.txt
chatgpt save react
# Tech Lead: Combines into team knowledge
chatgpt train team-standards common:,php:,react:,team-conventions.txt
chatgpt save team-standards
# Everyone loads team-standards for consistency
chatgpt load team-standards
The session.xfrm transformer provides session management capabilities within pipelines, allowing links to manipulate sessions without triggering AI calls.
# Format 1: Named session with command
link TARGET SOURCE session sessionname: command [filename]
# Format 2: Default session with command  
link TARGET SOURCE session command [filename]
# Format 3: Named session, train with input
link TARGET SOURCE session sessionname:
# Format 4: Passthrough (no command)
link TARGET SOURCE session
# Clear session before starting new pipeline
link 2 1 session project: clear
link 3 2 chatgpt openai session: project start fresh analysis
# Load curated knowledge base
link 2 1 session legal: load
link 3 2 chatgpt openai session: legal review contract
link 4 3 chatgpt openai session: legal identify risks
# Train with file contents
link 2 1 session docs: train
link 3 2 chatgpt openai session: docs summarize
# Train with specific files
link 2 1 session api: train swagger.json,examples.txt
link 3 2 chatgpt openai session: api generate client code
# Build up knowledge and save
link 2 1 chatgpt openai session: research analyze
link 3 2 chatgpt openai session: research synthesize findings
link 4 3 session research: save
The chatgpt.xfrm transformer supports sessions via the session: id syntax in arguments.
# Format:
link TARGET SOURCE chatgpt SERVICE session: ID prompt
# Examples:
link 2 1 chatgpt openai session: calc calculate mean
link 3 2 chatgpt openai session: calc what was standard deviation?
link 4 1 chatgpt claude session: review analyze code
link 5 4 chatgpt claude session: review suggest improvements
# Multiple links share same session
link 2 1 chatgpt openai session: analysis examine data
link 3 1 chatgpt openai session: analysis find correlations
link 4 2,3 chatgpt openai session: analysis synthesize findings
# Session maintains context across all three links
newfile 6
files
file 1
filename code.js
file 2
filename analysis.txt
file 3
filename security.txt
file 4
filename performance.txt
file 5
filename final-report.md
file 6
filename session-backup.json
# Load pre-trained code review session
link 2 1 session review: load
link 2 1 chatgpt openai session: review analyze structure
# Build context across reviews
link 3 2 chatgpt openai session: review check security
link 4 3 chatgpt openai session: review optimize performance
# Generate comprehensive report
link 5 2,3,4 chatgpt openai session: review final report
# Save the enriched session
link 6 5 session review: save
project save progressive-review
newfile 5
files
file 1
filename research-query.txt
file 2
filename context-data.txt
file 3
filename analysis.txt
file 4
filename recommendations.txt
file 5
filename knowledge-base.json
# Train session with domain knowledge
link 3 1,2 session research: train
link 3 1,2 chatgpt openai session: research analyze
# Use accumulated knowledge
link 4 3 chatgpt openai session: research recommend
# Persist learned knowledge
link 5 4 session research: save
project save research-pipeline
newfile 8
files
file 1
filename brief.txt
file 2
filename outline.txt
file 3
filename draft.txt
file 4
filename edited.txt
file 5
filename final.txt
file 6
filename session-state.json
file 7
filename backup.txt
file 8
filename metadata.txt
# Build document with maintained context
link 2 1 chatgpt openai session: doc create outline
link 3 2 chatgpt openai session: doc expand to draft
link 4 3 chatgpt openai session: doc improve clarity
link 5 4 chatgpt openai session: doc final polish
# Preserve session and original
link 6 5 session doc: save
link 7 1 passthrough
link 8 5 filestats
project save document-processor
newfile 6
files
file 1
filename submission.txt
file 2
filename quality-score.txt
file 3
filename gate.txt
file 4
filename approved.txt
file 5
filename final.txt
file 6
filename quality-session.json
# Quality check with remembered standards
link 2 1 session quality: load
link 2 1 chatgpt openai session: quality rate 1-10
# Gate based on score
link 3 2 chatgpt openai if score >= 8 output PASS else FAIL
link 4 3 blocker
# Process if approved
link 5 4 chatgpt openai session: quality finalize
# Update quality standards
link 6 5 session quality: save
project save quality-gate
# ✅ GOOD: Descriptive, purpose-clear
chatgpt legal-review: analyze contract
chatgpt backend-api: review endpoints
chatgpt data-analysis: examine trends
# ❌ AVOID: Generic, confusing
chatgpt x: do something
chatgpt temp: analyze
chatgpt test: help
# ✅ GOOD: Separate sessions per service
analysis: openai analyze data
docs: claude write documentation
translate: gemini convert to Japanese
# ❌ AVOID: Mixing services in one session
# (context styles don't mix well)
default: openai analyze
default: claude document
# Monitor session sizes
chatgpt sessions
# Clear old sessions periodically
chatgpt clear old-project
# Save important sessions before clearing
chatgpt save important-research
chatgpt clear important-research
# ✅ GOOD: Build incrementally
chatgpt train base core-concepts.txt
chatgpt train advanced base:,advanced-topics.txt
chatgpt train complete advanced:,examples.txt
# ❌ AVOID: Loading everything at once
# (harder to manage, harder to update)
chatgpt train mega everything.txt,all-docs.txt,more.txt
# Create session templates for common tasks
chatgpt code-review: you are an expert code reviewer
chatgpt code-review: focus on security, performance, readability  
chatgpt code-review: provide specific line-by-line feedback
chatgpt save code-review-template
# Load template for consistent reviews
chatgpt load code-review-template
code-review: [paste code]
# Share session files via version control
chatgpt save team-standards
# Commit: chatgpt-session-team-standards.json
# Team members load shared knowledge
chatgpt load team-standards
# Update and re-share
chatgpt train team-standards team-standards:,new-guidelines.txt
chatgpt save team-standards
# On phone (morning)
chatgpt design: plan the user interface
chatgpt save design
# On PC (afternoon)
chatgpt load design
design: now implement the dashboard
# On Xbox (evening)
chatgpt load design  
design: refine the color scheme
# Build knowledge through conversation
chatgpt research: what is quantum entanglement?
chatgpt research: explain bell's theorem
chatgpt research: how does this relate to quantum computing?
chatgpt research: summarize key insights
# Augment with documents
chatgpt train research research:,quantum-papers.txt
# Save comprehensive knowledge
chatgpt save research
# Use in analysis
chatgpt load research
research: analyze this quantum algorithm
# Same content, different sessions/services
link 2 1 chatgpt openai session: tech analyze technical feasibility
link 3 1 chatgpt claude session: legal identify legal risks
link 4 1 chatgpt gemini session: market assess market potential
link 5 2,3,4 chatgpt openai session: synthesis create comprehensive report
# Each session maintains focused context
# Start with baseline
chatgpt train project baseline-docs.txt
# Process and learn
link 2 1 chatgpt openai session: project analyze
link 3 2 session project: train           # Add analysis to session
link 4 3 chatgpt openai session: project expand insights
link 5 4 session project: train           # Add expanded insights
link 6 5 session project: save            # Persist learned knowledge
# Next run loads richer session
# Multiple quality checks with shared context
newfile 7
files
file 1
filename code.js
file 2
filename syntax-check.txt
file 3
filename security-check.txt  
file 4
filename performance-check.txt
file 5
filename combined-report.txt
file 6
filename gate.txt
file 7
filename approved.txt
link 2 1 session qa: load
link 2 1 chatgpt openai session: qa check syntax
link 3 1 chatgpt openai session: qa check security
link 4 1 chatgpt openai session: qa check performance
link 5 2,3,4 chatgpt openai session: qa overall assessment
link 6 5 chatgpt openai if all pass output APPROVED else REJECTED
link 7 6 blocker
# Session accumulates all QA context
link 7 6 session qa: save
project save qa-chain
# Check available sessions
chatgpt sessions
# Verify filename when loading
# Note: 'chatgpt-session-' prefix is automatic
chatgpt save myproject
# Creates: chatgpt-session-myproject.json
chatgpt load myproject    # ✅ Correct
chatgpt load chatgpt-session-myproject.json    # ❌ Wrong
# Clear session and start fresh
chatgpt clear sessionname
# Or create new session
newsession: start with clean context
# Use separate sessions for different topics
coding: technical discussion
story: creative writing
# Check session sizes
chatgpt sessions
# Clear old unused sessions
chatgpt clear old-session-1
chatgpt clear old-session-2
# Prune long sessions before saving
# (manually review and save only important parts)
# Ensure you save before closing browser
chatgpt save important-work
# Sessions in memory are lost on browser close
# Always save critical sessions to files
# Backup configuration includes sessions
csconfig → BL → Backup configuration to Local Download
{
  "session": [
    "First conversation entry",
    "Second conversation entry",
    "Third conversation entry"
  ],
  "size": 12345
}
{
  "sessions": {
    "default": ["entry1", "entry2"],
    "coding": ["entry1", "entry2"],
    "story": ["entry1", "entry2"]
  },
  "totalSize": 67890
}
Sessions work seamlessly with all transformers:
# Translate with context
link 2 1 chatgpt openai session: translate Japanese
link 3 1 chatgpt openai session: translate remember to maintain technical terms
# OCR with knowledge base
link 2 1 ocr
link 3 2 session medical: load
link 4 3 chatgpt openai session: medical interpret medical terminology
# Multi-input with shared session
link 4 1,2,3 chatgpt openai session: merge combine these perspectives
# Session sees all three inputs
# Session-aware gates
link 2 1 session standards: load
link 3 2 chatgpt openai session: standards meets requirements?
link 4 3 blocker
Sessions are a powerful feature enabling:
✅ Context Persistence - AI remembers previous interactions
✅ Knowledge Bases - Pre-train with domain expertise
✅ Reusable Workflows - Save and share curated sessions
✅ Multi-Turn Reasoning - Build complex arguments progressively
✅ Team Collaboration - Share knowledge via session files
✅ Cross-Device Continuity - Work seamlessly across devices
Key Takeaway: Sessions transform one-shot AI queries into stateful, context-aware workflows that learn and improve over time.
---
Remember: