Pipe long text in, get a short summary out.
No LLM calls. No API keys. No token costs.
tldt uses LexRank (TF-IDF cosine similarity + eigenvector centrality) and TextRank (word overlap + PageRank damping) to identify the most representative sentences in your document.
Output is exact quotes from the source — never paraphrased, never hallucinated. Built to reduce token costs when feeding long documents into AI coding assistants.
Use tldt as a Go library in your applications. Stateless, thread-safe, zero global mutable state. See library api docs for complete reference.
Three complete, self-contained examples demonstrating production usage patterns. Each includes go.mod for independent use and a Makefile for building.
The tldt binary contains embedded skill templates for Claude Code and other AI assistants. Install once, use anywhere — the skill and hook travel with the binary.
Claude Code skill for manual invocations. Type /tldt followed by long text.
The skill file is embedded in the binary at compile time and extracted during --install-skill.
UserPromptSubmit hook that fires automatically when pasted text exceeds the token threshold.
Configurable threshold via ~/.tldt.toml [hook] threshold = 2000.
Installs to all assistants with existing directories. Safe to run repeatedly — won't create new directories.
Only installs where directories already exist. No directories created.
Specify an assistant — directory is auto-created if needed. Perfect for first-time setup.
Creates directory if missing. Same behavior for all assistants.
Important: Only Claude Code supports auto-trigger hooks (UserPromptSubmit).
Other assistants receive SKILL.md only —
use /tldt for manual summarization.
The installer detects and installs to multiple AI assistant directories. Only Claude Code supports the auto-trigger hook; other assistants receive the skill file only.
When processing untrusted text before it enters an AI context, tldt detects injection patterns, encoding anomalies, statistical outliers, and cross-script homoglyph substitution — all reported to stderr only, never blocking your pipeline.
tldt mitigates four OWASP LLM Top 10 2025 categories and is architecturally immune to three more. No configuration required for the Claude Code hook — protection is on by default.
| Category | Status | Mechanism |
|---|---|---|
| LLM01 Prompt Injection | mitigated | --detect-injection + --sanitize |
| LLM02 Sensitive Info | Phase 9 | --detect-pii + --sanitize-pii |
| LLM05 Output Handling | mitigated | Hook output guard |
| LLM10 SSRF | mitigated | Private IP block + redirect cap |
| LLM04 / LLM08 / LLM09 | immune | No ML weights, no vector store, extractive only |
--verbose.