Add maxpylang setup-claude CLI command#12
Merged
Merged
Conversation
Ships a CLAUDE.md template with the package so users can run `maxpylang setup-claude` in their project directory. Claude Code automatically loads CLAUDE.md, giving it deterministic API instructions with prompt-cached token savings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e7bd826 to
5fd91ac
Compare
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
Adds a CLI command that ships a CLAUDE.md template with the package, so users can set up deterministic Claude Code instructions in one step.
Why
After our YouTube videos gained traction, users asked a valid question: how does Claude "know" to use MaxPyLang?
Currently, Claude's discovery of the MaxPyLang API is heuristic — it may or may not read the
__init__.pydocstring, explore source files, or rely on training data. This is non-deterministic and sometimes leads to incorrect API usage.CLAUDE.md solves this because Claude Code automatically loads it on every session start — no guessing, no exploration. It's also prompt-cached, meaning those tokens cost 90% less than a skill file or agent self-discovery.
We considered two approaches:
__init__.pydocstring (current).md~/.claude/skills/CLAUDE.md was the best tradeoff: deterministic, cheapest on tokens, and simple to set up.
New user flow
If
CLAUDE.mdalready exists, the command warns and exits. Use--forceto overwrite:What changed
maxpylang/data/CLAUDE_TEMPLATE.md(new) — The template CLAUDE.md containing the full MaxPyLang API guide. Ships inside the pip package automatically via existingMANIFEST.incoverage.maxpylang/cli.py(new) — Minimal CLI using argparse.setup-claudesubcommand copies the template to./CLAUDE.md. Includes error handling for permissions issues and missing template files.pyproject.toml— Added[project.scripts]entry point:maxpylang = "maxpylang.cli:main"Test plan
pip install -e .to register the console scriptmaxpylangwith no args prints helpmaxpylang setup-claudecreates./CLAUDE.mdwith correct contentmaxpylang setup-claude --forceoverwrites