sl_capture

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

A guide for saving reusable business-data patterns—such as metrics, data segments, calculated fields, and joins—in a shared catalogue called a semantic layer.

In plain words
What is it for?
Use it to decide when a metric, segment, calculated dimension, or join should be added to the catalogue and to write the corresponding warehouse-specific SQL.
Why use it?
It prevents teams from recreating the same data logic for every query and helps keep saved expressions small, reusable, and compatible with the warehouse they run on.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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,576 stars · on GitHub · docs.kaelio.com

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/sl_capture
Any agent
npx skills add Kaelio/ktx --skill sl_capture
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 sl_capture

README.md
[![agentmods](https://agentmods.dev/badge/skills/kaelio/ktx/sl_capture.svg)](https://agentmods.dev/skills/kaelio/ktx/sl_capture)
Your own site
<a href="https://agentmods.dev/skills/kaelio/ktx/sl_capture"><img src="https://agentmods.dev/badge/skills/kaelio/ktx/sl_capture.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,479 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.1 $0.00063 $0.04479
Opus 5 $0.00032 $0.02240
Sonnet 5 $0.00013 $0.00896
Haiku 4.5 $0.00006 $0.00448

Measured 6d ago against content hash ab5ee7354579, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

sl_capture 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 6d 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/sl_capture/SKILL.md · 347 lines

How it starts

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

Semantic Layer - Capture

This skill covers when and how to capture new patterns into the semantic layer. For schema reference and query grammar, load the sl skill first.

When the current turn produces a reusable pattern (business metric, derived view, join pattern, computed dimension), capture it so future queries can reach for it instead of rediscovering it.

SQL dialect

The user-facing prompt includes a Warehouse: line under the SL Sources index (e.g. Warehouse: BIGQUERY). All expr strings - measure expressions, segment predicates, computed-column SQL - execute on that warehouse and must use its syntax. Date arithmetic in particular varies by dialect:

  • BigQuery: transaction_date >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 90 DAY) (when the column is TIMESTAMP); event_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY) (when DATE).
  • Postgres / Redshift: transaction_date >= current_date - interval '90 days'.
  • Snowflake: transaction_date >= dateadd(day, -90, current_timestamp()).

Match the column's manifest type (type: time → TIMESTAMP/DATETIME on the warehouse) - comparing TIMESTAMP to a DATE-arithmetic result fails on BigQuery. After every sl_edit_source/sl_write_source, the inline validator runs a LIMIT 1 warehouse probe per measure and surfaces dialect mismatches; if you see an error trailer, fix the expression and retry rather than leaving the source for the post-squash gate to revert.

What's worth capturing

  • Business metric aggregations (ARR, MRR, revenue, churn, retention, conversion, LTV, CAC).
  • Derived calculations combining multiple signals (risk scores, health scores, composite KPIs).
  • Multi-table join patterns producing a reusable analytical view.
  • Computed categories or flags useful as reusable dimensions (case when num_protocols >= 3 then 'power' else 'regular' end).
  • Missing joins between two sources that both exist but aren't connected in the join graph.

Skip:

  • Simple SELECT * LIMIT 10 previews.
  • Trivial COUNT(*) on one table with no business filtering.
  • One-off ad-hoc explorations unlikely to repeat.
  • Equivalent measures that already exist (cite the existing one as source.measure_name).

Read the full file on GitHub · 347 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. 6d ago First seen · 347 lines · 63 tokens per session scan A ab5ee7354579

Subscribe to this mod's changes

sl_capture is a skill published in the GitHub repository Kaelio/ktx (1,576 stars, last pushed 2d ago), licensed Apache-2.0. It adds 63 tokens to every session and 4,479 once invoked, about $0.0003 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

hindsight-local

Store user preferences, learnings from tasks, and procedure outcomes. Use to remember what works and recall context before new tasks. (user).

vectorize-io/hindsight · 32 tokens

agentmemory-agents

How agentmemory wires into host coding agents via the connect command. Use when installing agentmemory into a specific agent, when asked which agents are supported, or when a connect adapter writes the wrong config path.

rohitg00/agentmemory · 46 tokens

last30Days

Resolve "last30Days" to a concrete ISO date range relative to your run time — a rolling 30-day window ending today. Returns inclusive civil dates plus exact UTC instants so you have temporal context without computing dates by hand. Read-only: no writes, no network. Use before a "last 30 days" / trailing-month task…

chaitanyagiri/munder-difflin · 83 tokens

thisWeek

Resolve "thisWeek" to a concrete ISO date range relative to your run time — this week so far (Monday → today). Returns inclusive civil dates plus exact UTC instants so you have temporal context without computing dates by hand. Read-only: no writes, no network. Use before a week-to-date task (this week's activity…

chaitanyagiri/munder-difflin · 77 tokens

md-fetch-summarize

Fetch a URL and return a concise markdown summary of its content. Read-only: no files are written; the summary is returned as output only. Use when asked to "fetch and summarize", "summarize this URL", "what does this page say", or "get the content of ". Proactively suggest when the user pastes a URL and asks what it…

chaitanyagiri/munder-difflin · 93 tokens

session-summaries

What the chat right-panel session summary shows, what it costs, and how to make a session summarize well. Load when the user asks about the session summary panel, why a summary looks wrong or empty, or how to turn it on.

kirodotdev/KiroCrew · 53 tokens