Skip to main content
Sessions allow you to save complete debugging contexts and resume your work later. This is essential for complex investigations, team collaboration, and building a history of analyzed transactions.

Overview

A debugging session stores:
  • Complete transaction data (envelope, metadata)
  • Simulation results (events, logs, traces)
  • Analysis context (network, timestamps)
  • Session metadata (creation time, access history)
Sessions enable you to:
  • Resume debugging work after interruption
  • Share debugging context with team members
  • Build a searchable history of investigated transactions
  • Analyze patterns across multiple debugging sessions

Quick start

Session commands

Save current session

Save the active debugging session to disk:
You must run erst debug <tx-hash> first to create an active session.

Custom session ID

Specify a memorable ID instead of auto-generated:
Auto-generated IDs use the format:
Example: abc123-20260301143022

List all sessions

View all saved sessions, ordered by most recently accessed:
Example output:

Resume a session

Restore a previously saved session:
Flexible ID resolution: You can provide:
  • Full session ID: abc123-20260301143022
  • Partial ID prefix: abc123
  • Transaction hash: abc123def456...
  • Fuzzy match: Closest matching ID
Example output:
Resuming a session loads all transaction data and simulation results, allowing you to continue analysis without re-fetching from the network.

Delete a session

Remove a saved session permanently:
This action cannot be undone. The session data will be permanently deleted.

Session storage

Location

Sessions are stored in a local SQLite database:

Schema

Each session record contains:

Automatic cleanup

Sessions are automatically cleaned up based on: Time-to-live (TTL):
  • Default: 30 days
  • Sessions older than TTL are deleted
  • Configurable via environment variable
Maximum sessions:
  • Default: 100 sessions
  • Oldest sessions deleted when limit exceeded
  • Cleanup uses LRU (Least Recently Used) strategy

Common workflows

Save and share with team

Resume interrupted work

When you resume a session, Erst uses cached data instead of fetching from the network, making analysis instant.

Build investigation history

Clean up old sessions

Manually trigger cleanup:

Session compatibility

Schema versioning

Sessions include a schema version number. When you update Erst:
  • Compatible versions: Sessions load normally
  • Incompatible versions: You’ll see a warning and may need to re-debug the transaction

Forward compatibility

Newer Erst versions can read older sessions when possible. Breaking changes are documented in release notes.

Migration

If schema migration is needed, Erst provides migration commands:

Advanced usage

Query sessions directly

Access the SQLite database for custom queries:

Backup sessions

Back up your session database:

Export session for reporting

Extract session data for external analysis:

Troubleshooting

No active session

Solution: Run erst debug <tx-hash> first to create a session before saving.

Session not found

Solutions:
  • Check session ID with erst session list
  • Verify spelling of session ID
  • Session may have been cleaned up (check TTL)
  • Try providing full session ID instead of prefix

Database locked

Solutions:
  • Close other Erst processes accessing sessions
  • Wait a moment and try again
  • Check file permissions on ~/.erst/sessions.db

Schema version mismatch

Solutions:
  • Update Erst to the latest version
  • Re-debug the transaction with current Erst version
  • Check migration documentation in release notes

Implementation details

Source files

Session management is implemented in:
  • internal/cmd/session.go - CLI commands
  • internal/session/store.go - Database operations
  • internal/session/schema.go - Data structures

Functions

Key functions:
  • SetCurrentSession() - Stores active session from debug command
  • GetCurrentSession() - Retrieves current session if any
  • Store.Save() - Persists session to database
  • Store.Load() - Retrieves session by ID
  • Store.List() - Lists all sessions
  • Store.Delete() - Removes session
  • Store.Cleanup() - Runs LRU cleanup
Location: internal/cmd/session.go:24, internal/cmd/session.go:29

Best practices

Custom IDs make sessions easier to find:
Better than auto-generated: abc123-20260301143022
Save sessions when you discover something important:
This creates a reference point you can return to.
Delete sessions you no longer need:
Keeps the session list manageable.
Before updating Erst to a new major version:
Protects against schema compatibility issues.

Next steps

Debugging failed transactions

Learn how to create sessions during debugging

Cache management

Understand how caching complements sessions

Using flamegraphs

Save profiling data in sessions