Skip to content

Add maxpylang setup-claude CLI command#12

Merged
santolucito merged 1 commit into
mainfrom
claude-md-support
Apr 10, 2026
Merged

Add maxpylang setup-claude CLI command#12
santolucito merged 1 commit into
mainfrom
claude-md-support

Conversation

@chrishyoroklee
Copy link
Copy Markdown
Collaborator

@chrishyoroklee chrishyoroklee commented Apr 9, 2026

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__.py docstring, 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:

Approach Deterministic? Token cost Setup
__init__.py docstring (current) No — agent must choose to read it Full price None
CLAUDE.md (this PR) Yes — always loaded 90% cheaper (cached) One command
Skill .md Yes, when invoked Full price Install to ~/.claude/skills/

CLAUDE.md was the best tradeoff: deterministic, cheapest on tokens, and simple to set up.

New user flow

# 1. Install (same as before)
pip install maxpylang

# 2. Set up Claude Code support (one-time, per project)
cd my_project
maxpylang setup-claude
# → "Created /path/to/my_project/CLAUDE.md"

# 3. Just prompt naturally — no need to say "use maxpylang"
# Claude already has the full API guide loaded.

If CLAUDE.md already exists, the command warns and exits. Use --force to overwrite:

maxpylang setup-claude         # → "CLAUDE.md already exists. Use --force to overwrite."
maxpylang setup-claude --force # → overwrites

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 existing MANIFEST.in coverage.
  • maxpylang/cli.py (new) — Minimal CLI using argparse. setup-claude subcommand 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 script
  • maxpylang with no args prints help
  • maxpylang setup-claude creates ./CLAUDE.md with correct content
  • Running it again warns "already exists"
  • maxpylang setup-claude --force overwrites
  • Open Claude Code in the directory — confirm CLAUDE.md is loaded and Claude knows the MaxPyLang API without being told

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>
@santolucito santolucito merged commit 4d535b1 into main Apr 10, 2026
5 checks passed
@santolucito santolucito deleted the claude-md-support branch April 10, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants