Telemetry
Analyze Reygent runs to optimize performance and reduce costs. All analysis runs on local telemetry database. No data leaves your machine.
New: Looking for visual exploration? Try the Dashboard for interactive views of run history, trends, and agent failures.
Commands
reygent last- Show latest run details (quick summary, verbose log, output, errors, or JSON)reygent analyze failures- Common error patternsreygent analyze success- What works wellreygent analyze costs- Cost breakdown and savingsreygent analyze agents- Agent performance comparison
Command Details
Duration Format: All commands use --since with format Nd where N is number of days. Examples: 7d (7 days), 30d (30 days), 90d (90 days).
Latest Run Details:
reygent last [--verbose] [--output] [--errors] [--json]Quick access to most recent run:
- Default: Summary with status, duration, agents, cost, and top errors
--verbose: Full event log with timestamps and details--output: Only final output from the run--errors: Only errors with stack traces--json: Machine-readable JSON for scripting
Failures Analysis:
reygent analyze failures [--agent <name>] [--since 30d] [--limit N]Shows top failure patterns with occurrence counts, agent breakdown, and actionable recommendations.
Success Analysis:
reygent analyze success [--stage <name>] [--since 30d] [--min-success-rate <pct>]Extracts patterns from successful runs: agent performance, model distribution, optimal configurations.
Cost Analysis:
reygent analyze costs [--since 30d] [--by-agent] [--show-runs]Cost breakdown by stage/agent with optimization opportunities and potential savings.
Agent Analysis:
reygent analyze agents [--agent <name>] [--since 30d] [--compare-models]Per-agent performance: success rates, duration, costs, error types, model distribution.
Privacy & Control
What data is collected:
- Run timestamps and duration
- Agent names and execution stages
- Error messages (sanitized - see below)
- API costs (tokens, provider, model)
- Success/failure status
- File paths modified (relative to project root)
- Knowledge consultation events
What is NOT collected:
- File contents or code
- Environment variables or secrets
- Command arguments with sensitive data
- Network requests or API keys
Security measures:
Error sanitization: All error messages automatically sanitized before storage to remove:
- API keys and tokens (20+ character strings)
- User home paths (
/Users/name,/home/name,C:\Users\name) - Email addresses
- IP addresses
- Environment variable values (
password=secret→password=[REDACTED])
Cross-project isolation: By default, telemetry writes to BOTH:
- Local:
.reygent/chesstrace.db(project-specific) - Global:
~/.reygent/chesstrace.db(aggregate across all projects)
Warning: Global DB contains data from all projects. If you work on private and public repos, consider disabling global telemetry to prevent cross-project data leakage.
DB size limits:
- Max DB size: 50MB (auto-prunes old events if exceeded)
- Max events per run: 10,000 (prevents spam attacks)
- Auto-retention: 180 days (older events pruned automatically)
Disable telemetry:
# Set environment variable to skip all telemetry
export REYGENT_TELEMETRY=false
# Or in .reygent/config.json
{
"telemetry": {
"enabled": false
}
}Export data:
# Export telemetry as JSON
reygent telemetry export --since 30d --output data.json
# Export knowledge as markdown bundle
reygent knowledge export --output knowledge-backup.tar.gzAdvanced Configuration
.reygent/config.json telemetry options:
{
"telemetry": {
"enabled": true,
"global_enabled": true, // Write to global DB (set false for security)
"retention_days": 180, // Event retention (default 180)
"error_retention_days": 90, // Error log retention (default 90)
"auto_prune": true, // Auto-prune on analyze commands
"debug": false, // Enable verbose logging
"max_db_size_mb": 50, // Max DB size before pruning (default 50)
"max_events_per_run": 10000 // Max events per run (prevents spam)
}
}Environment variables:
# Disable all telemetry
export REYGENT_TELEMETRY=false
# Disable global telemetry only (security - prevent cross-project data)
export REYGENT_GLOBAL_TELEMETRY=false
# Debug mode
export REYGENT_DEBUG=telemetry # Telemetry events
# Custom DB location
export REYGENT_TELEMETRY_DB=/custom/path/chesstrace.dbTelemetry Internals
Reygent's telemetry system is called Chesstrace. For full architecture details, see the Chesstrace Guide.
Database schema (chesstrace.db):
Single SQLite table with WAL mode enabled:
CREATE TABLE events (
id TEXT PRIMARY KEY,
run_id TEXT NOT NULL,
timestamp INTEGER NOT NULL,
category TEXT NOT NULL,
event TEXT NOT NULL,
min_level INTEGER NOT NULL,
data TEXT NOT NULL -- JSON serialized
)Indexes: run_id, timestamp, category, event.
Event categories: command, agent, llm, git, spec, error, performance, pipeline, usage, gate, tool, knowledge
Key events by level:
Minimal (always captured):
command.start,command.end,command.errorerror.unhandled,error.validation,error.task,error.parse,error.providertool.summary,knowledge.prevented_failure
Standard (default level):
agent.spawn,agent.complete,agent.timeoutpipeline.start,pipeline.end,pipeline.stage_start,pipeline.stage_endgate.result,gate.retrygit.branch_create,git.commit,git.pushspec.fetch,spec.parsetool.invoke,knowledge.consulted,knowledge.success
Verbose (diagnostic):
llm.request,llm.response,llm.token_usageperformance.metric,performance.durationusage.tokens,usage.costtool.invoke.full
Retention:
- Default: 30 days (configurable via
telemetry.retentionin config) - Auto-pruned on init
- DB hard prune at 180 days when size limit approached
Performance:
- DB typically <10MB per project after 6 months
- Indexes on
run_id,timestamp,category,event - WAL mode for concurrent reads/writes
Backup:
# Backup telemetry DB
cp .reygent/chesstrace.db .reygent/chesstrace.db.backup
# Restore from backup
mv .reygent/chesstrace.db.backup .reygent/chesstrace.dbTroubleshooting
DB corruption:
# Check DB integrity
sqlite3 .reygent/chesstrace.db "PRAGMA integrity_check;"
# If corrupted, restore from backup
mv .reygent/chesstrace.db .reygent/chesstrace.db.corrupted
cp .reygent/chesstrace.db.backup .reygent/chesstrace.db
# If no backup, rebuild from scratch
rm .reygent/chesstrace.db
# Next run will create fresh DBTelemetry not recording:
# Check telemetry enabled
echo $REYGENT_TELEMETRY # Should be empty or "true"
# Check DB permissions
ls -la .reygent/chesstrace.db # Should be writable
# Enable debug logging
REYGENT_DEBUG=telemetry reygent run ...Analyze commands fail:
# Check DB exists
ls -la .reygent/chesstrace.db
# Check DB has data
sqlite3 .reygent/chesstrace.db "SELECT COUNT(*) FROM events;"
# If empty, need at least one run first
reygent run "test task"Schema issues:
# If schema problems, safest path is backup + recreate
cp .reygent/chesstrace.db .reygent/chesstrace.db.backup
rm .reygent/chesstrace.db
# Next run creates fresh DB with current schema