tusharjayanti

Calculator Agent — Development skill for Claude Code

Development community

Building a calculator as an agent that can be asked basic mathematical questions.

How to install Calculator Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open tusharjayanti/calculator-agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Calculator Agent does

Building a calculator as an agent that can be asked basic mathematical questions.

Alternatives in Development

  • Understand Anything — Graphs that teach graphs that impress 80.7k ★
  • Research Codebase — You are tasked with conducting comprehensive research across the codebase to answer user questions by spawning 10k ★
  • Create Toolset — You are asked to build a new toolset 3.1k ★

README

calculator-agent

A conversational calculator that answers everyday math questions in plain English. Ask it to split a bill, add tax, compute percentages, or evaluate any arithmetic expression — it picks the right tool automatically and streams the answer back word-by-word.

Supports **Anthropic Claude** and **Google Gemini** out of the box via a clean provider abstraction — swap backends by changing one line.

![Demo](docs/demo.gif)


Features

  • Natural language input — no need to type formulas; just ask
  • Streaming responses — answers print word-by-word as the model generates them
  • Pluggable LLM backend — switch between Claude and Gemini (or add any provider) without touching agent logic
  • Four built-in tools the model calls automatically:
    • calculate — general arithmetic (sqrt, **, %, pi, e, parentheses)
    • percentage — "what is X% of Y?"
    • split_bill — divide a bill N ways with an optional tip
    • add_tax — apply a sales-tax rate to a subtotal
  • Safe evaluator — arithmetic is parsed via Python's ast module, never eval()
  • Session persistence — conversation history is saved to history.json and reloaded on next launch
  • /history — replay the current session in the terminal
  • /history export — export the session as a Markdown file

Setup

Prerequisites

  • Python 3.12+
  • `uv` — fast Python package manager
  • An API key for your chosen provider (Anthropic or Gemini)

Install

git clone https://github.com/tusharjayanti/calculator-agent.git
cd calculator-agent
uv sync

Configure

Copy `.env.example` to `.env` and fill in the key for the provider you want to use:

cp .env.example .env
# Anthropic — https://console.anthrop