Skip to main content

Maximal token-efficient RAG for headless Claude. Uses your existing claude CLI; auth-agnostic; slice-level retrieval.

Project description

jragmunch-cli

Maximal token-efficient RAG for headless Claude. Uses your existing claude CLI; auth-agnostic; slice-level retrieval powered by jcodemunch-mcp.

Billing: subscription by default, API on opt-in

By default, jragmunch never bills your Anthropic API account. It strips ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN from the subprocess environment before spawning claude, so the CLI uses your Max / Pro Claude OAuth login while respecting their TOS — you pay $0 in dollars, the work counts against your subscription's session limits.

If you want to bill via the API instead, pass --use-api:

jragmunch --use-api ask "..."

Every verb prints the cost split:

[tokens in=24 out=1273  cost actual=$0.0000 (notional=$0.5334, auth=subscription)  time=27549ms]
  • actual — what you were really billed (always $0 in subscription mode).
  • notional — what the work would have cost via the API. claude -p computes this regardless of auth mode; we surface it as a "what it might have cost" yardstick.
  • authsubscription or api. Run jragmunch doctor to see your resolved mode.

Why

Headless Claude (claude -p) is the right substrate for code automation — CI bots, batch refactors, fan-out agents, internal "chat with your repo" services. The default pattern is "stuff the relevant files into the prompt and pray," which burns tokens on code the model never needed.

jragmunch wraps claude -p with jcodemunch pre-wired so the model retrieves slices on demand instead of receiving giant context dumps.

Install

pip install jragmunch
jragmunch doctor

Requires the claude CLI on PATH (npm install -g @anthropic-ai/claude-code) and jcodemunch-mcp registered as an MCP server.

Usage

jragmunch ask "how does auth work in this repo"
jragmunch ask "what does AuthMiddleware.verify do" --json
jragmunch index --repo .
jragmunch run "Refactor the rate-limiter to use a token bucket"

Verbs (v0.1)

Verb Status Purpose
doctor shipped Verify claude + MCP wiring
ask shipped Retrieval-augmented Q&A
index shipped Index a repo via jcodemunch
run shipped Power-user prompt passthrough
review shipped Diff-aware PR review
changelog shipped Summarize changes since tag
refactor shipped Fan-out batch refactor
tests shipped Generate tests for untested symbols
sweep shipped Pattern-driven cleanup

See PRD.md for the full product spec.

Principles

  • Auth-agnostic. Whatever auth the local claude binary uses, jragmunch uses.
  • Slice, don't dump. Default behavior is jcodemunch retrieval.
  • Structured output. Every verb returns JSON with citations and _meta (tokens, cost, wall time).
  • Composable. --print-command shows the exact claude -p invocation that would run.

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jragmunch-0.4.2.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jragmunch-0.4.2-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file jragmunch-0.4.2.tar.gz.

File metadata

  • Download URL: jragmunch-0.4.2.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for jragmunch-0.4.2.tar.gz
Algorithm Hash digest
SHA256 9b1784bf9bf55ded31fd669fcb6cdd26c16d5d463a6672e525acbcf14adaa1f5
MD5 a0e2e3ac31ea92cee7e1b9489ac0f483
BLAKE2b-256 75943dbf5ab80c5c484899239b6d4372ff546773391c3a34d67b1feb22968991

See more details on using hashes here.

File details

Details for the file jragmunch-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: jragmunch-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for jragmunch-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e32a5ff61f219e5febadbb2e65393a7df173bd729099b44b8f61f5585c52d06
MD5 c8064184aefe66b99d57bb5c47b53c95
BLAKE2b-256 888a06f31471384168a7f6cce0f8650411c5e24f593cc94c9e90ac1a2f6492c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page