feat: add /project-costs Claude command and make target - #35
Merged
Conversation
Adds a cost-visibility tool with two parts: - `scripts/project_costs.py`: queries AWS Cost Explorer (daily, last 30 days) and Databricks `system.billing.usage` (via SDK), printing two formatted tables. - `make project-costs`: thin Makefile target that runs the script. - `.claude/commands/project-costs.md`: slash command that runs the script then has Claude analyze the output for anomalies, spikes, period comparisons, and cross-cloud correlation. - `.gitignore`: tracks `.claude/commands/` so project-level slash commands are shared with the team; personal settings/hooks remain gitignored. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…akage - Catch FileNotFoundError when AWS CLI is not on PATH (previously crashed before Databricks table printed) - Add StatementState.CLOSED to poll-exit set to prevent infinite loop when a warehouse closes a statement - Guard stmt.status.error before accessing .message (was None on CANCELED) - Wrap json.loads in try/except JSONDecodeError for AWS pager/helper output - Stop echoing raw AWS CLI stderr — AccessDeniedException messages include caller ARNs with the AWS account ID; print a sanitized message instead - Print type(e).__name__ instead of the full exception on WorkspaceClient init failure — SDK exceptions can embed the workspace URL - Validate --days >= 1 to prevent inverted AWS date range and negative SQL INTERVAL Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Test plan
🤖 Generated with Claude Code