Sessions
Managing conversation sessions and history
Ripperdoc maintains session history to enable context-aware conversations and session resumption.
Session Storage
Sessions are stored in ~/.ripperdoc/sessions/ as JSON files containing:
- Full conversation transcript
- Tool execution history
- Token usage and costs
- Session metadata
Resuming Sessions
Continue Most Recent Session
Continue the most recent session in the current directory:
ripperdoc --continue
# or
ripperdoc -cThis automatically resumes the last session without prompting.
Interactive Session Selection
Use the /resume command during an interactive session to select from recent sessions:
> /resumeThis opens an interactive picker to browse and select from your session history.
Session Commands
View Status
> /statusShows current session information including:
- Message count
- Token usage
- Duration
- Tool calls
View Statistics
> /statsShows detailed session statistics:
- Input/output tokens
- Cache read/write tokens (if supported)
- Cost breakdown
- Tool usage breakdown
View Costs
> /costShows token usage and estimated costs. Includes cache read/write tokens when available (e.g., Anthropic cache).
Context Management
Clearing History
Clear the current conversation:
> /clearThis starts a fresh conversation while keeping the session.
Compacting History
When the context window fills up, Ripperdoc automatically compacts the conversation by summarizing older messages.
Manually trigger compaction:
> /compactYou can also provide custom instructions:
> /compact Focus on the API implementation detailsSession Configuration
Configure session behavior via environment variables:
| Variable | Description | Default |
|---|---|---|
RIPPERDOC_AUTO_COMPACT | Enable auto-compaction | true |
RIPPERDOC_CONTEXT_TOKENS | Context window size limit | Model default |
Or in ~/.ripperdoc.json:
{
"auto_compact_enabled": true,
"context_token_limit": 100000
}Context Length Handling
When the context window is exceeded:
- Ripperdoc detects the context length error
- Automatically compacts older messages
- Retries the request with the compacted context
- Notifies you if compaction was performed
Exporting Sessions
Session files are stored as JSON and can be:
- Backed up manually
- Analyzed for usage patterns
- Shared for debugging
Session file location: ~/.ripperdoc/sessions/<project-hash>/<session-id>.json
Best Practices
- Use
/clearfor new tasks: Start fresh when switching to unrelated work - Monitor
/costfor long sessions: Keep track of token usage - Resume when interrupted: Use
-cor--continueto continue interrupted work - Compact proactively: Use
/compactif responses slow down - Use
/resumeto browse history: Find specific past sessions interactively