atif-sql reads Claude Code session transcripts and Codex CLI rollouts, converts each session to ATIF (Harbor’s Agent Trajectory Interchange Format), materializes the results as a corpus of ATIF documents on disk, and layers DuckDB views and macros over that corpus. Converting once at the boundary, with an explicit and tested fidelity policy for what the upstream adapter drops, replaces re-deriving trajectory semantics inside every SQL view.
Pick the agent with --agent claude-code|codex on convert, materialize, status and query.
One corpus holds one agent, the two default to separate roots, and sessions.agent names which one a
row came from.
It is a uv Python workspace, Apache-2.0, and it replaces claude-sql.
The packages
Section titled “The packages”| Package | What it owns |
|---|---|
atif-converter |
The Claude Code and Codex converters, ported from Harbor’s adapters onto its vendored ATIF models, and the per-agent fidelity policy that accounts for every known upstream conversion gap per session |
atif-corpus |
Corpus materialization: source discovery, watermarks, quiescence, atomic artifact writes |
atif-duck |
The DuckDB views and macros over the materialized corpus, declared in a drift-tested static catalog |
atif-models |
The model alias registry and the structured-output LLM clients for GPT-6 and Claude 5.5. No other package names a Bedrock LLM id (the embedding model ids are atif-embed settings) |
atif-analytics |
The LLM pipelines: classify, conflicts, friction, perceived |
atif-embed |
Cohere Embed v4 on Bedrock or EmbeddingGemma 2 on this machine, a Lance vector store written through DuckDB’s lance extension, and the embedding backfill |
atif-cli |
The cyclopts CLI that composes the rest |
Five of the packages carry an import-linter layers contract, and the independence contract is
enforced the same way rather than by convention: converter, corpus, duck, models and embed may never
import one another, atif-analytics imports only atif-models, and atif-cli is the only
composition root.
The discovery loop
Section titled “The discovery loop”atif-sql schema # every view with its columns, and every macro signature, from the static catalogatif-sql examples # runnable example queries, derived from that catalog and executed by the testsatif-sql query 'SELECT * FROM tool_rank(30) LIMIT 10'atif-sql examples derives its output from the catalog rather than carrying hardcoded strings, and
every example is executed against a fixture corpus by atif-duck’s own test suite, so the listing
cannot drift from the schema it documents.
For an agent. Start at For agents, which names which surface to fetch for which
question and what not to assume about this repository. Prefer atif-sql schema and
atif-sql examples to anything on this site: both are generated from the catalog, so they are right
and a page can be stale.