historic_sql_table_digest

historic_sql_table_digest is a skill for Claude Code, Codex from Kaelio/ktx. It costs 25 tokens per session (917 once invoked), scanned A, original, Apache-2.0.

A tool for turning one changed table from a historic SQL data file into typed evidence about how that table is used. Historic SQL refers to records collected from older database activity.

In plain words
What is it for?
Processing one `schema.table` JSON file, describing its usage, and emitting historic-SQL table evidence.
Why use it?
It provides a defined process for reading the table data, checking identifiers, and producing a consistent evidence record.

Skill for Claude CodeCodex

About the project

Kaelio/ktx is a context layer that helps AI agents query analytical databases using company knowledge, approved metrics, table metadata, and relationships between columns. Data teams use it to make warehouse queries more accurate and consistent with their organization's definitions. Its catalogue add-ons teach agents how to use ktx and its data-querying interfaces.

Kaelio/ktx · 1,571 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/kaelio/ktx/historic_sql_table_digest
Any agent
npx skills add Kaelio/ktx --skill historic_sql_table_digest
Clone the repo
git clone --depth 1 https://github.com/Kaelio/ktx

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for historic_sql_table_digest

README.md
[![agentmods](https://agentmods.dev/badge/skills/kaelio/ktx/historic_sql_table_digest.svg)](https://agentmods.dev/skills/kaelio/ktx/historic_sql_table_digest)
Your own site
<a href="https://agentmods.dev/skills/kaelio/ktx/historic_sql_table_digest"><img src="https://agentmods.dev/badge/skills/kaelio/ktx/historic_sql_table_digest.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 917 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.00917
Opus 5 $0.00013 $0.00458
Sonnet 5 $0.00005 $0.00183
Haiku 4.5 $0.00003 $0.00092

Measured 4d ago against content hash c09aaa9de986, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

historic_sql_table_digest scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/cli/src/skills/historic_sql_table_digest/SKILL.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Historic SQL Table Digest

Use this skill when the WorkUnit raw file is one tables/<schema>.<name>.json file from the historic-sql adapter.

Required Workflow

  1. Read the WorkUnit notes first.
  2. Call read_raw_file for the single tables/<schema>.<name>.json raw file.
  3. Read manifest.json only if the table JSON omits the dialect or the WorkUnit notes are unclear.
  4. Produce one concise usage narrative for this table from the staged table JSON.
  5. Call emit_historic_sql_evidence exactly once with kind: "table_usage".
  6. Stop after the evidence tool succeeds.

Identifier Verification Protocol

Before writing a wiki page or SL source on any topic:

  1. discover_data({query: "<topic>"}) - see what wikis, SL sources, and raw tables already exist. Prefer updating existing pages over creating new ones.

Before emitting any schema.table or schema.table.column into a wiki body, SL source, tables: frontmatter, sl_refs, or emit_unmapped_fallback:

  1. entity_details({connectionId, targets: [{display: "<identifier>"}]}) - confirm the identifier resolves; inspect native types, FK/PK, and sampleValues.
  2. For literal values from the source, such as status codes or plan tiers, check whether they appear in entity_details sampleValues for the relevant column. If sampleValues is short or the sample may have missed real values, run a sql_execution probe with the same warehouse connection id: sql_execution({connectionId, sql: "SELECT DISTINCT <col> FROM <ref> LIMIT 50"}).
  3. If the candidate identifier still does not resolve, do one of:
    • Use sql_execution({connectionId, sql: "SELECT 1 FROM <ref> LIMIT 0"}). If it errors, the identifier is fictional.
    • Wrap the identifier in [unverified - from <rawPath>] in the wiki body, citing the exact raw path that mentioned it.
    • When recording emit_unmapped_fallback with no_physical_table, include the failing probe error in clarification.
  4. Never copy <schema>.<table> placeholder strings from these instructions into output.

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 89 lines · 25 tokens per session scan A c09aaa9de986

Subscribe to this mod's changes

historic_sql_table_digest is a skill published in the GitHub repository Kaelio/ktx (1,571 stars, last pushed yesterday), licensed Apache-2.0. It adds 25 tokens to every session and 917 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

retail-govern

Run the Seshat BI governance checker and interpret its findings. Use when someone asks to check, validate, or gate Power BI / DAX / TMDL / PBIR / SQL work in the Seshat BI repo, when seshat check reports a rule violation, or when you need to know what a rule id (D8, C2, S2, G1, …) means and where to fix it.…

Kemetra/Seshat-BI · 129 tokens

source-mapping

Drive a raw retail source table through the source-mapping gate before any silver SQL exists. Use when someone asks to map, model, profile, or onboard a new bronze table toward Power BI in the Seshat BI repo -- profile the source, decide grain/PK, fill the five mapping artifacts into mappings/ /, and stop at the gate.…

Kemetra/Seshat-BI · 122 tokens

pbip-xray

Audit a committed PBIP semantic model as text (unused fields, relationship risks, measure-graph findings) and explain a TMDL change in business terms for PR review. Read-only: it parses committed TMDL/PBIR and git history, opens no database, never launches Power BI, and edits nothing.

Kemetra/Seshat-BI · 69 tokens

capabilities

Show the read-only capability inventory for this kit -- each capability by lifecycle state, authority, requirements and provenance. Use when someone asks what the kit can do or what works without a database. Writes nothing and emits no score.

Kemetra/Seshat-BI · 48 tokens

cross-table-lineage

Trace column- and table-level lineage across bronze/silver/gold in the Seshat BI repo and report the downstream impact of a change. Read-only: it reads committed SQL and mappings, opens no database, and edits nothing.

Kemetra/Seshat-BI · 52 tokens

retail-build-warehouse

Author the silver + gold migration SQL for a mapped retail table from its APPROVED source-map, then STOP before executing. Use after a table's mapping gate is CLEARED in the Seshat BI repo and someone asks to build the silver/gold SQL, write the migration, or fill the retail-orchestrate build seam. Author-and-stop: it…

Kemetra/Seshat-BI · 113 tokens