A practical, developer-friendly CLI for running Claude workflows from your terminal.
Turn repeatable prompting into reusable commands for code review, diff analysis, file summaries, error explanation, and batch jobs.
Claude Tools is a clean Python CLI that helps you use Claude for common engineering and writing workflows without rewriting prompts every time.
It gives you:
- a simple terminal interface
- reusable prompt templates
- environment-based configuration
- file and stdin support
- JSON / JSONL batch execution
- a clean base for adding more Claude-powered commands later
This project is intentionally lightweight: no web app, no database, no heavy framework. Just a solid CLI that is easy to install, extend, and ship.
| Terminal-first workflow | Run Claude directly from your shell using a small, focused CLI. |
| Reusable templates | Built-in prompt templates for code review, PR summaries, diff review, test generation, commit messages, meeting notes, file summaries, and error analysis. |
| File + stdin support | Pass prompts directly, read piped input, or analyze local text files. |
| Batch processing | Run multiple jobs from .json or .jsonl files. |
| Configurable defaults | Use .env and environment variables for API key, model, token limits, and system prompt. |
| Developer-friendly output | Rich terminal output, optional JSON responses, and file export support. |
| Production-ready project scaffold | Includes packaging, tests, and GitHub Actions CI. |
| Command | Purpose |
|---|---|
claude-tools version |
Show installed version |
claude-tools config |
Show resolved configuration with redacted API key |
claude-tools templates |
List available templates |
claude-tools templates -v |
Show templates with descriptions and variables |
claude-tools template-info <name> |
Show one template in detail |
claude-tools render <template> |
Render a template locally without calling the API |
claude-tools ask ... |
Send a direct prompt or template-based prompt to Claude |
claude-tools summarize-file <path> |
Summarize a local text file |
claude-tools explain-error <path> |
Explain an error log or stack trace |
claude-tools review-diff <path> |
Review a Git diff |
claude-tools batch <jobs.json> |
Run multiple prompts from JSON or JSONL |
claude-tools save-example-batch <path> |
Generate a sample batch file |
| Template | What it does |
|---|---|
code_review |
Reviews code for bugs, clarity, maintainability, and test gaps |
pr_summary |
Summarizes a pull request or change set |
meeting_notes |
Converts rough notes into structured meeting notes |
file_summary |
Summarizes a file with key risks and next steps |
error_explain |
Explains stack traces or logs and suggests fixes |
diff_review |
Reviews a Git diff like a senior engineer |
test_generation |
Generates high-value test ideas |
commit_message |
Produces a concise conventional commit message |
git clone https://github.com/HimaniSingh3/claude-tools.git
cd claude-toolspython -m venv .venv
source .venv/bin/activateOn Windows PowerShell:
python -m venv .venv
.venv\Scripts\Activate.ps1pip install -e .For development tools as well:
pip install -e .[dev]Create a local environment file from the example:
cp .env.example .envSet your Anthropic API key:
ANTHROPIC_API_KEY=your_api_key_here
CLAUDE_MODEL=claude-sonnet-4-6
CLAUDE_MAX_TOKENS=1200
CLAUDE_SYSTEM_PROMPT=You are a concise and practical assistant.| Variable | Required | Default | Description |
|---|---|---|---|
ANTHROPIC_API_KEY |
Yes for API calls | — | Your Anthropic API key |
CLAUDE_MODEL |
No | claude-sonnet-4-6 |
Default Claude model |
CLAUDE_MAX_TOKENS |
No | 1200 |
Default max output tokens |
CLAUDE_SYSTEM_PROMPT |
No | You are a concise and practical assistant. |
Default system prompt |
Check the resolved configuration anytime:
claude-tools configclaude-tools ask "Explain Python context managers with a simple example"claude-tools render code_review --var code="def add(a,b): return a+b"claude-tools ask --template code_review --var code="def add(a,b): return a+b"echo "Summarize the pros and cons of using SQLite in desktop apps" | claude-tools ask --stdinclaude-tools ask "Draft a release note for version 1.0.0" --save RELEASE_NOTES.mdclaude-tools ask "List 3 API design mistakes" --jsonclaude-tools summarize-file README.mdAdd extra instructions:
claude-tools summarize-file README.md --instructions "Focus on developer onboarding gaps"claude-tools explain-error logs.txtOr pipe logs from another command:
python app.py 2>&1 | claude-tools explain-error --stdingit diff > changes.diff
claude-tools review-diff changes.diffOr pipe the diff directly:
git diff | claude-tools review-diff --stdinclaude-tools templates -v
claude-tools template-info diff_reviewClaude Tools can run multiple jobs from either a JSON array or a JSONL file.
claude-tools save-example-batch examples/jobs.jsonclaude-tools batch examples/jobs.jsonclaude-tools batch examples/jobs.json --output results.jsonclaude-tools batch examples/jobs.json --dry-run[
{
"name": "readme-summary",
"prompt": "Summarize this project in 5 bullets."
},
{
"name": "review-snippet",
"template": "code_review",
"variables": {
"code": "def add(a, b): return a + b"
}
}
]Each job supports:
name— optional human-readable identifierprompt— direct prompt texttemplate— template name instead of raw promptvariables— template variables objectsystem— optional system prompt overridemetadata— extra metadata preserved in results
A job must define either prompt or template.
claude-tools ask [PROMPT] [OPTIONS]Common options:
--template— render a named template first--var key=value— pass template variables--stdin— read the prompt body from stdin--system— override the default system prompt--model— override the configured model--max-tokens— override the configured max token count--temperature— set request temperature--dry-run— render only, do not call the API--json— print structured response metadata--save PATH— write response text to a file
Summarizes a local text file using the built-in file_summary template.
claude-tools summarize-file path/to/file.txtExplains a text log, stack trace, or piped stderr output.
claude-tools explain-error error.logReviews a Git diff from a file or stdin.
claude-tools review-diff changes.diffRenders a template locally for inspection or debugging.
claude-tools render commit_message --var changes="fix auth timeout"claude-tools/
├── .github/workflows/ci.yml
├── .env.example
├── .gitignore
├── LICENSE
├── README.md
├── examples/
│ └── jobs.json
├── claude_tools/
│ ├── __init__.py
│ ├── batch.py
│ ├── cli.py
│ ├── client.py
│ ├── config.py
│ ├── io_utils.py
│ └── templates.py
├── tests/
│ ├── test_batch.py
│ ├── test_cli_helpers.py
│ └── test_templates.py
└── pyproject.toml
pytestruff check .python -m buildSet your API key in .env or in your shell environment.
Install the package in editable mode:
pip install -e .If you see an error like:
Missing required template variable: code
make sure every required template field is passed with --var key=value.
summarize-file, explain-error, and review-diff are designed for text input. Binary files are not supported.
A lot of Claude usage starts as ad hoc prompting and stays that way for too long.
This project turns that into a repeatable tool:
- prompts become reusable templates
- terminal workflows become one-liners
- repeated tasks become scripts instead of copy-paste rituals
It is a strong base for future commands like:
review-prsummarize-commitgenerate-tests-from-file- Git-aware repository helpers
- custom user-defined templates
This project is licensed under the MIT License. See the LICENSE file for details.