Time-travel debugger with full state resume
Record complete DevDuck sessions with full conversation state. Resume from any snapshot with your entire context restoredβlike hitting pause and play on your AI agent.
Session recording captures events at three distinct layers, giving you complete observability into agent behavior.
# Start with recording enabled
devduck --record
# Record a one-shot query
devduck --record "create a web scraper"
# Resume from a recorded session
devduck --resume ~/Desktop/session-20260202-231359.zip
# Resume from specific snapshot
devduck --resume session.zip --snapshot 2
# Resume and continue with new query
devduck --resume session.zip --snapshot 2 "continue from here"
# In DevDuck REPL:
record # Start recording
# ... do your work ...
record # Stop and export ZIP
# Start recording
session_recorder(action="start")
# Create state snapshot with description
session_recorder(action="snapshot", description="after API setup")
# Check recording status
session_recorder(action="status")
# Export without stopping
session_recorder(action="export", output_path="~/Desktop/checkpoint.zip")
# Stop recording and export
session_recorder(action="stop")
The killer feature: snapshots capture your complete conversation state, allowing you to resume exactly where you left off.
Unlike simple event logs, DevDuck snapshots store the actual agent.messages array, system prompt, and query contextβenabling true session continuation.
from devduck import load_session, resume_session, list_sessions
# List all recorded sessions
sessions = list_sessions()
for s in sessions:
print(f"{s['name']} - {s['size_kb']:.1f}KB - {s['modified']}")
# Quick resume from latest snapshot
result = resume_session("~/Desktop/session.zip")
print(f"Restored {result['messages_restored']} messages")
# Load session for inspection
session = load_session("session.zip")
print(session) # LoadedSession(id=..., events=14, snapshots=3)
# Explore session data
print(session.metadata)
print(f"Duration: {session.duration}s")
print(f"Resumable: {session.has_pkl}")
# Get events by layer
sys_events = session.get_events_by_layer("sys")
tool_events = session.get_events_by_layer("tool")
agent_events = session.get_events_by_layer("agent")
# Resume from specific snapshot with agent
result = session.resume_from_snapshot(2, agent=devduck.agent)
print(f"Messages restored: {result['messages_restored']}")
print(f"Working directory: {result['cwd']}")
# Resume AND continue with new query
result = session.resume_and_continue(
snapshot_id=2,
new_query="continue from where we left off",
agent=devduck.agent
)
print(result['agent_result'])
Each snapshot is a complete checkpoint of agent state at that moment in time.
| Action | Description | Parameters |
|---|---|---|
start |
Begin a new recording session | session_id (optional) |
stop |
Stop recording and export to ZIP | output_path (optional) |
snapshot |
Create state checkpoint with full context | description (optional) |
status |
Show recording status and stats | β |
export |
Export current session without stopping | output_path (optional) |
list |
List all saved recordings | β |
Sessions are exported as ZIP archives containing structured data for analysis, replay, and resume.
{
"timestamp_ns": 1738539876420000000,
"layer": "tool",
"event_type": "tool.call",
"data": {
"name": "shell",
"args": {"command": "ls -la"}
},
"trace_id": null
}
{
"timestamp": 1738539876.42,
"snapshot_id": 2,
"agent_messages_count": 12,
"agent_messages": [
{"role": "user", "content": "..."},
{"role": "assistant", "content": "..."}
],
"system_prompt": "π¦ You are DevDuck...",
"last_query": "read the file and update it",
"last_result": "Done! I've updated...",
"model_info": {
"type": "BedrockModel",
"model_id": "claude-opus-4-5",
"provider": "bedrock"
},
"tools_loaded": ["shell", "editor", "file_read"],
"cwd": "/Users/cagatay/project"
}
Full agent.messages captured in snapshots. Resume with complete context.
10K event capacity with O(1) writes. Minimal performance overhead.
API keys, tokens, and secrets automatically masked in exports.
File I/O and network calls instrumented when recording is active.
Working directory automatically restored on snapshot resume.
Recent events automatically added to agent context during recording.
devduck --record or type record in REPL
All tool calls, messages, and file operations captured automatically
Before/after each agent query with full conversation state
Type record again or use session_recorder(action="stop")
Open Session Player and drop the ZIP file
devduck --resume session.zip --snapshot 2
# Default recording directory
/tmp/devduck/recordings/
βββ session-20260202-224751.zip
βββ session-20260202-231359.zip
βββ ...
# List recordings via tool
session_recorder(action="list")
# Export to custom location
session_recorder(action="stop", output_path="~/Desktop/my-session.zip")
# Python API
from devduck import list_sessions
for s in list_sessions():
print(f"{s['name']} - {s['modified']}")
Step through exactly what the agent did when something went wrong.
Stop working mid-task and resume later with full context restored.
Study tool usage patterns, timing, and optimize workflows.
Resume from an earlier snapshot to try a different approach.
Create reproducible examples of complex agent interactions.
Capture sessions for regression testing and comparison.