-
Notifications
You must be signed in to change notification settings - Fork 4
feat(altimate-code): SessionStart hook injecting skill-consultation directive #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sahrizvi
wants to merge
1
commit into
main
Choose a base branch
from
feat/altimate-code-session-start-hook
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/usr/bin/env bash | ||
| # SessionStart hook for the altimate-code skill. Injects a one-shot directive | ||
| # into the session's system prompt telling the agent to consult Skills before | ||
| # reading files when the task is data-engineering shaped. | ||
| cat <<'EOF' | ||
| { | ||
| "hookSpecificOutput": { | ||
| "hookEventName": "SessionStart", | ||
| "additionalContext": "You have access to data-engineering skills via plugins: dbt-skills (refactoring, creating, testing, debugging, documenting, migrating dbt models, incremental models), snowflake-skills (finding expensive queries, optimizing query by id, optimizing query text), and altimate-code (warehouse access, column-level lineage, dbt builds against real warehouses, cross-database operations, multi-warehouse data parity). When the user's task involves dbt models, SQL refactoring, data warehouse work, query optimization, or cross-database operations, INVOKE THE Skill TOOL FIRST — before reading files, writing code, or starting work directly. Prefer altimate-code:altimate-code when the task needs live warehouse access, column-level lineage, dbt builds against a real warehouse, profiling, cost attribution, or cross-database migration. Use Skill consultation as your first action on every data-engineering task; the skill's body will tell you how to proceed." | ||
| } | ||
| } | ||
| EOF | ||
| exit 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "description": "Nudges the agent to consult Skills before reading files on data-engineering tasks, with explicit mention of altimate-code for warehouse/lineage/cross-DB work.", | ||
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh\"" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When and how does it get called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there needs to be some installation which adds to the skills right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When/how it's called: It's a Claude Code SessionStart hook.
skills/altimate-code/hooks/hooks.jsonregisters it, so Claude Code's harness runsbash ${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.shautomatically on every session start (new chat, /clear, /resume). The script prints a JSON envelope on stdout; Claude Code parseshookSpecificOutput.additionalContextand injects that string into the session's system prompt for that one session. Nothing in this repo invokes it directly — the harness does, on the user's machine, once the plugin is installed.Installation: Yes —
.claude-plugin/marketplace.jsondeclares three plugins (dbt-skills,snowflake-skills,altimate-code). A user installs the altimate-code plugin via:That registers the SessionStart hook and makes the
altimate-codeskill discoverable via the Skill tool — no manual wiring needed.One caveat: this is a two-layered install. The plugin install adds the skill + hook. The actual
altimate-codeCLI binary that the skill delegates to is a separate npm package (npm install -g altimate-code) — the skill body gates oncommand -v altimate-codeand surfaces the install command if missing (seeSKILL.mdlines 10-30). We intentionally don't auto-install the CLI because users may want a specific version, a different package manager, or to opt out.Did you mean the CLI should be installed as part of the plugin install? Happy to wire that up if so — though it'd mean shipping a PostInstall-style hook that runs npm on the user's machine, which is a bigger behavior change worth discussing first.