Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
},
"metadata": {
"description": "Altimate's Claude Code plugin — delegates dbt and warehouse work to the altimate-code CLI agent.",
"version": "1.0.0"
"version": "1.1.0"
},
"plugins": [
{
"name": "altimate-code",
"description": "Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools (SQL analysis, column-level lineage, dbt build/test/run, warehouse profiling, FinOps, connectivity to Snowflake, BigQuery, Redshift, Databricks, Postgres, MySQL, DuckDB).",
"description": "Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools (SQL analysis, column-level lineage, dbt build/test/run, warehouse profiling, FinOps, connectivity to Snowflake, BigQuery, Redshift, Databricks, Postgres, MySQL, DuckDB), and to the skills, knowledge and memory of a linked Altimate workspace.",
"source": "./plugins/altimate-code",
"strict": false
}
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ altimate-claude-plugin/
│ ├── hooks-handlers/
│ │ └── session-start.sh # SessionStart hook handler
│ ├── commands/
│ │ └── altimate.md # /altimate slash command
│ │ └── altimate.md # /altimate-code:altimate slash command
│ ├── README.md # plugin-specific docs
│ └── CHANGELOG.md # plugin-specific changelog
├── README.md # repo overview
Expand All @@ -47,7 +47,7 @@ altimate-claude-plugin/
## What to change where

- **Routing behavior** (when Claude picks up the skill): edit `plugins/altimate-code/skills/altimate-code/SKILL.md` frontmatter description and/or `plugins/altimate-code/hooks-handlers/session-start.sh` `additionalContext`.
- **Explicit-invocation UX** (what `/altimate <task>` does): edit `plugins/altimate-code/commands/altimate.md`.
- **Explicit-invocation UX** (what `/altimate-code:altimate <task>` does): edit `plugins/altimate-code/commands/altimate.md`.
- **CLI invocation details** (agent selection, flags, follow-up handling): edit the workflow section in `plugins/altimate-code/skills/altimate-code/SKILL.md`.

## Frontmatter — YAML gotcha
Expand Down Expand Up @@ -79,7 +79,7 @@ claude plugin install altimate-code@altimate-claude-plugin

- **Skill** — `plugins/altimate-code/skills/altimate-code/SKILL.md` — the delegation logic (`altimate-code run "$USER_TASK"` and surface the result).
- **Hook** — `plugins/altimate-code/hooks/hooks.json` + `plugins/altimate-code/hooks-handlers/session-start.sh` — SessionStart hook that describes the plugin's capabilities in the system prompt so Claude can route to it when the task shape fits.
- **Command** — `plugins/altimate-code/commands/altimate.md` — `/altimate` slash command for explicit delegation with agent-persona selection.
- **Command** — `plugins/altimate-code/commands/altimate.md` — `/altimate-code:altimate` slash command for explicit delegation.

## Reporting bugs / requesting features

Expand Down
2 changes: 1 addition & 1 deletion PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This policy supplements the Altimate AI [Privacy Policy](https://www.altimate.ai

The plugin contains no executable service of its own. Its only runtime behavior is a SessionStart hook that prints a fixed, static text block describing the skill's capabilities. It does not read your files, does not phone home, and does not collect analytics.

Data leaves Claude Code's process only when the delegation skill or the `/altimate` command fires and invokes the locally installed altimate-code CLI.
Data leaves Claude Code's process only when the delegation skill or the `/altimate-code:altimate` command fires and invokes the locally installed altimate-code CLI.

## Data flows when a task is delegated

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ Currently ships one plugin: **[altimate-code](./plugins/altimate-code/)** — de

## Install

From Anthropic's plugin directory:

```bash
claude plugin install altimate-code
```

Or from this marketplace:

```
/plugin marketplace add AltimateAI/altimate-claude-plugin
/plugin install altimate-code@altimate-claude-plugin
Expand Down
4 changes: 2 additions & 2 deletions plugins/altimate-code/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "altimate-code",
"displayName": "Altimate Code",
"version": "1.0.0",
"description": "Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools (SQL analysis, column-level lineage, dbt build/test/run, warehouse profiling, FinOps, connectivity to Snowflake, BigQuery, Redshift, Databricks, Postgres, MySQL, DuckDB).",
"version": "1.1.0",
"description": "Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools (SQL analysis, column-level lineage, dbt build/test/run, warehouse profiling, FinOps, connectivity to Snowflake, BigQuery, Redshift, Databricks, Postgres, MySQL, DuckDB), and to the skills, knowledge and memory of a linked Altimate workspace.",
"author": {
"name": "AltimateAI",
"url": "https://altimate.ai"
Expand Down
15 changes: 15 additions & 0 deletions plugins/altimate-code/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to this plugin will be documented in this file.

## [1.1.0] — 2026-10-19

### Fixed
- Delegated runs no longer hang. Claude Code's shell leaves stdin open and `altimate-code run` reads piped stdin as part of the task, so the run waited forever before it started. Every `altimate-code run` invocation now redirects stdin from `/dev/null`.
- The skill and `/altimate-code:altimate` no longer pass `--agent fast-edit`. altimate-code has no such agent, so every run fell back to `builder` with a warning. Runs now ask for `builder` directly.
- Sign-in advice uses `altimate-code auth login -p altimate-backend --method "Altimate LLM Gateway"`. Without `--method`, `auth login` waits at a menu that Claude Code's `!` prompt cannot answer.
- The output file is created with `mktemp "${TMPDIR:-/tmp}/altimate-result.XXXXXX"`. On macOS, `mktemp -t altimate-result.XXXXXX.md` left the `X`s in the name.

### Added
- Altimate workspaces: the skill, `/altimate-code:altimate` and the SessionStart context say that a linked project's runs use the workspace's skills, knowledge and memory, route questions about the team's own conventions and knowledge to altimate-code, and tell the user how to sign in and link. Linking from Claude Code lists the workspaces with `altimate-code workspace list` (in altimate-code releases that have it) and links the chosen one with `link --workspace`, because the `link` picker needs a terminal that `!` does not provide.
- README: "Use an Altimate workspace" setup, and the install command for Anthropic's plugin directory.

### Changed
- Docs name the command `/altimate-code:altimate`, as Claude Code lists it. Claude Code namespaces plugin commands, so a bare `/altimate` answers "Unknown command".

## [1.0.0] — 2026-07-09

### Added
Expand Down
29 changes: 25 additions & 4 deletions plugins/altimate-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ Routes dbt + warehouse tasks from Claude Code to [altimate-code](https://github.

## Install

From Anthropic's plugin directory:

```bash
claude plugin install altimate-code
```

Or from this repository's marketplace:

```
/plugin marketplace add AltimateAI/altimate-claude-plugin
/plugin install altimate-code@altimate-claude-plugin
Expand All @@ -27,13 +35,24 @@ If altimate-code is not on PATH or not configured, the plugin surfaces the failu
## How it works

1. A **SessionStart hook** adds a static description of altimate-code's capabilities to the session, so Claude Code knows when a task fits.
2. When a data-engineering task fires the **skill** (or you invoke **`/altimate <task>`** explicitly), Claude Code runs `altimate-code run "<your task>"` locally, selecting the cheapest suitable agent persona (`fast-edit` for dbt/SQL edits, `analyst` for aggregation-heavy correctness work, `builder` for warehouse-state investigation).
2. When a data-engineering task fires the **skill** (or you invoke **`/altimate-code:altimate <task>`** explicitly), Claude Code runs `altimate-code run "<your task>"` locally with its `builder` agent.
3. altimate-code plans and executes the task using your configured LLM provider. Warehouse queries, dbt commands, and file edits run **locally under your credentials**.
4. The result is written to a local output file and surfaced back in your Claude Code conversation.

## Use an Altimate workspace

An [Altimate workspace](https://help.altimate.ai/workspaces/) holds your team's shared skills, knowledge, memory and warehouse integrations. Claude Code reaches it through altimate-code: every task the plugin hands over runs in your project, so it uses the workspace the project is linked to. Nothing in Claude Code needs configuring.

1. **Sign in to Altimate** — `altimate-code auth login -p altimate-backend --method "Altimate LLM Gateway"`. It opens your browser. This also sets up the model provider altimate-code uses. You can run it from Claude Code by typing it after `!`.
2. **Link the project** — ask Claude to link the project to your workspace. It lists your workspaces with `altimate-code workspace list` and links the one you choose with `altimate-code link --workspace "<id or name>"`, or creates one with `altimate-code link --create`. Moving a linked project to a different workspace also needs `--yes`. `workspace list` is in newer altimate-code releases; with an older one, tell Claude the workspace's name. In a terminal, `altimate-code link` does the same with a picker; the picker does not work after `!` in Claude Code.
3. **Check it** — `altimate-code workspace status` shows the linked workspace and its page in the Altimate web app.
4. **Ask Claude** — questions about your team's conventions, standards or knowledge go to altimate-code, which answers from the workspace. Start a request with `/altimate-code:altimate` to be sure it does: *"/altimate-code:altimate what are our naming conventions for staging models?"*

What altimate-code learns during these tasks is saved to the workspace's memory and shared with your team in the CLI, the IDE and Studio. Skills added to the workspace reach the next task.

## Example prompts

Once installed, try these in Claude Code (or prefix any of them with `/altimate`):
Once installed, try these in Claude Code (or prefix any of them with `/altimate-code:altimate`):

1. **Column-level lineage** — *"Trace the `revenue_usd` column in `models/marts/fct_revenue.sql` back to its sources, and list every downstream model that would be affected if I change its rounding."*
2. **Warehouse cost analysis** — *"Give me a cost report for our Snowflake account: the ten most expensive queries this month and any warehouses that look over-provisioned."*
Expand All @@ -55,14 +74,16 @@ Full details: **[PRIVACY.md](../../PRIVACY.md)** · Security policy and disclosu
| Task hangs for several minutes | Open `altimate-code` to check for a pending prompt in the TUI, or re-run specifying a known-good model. |
| Empty result | The task may be too ambiguous — restate with the target table, expected columns, or time window. |
| `UNKNOWN_USER` / `Database does not exist` mid-run | The CLI connects but your warehouse credentials don't match this project — reconfigure warehouse auth in the `altimate-code` TUI or `profiles.yml`. |
| `Not signed in to Altimate` | Run `altimate-code auth login -p altimate-backend --method "Altimate LLM Gateway"`. |
| Answers ignore your workspace's skills or knowledge | Run `altimate-code workspace status` in the project. If it isn't linked, ask Claude to link it, or run `altimate-code link` in a terminal. |
| Plugin installed but never delegates | Confirm it's enabled: `claude plugin enable altimate-code@altimate-claude-plugin`. |

Still stuck? See [Support](#support).

## Components

- **Skill** — `skills/altimate-code/SKILL.md` — delegation logic and agent-persona selection
- **Command** — `commands/altimate.md` — `/altimate` slash command for explicit delegation
- **Skill** — `skills/altimate-code/SKILL.md` — delegation logic and workspace guidance
- **Command** — `commands/altimate.md` — `/altimate-code:altimate` slash command for explicit delegation
- **Hook** — `hooks/hooks.json` — SessionStart capability description (static text only)

## Support
Expand Down
49 changes: 23 additions & 26 deletions plugins/altimate-code/commands/altimate.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
description: Delegate a task to altimate-code, the specialised data-engineering CLI agent (warehouse access, column-level lineage, cross-DB, FinOps, query optimization)
description: Delegate a task to altimate-code, the specialised data-engineering CLI agent (warehouse access, column-level lineage, cross-DB, FinOps, query optimization, your Altimate workspace's skills and knowledge)
argument-hint: <task description>
---

The user explicitly invoked `/altimate` to delegate this task to altimate-code. You MUST run the task via the `altimate-code` CLI — do NOT attempt the work with native `Bash`/`Edit`/`Write` tools.
The user explicitly invoked `/altimate-code:altimate` to delegate this task to altimate-code. You MUST run the task via the `altimate-code` CLI — do NOT attempt the work with native `Bash`/`Edit`/`Write` tools, and do not read the project's files first: altimate-code investigates the project itself.

Workflow (follow in order, no skipping):

Expand All @@ -12,57 +12,54 @@ Workflow (follow in order, no skipping):
command -v altimate-code
```
If it returns nothing, stop and tell the user:
> altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+), then run `altimate-code` once to configure your provider/warehouse auth, then re-run `/altimate <task>`.
> altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+), then run `altimate-code` once to configure your provider/warehouse auth, then re-run `/altimate-code:altimate <task>`.

2. **Pick the agent persona** based on the user's task shape. Start cheap and escalate on failure — fast-edit handles most dbt/SQL work at 10–20× lower cost than builder.
2. **Vague debug** ("X is broken") with no failure named: **stop — ask the user for the specific error before delegating.**

| Task shape | Use `--agent` |
|---|---|
| Any dbt / SQL task (rename, refactor, create, debug, structural) | `fast-edit` (default) |
| Aggregation correctness on multi-table joins | `analyst` if fast-edit fails the user's verification |
| Warehouse-state work (lineage, cost, parity, schema diff, PII, FinOps) | `builder` |
| Vague debug ("X is broken") | **Stop — ask the user for the specific error before delegating.** |

Decision rule: start with `fast-edit`. Only use `analyst` / `builder` when the cheap path fails for a documented reason.

3. **Run altimate-code with the chosen agent.** Pass `$ARGUMENTS` through a
3. **Run altimate-code with the `builder` agent**, which has the warehouse tools, workspace skills and memory. Pass `$ARGUMENTS` through a
here-doc into a variable so the shell never command-substitutes anything the
user typed, and write the result to a private `mktemp` file (not a shared
user typed, write the result to a private `mktemp` file (not a shared
`/tmp/altimate-result.md` — concurrent invocations clobber each other and a
world-readable fixed path leaks warehouse rows or PII):
world-readable fixed path leaks warehouse rows or PII), and redirect stdin
from `/dev/null` (`altimate-code run` reads piped stdin as part of the task,
and this shell leaves stdin open):
```bash
TASK="$(cat <<'ALTIMATE_TASK'
$ARGUMENTS
ALTIMATE_TASK
)"
umask 077
OUTPUT_FILE="$(mktemp -t altimate-result.XXXXXX.md)"
OUTPUT_FILE="$(mktemp "${TMPDIR:-/tmp}/altimate-result.XXXXXX")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: TMPDIR commonly has a trailing slash on macOS (e.g. /var/folders/.../T/), so ${TMPDIR:-/tmp}/altimate-result.XXXXXX expands with a double slash (//altimate-result...). Strip any trailing slash with ${TMPDIR%/} so the path is normalized.

Suggested change
OUTPUT_FILE="$(mktemp "${TMPDIR:-/tmp}/altimate-result.XXXXXX")"
OUTPUT_FILE="$(mktemp "${TMPDIR%/:-/tmp}/altimate-result.XXXXXX")"

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this. A double slash in a path is harmless on macOS and Linux; delegated runs in testing wrote to …/T//altimate-result.XXXX fine. The suggested ${TMPDIR%/:-/tmp} is also not valid parameter expansion.

altimate-code run "$TASK" \
--agent <fast-edit|analyst|builder> \
--agent builder \
--yolo \
--output "$OUTPUT_FILE" \
--dir "$(pwd)"
--dir "$(pwd)" \
< /dev/null
```

**If this is a follow-up task in the same project** (the user invoked `/altimate` already in this conversation about the same dbt project / warehouse / data context), add `--continue` to resume the warm session — cache is hot, follow-on cost is materially lower:
**If this is a follow-up task in the same project** (the user invoked `/altimate-code:altimate` already in this conversation about the same dbt project / warehouse / data context), add `--continue` to resume the warm session — cache is hot, follow-on cost is materially lower:

```bash
TASK="$(cat <<'ALTIMATE_TASK'
$ARGUMENTS
ALTIMATE_TASK
)"
umask 077
OUTPUT_FILE="$(mktemp -t altimate-result.XXXXXX.md)"
OUTPUT_FILE="$(mktemp "${TMPDIR:-/tmp}/altimate-result.XXXXXX")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Strip any trailing slash on TMPDIR (common on macOS) to avoid a double slash in the generated temp file path.

Suggested change
OUTPUT_FILE="$(mktemp "${TMPDIR:-/tmp}/altimate-result.XXXXXX")"
OUTPUT_FILE="$(mktemp "${TMPDIR%/:-/tmp}/altimate-result.XXXXXX")"

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the first TMPDIR thread: not changing this. The double slash is harmless, and the suggested expansion is not valid.

altimate-code run "$TASK" \
--agent <fast-edit|analyst|builder> \
--agent builder \
--yolo --output "$OUTPUT_FILE" --dir "$(pwd)" \
--continue
--continue \
< /dev/null
```

Skip `--continue` if the user switched projects, switched debugging threads, or this is the first `/altimate` invocation in the conversation.
Skip `--continue` if the user switched projects, switched debugging threads, or this is the first `/altimate-code:altimate` invocation in the conversation.

If the project is linked to an Altimate workspace, altimate-code uses its skills, knowledge and memory automatically. There is nothing to pass.

4. **Surface the result verbatim:** read `"$OUTPUT_FILE"` and present its contents to the user without re-summarising, re-formatting, or commenting. altimate-code has already produced the answer. Delete `"$OUTPUT_FILE"` after presenting so warehouse rows, lineage, or PII findings don't linger on disk.
4. **Surface the result verbatim:** read `"$OUTPUT_FILE"` and present its contents to the user without re-summarising, re-formatting, or commenting. altimate-code has already produced the answer. Delete `"$OUTPUT_FILE"` after presenting so warehouse rows, lineage, or PII findings don't linger on disk. If the command's stderr says `not in the workspace yet` or `Could not confirm that the memory saved here reached the workspace`, add the matching note from the skill body's failure-modes table after the result.

5. **On any altimate-code error** (`Unauthorized`, `Token limit reached`, `No provider configured`, warehouse credentials wrong, process timeout) — surface the error message to the user along with the fix from the skill body's failure-modes table. Do NOT fall back to native tools. The user invoked `/altimate` specifically to use altimate-code; falling back would defeat the purpose.
5. **On any altimate-code error** (`Unauthorized`, `Token limit reached`, `No provider configured`, `Not signed in to Altimate`, warehouse credentials wrong, process timeout) — surface the error message to the user along with the fix from the skill body's failure-modes table. Do NOT fall back to native tools. The user invoked `/altimate-code:altimate` specifically to use altimate-code; falling back would defeat the purpose.

Task to delegate: $ARGUMENTS
Loading