sqlite-db-truncate

Recover data from corrupted or truncated SQLite database files via binary parsing.

134|21|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/letta-ai/skills --skill sqlite-db-truncate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlite-db-truncate
Source: https://github.com/letta-ai/skills/tree/main/ai/benchmarks/letta/terminal-bench-2/trajectory-only/sqlite-db-truncate
Command: npx skills add https://github.com/letta-ai/skills --skill sqlite-db-truncate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a structured approach to recovering data from corrupted or truncated SQLite databases via binary analysis, when standard tools fail.

Core Features & Use Cases

  • Phase 1: assessment: Inspect file size, headers, and page structure.
  • Phase 2: recovery method: Choose between standard recovery or manual binary parsing.
  • Phase 3: structured parsing: Implement a robust leaf-page parsing strategy and verify payload decoding.

Quick Start

Example: run the sqlite_recovery.py script on a damaged database to print diagnostic information.

Frequently Asked Questions about sqlite-db-truncate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover data from a corrupted SQLite database file?

Corrupted SQLite database recovery involves binary-level analysis when standard tools fail. This Skill inspects file headers, analyzes page structures, and manually parses table leaf pages to extract data from truncated or damaged files by decoding SQLite's binary format directly.

When should I use binary parsing instead of standard SQLite recovery tools?

Use binary parsing for SQLite recovery when the database file appears truncated, lacks a valid header, contains partial or corrupted pages, and standard sqlite3 tools cannot access the data. This approach reconstructs records by inspecting raw bytes and decoding cell structures manually.

What file characteristics indicate a SQLite database is corrupted or truncated?

Signs of SQLite corruption include missing or invalid magic headers, incomplete page structures, mismatched file size relative to page count, and inaccessible tables via standard queries. Binary inspection reveals truncation points and structural damage that prevent normal database access.

How does SQLite binary forensics extract data from damaged database pages?

SQLite binary forensics analyzes hex dumps to locate table leaf pages, decode varints for cell offsets, and parse individual records from page payloads. This recovery method reconstructs row data by interpreting SQLite's internal storage format when file corruption has made the database unreadable.

Can I recover partially deleted or overwritten records from a SQLite file?

Binary-level recovery from SQLite files can identify residual data and fragmented records through page analysis and cell inspection. Recovery success depends on whether overwritten sectors remain accessible; this Skill assesses file characteristics to determine what data can be reconstructed from available bytes.

What's the difference between database corruption recovery and standard backup restoration?

Standard backups restore intact copies, while corruption recovery reconstructs data from damaged files using binary analysis. Recovery becomes necessary when backups are unavailable and the live database has structural damage, truncation, or header corruption that prevents normal access.