area:clieffort-mediumenhancementhelp wantedpriority:medium
Métriques du dépôt
- Stars
- (48 085 stars)
- Métriques de merge PR
- (Merge moyen 11j 1h) (45 PRs mergées en 30 j)
Description
Real-world numbers from rtk discover --all --since 30:
| Command | Calls (30d) | Notes |
|---|---|---|
sqlite3 |
470 | top entry under "unhandled" commands |
Use cases driving the call volume: querying local SQLite stores with frequent SELECT, .schema, .tables calls — patterns where an LLM iteratively explores or polls a small database.
Two main sources of per-call bloat:
- Default row dumps from
SELECT: with wide TEXT columns, even a few dozen rows expand to several KB of context per call. Most of it is repeated padding/whitespace or long unreadable bodies. .schemaoutput: fullCREATE TABLEwith all constraints, triggers, and index DDL — far more than an LLM typically needs, which is column names and types.
Suggested wrapper behavior:
- For
SELECTqueries:- Apply a default row limit (e.g. 50) with a one-line truncation marker
- Truncate long text cells to ~200 chars with a length marker (
…(N chars)) - Strip trailing whitespace/padding
- For
.schema/.tables:- One line per table:
table_name(col1 type, col2 type, ...)with PK/FK markers, no constraint bodies - Index list summarised separately
- One line per table:
- For
.dumpand similar export commands: pass through unchanged (intent is the full payload) - Pass through unchanged when output is already short (e.g. < 5 lines)
Methodology: counts come from rtk discover --all --since 30 against the local Claude Code transcript directory. Token estimates use the 4-chars/token approximation.