npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gitasking

v0.3.0

Published

RAG codebase assistant — index a git repo locally, then ask questions and edit code with Claude or a local Ollama model (no API key), designed to minimize token usage.

Readme

gitasking

████  █████  ███   ███  █████ ███ █   █ ███ █████ █████
█   █ █     █   █ █       █    █  █   █  █    █   █
████  ████  █████ █       █    █  █   █  █    █   ████
█  █  █     █   █ █       █    █   █ █   █    █   █
█   █ █████ █   █  ███    █   ███   █   ███   █   █████
          by Javid Salimov

RAG codebase assistant. Index a git repo locally, then ask questions about it and let it edit code — designed to spend Claude tokens as rarely as possible.

Why it's cheap on tokens

Three layers cut Claude usage:

  1. Local embeddings — the whole repo is embedded on your machine (all-MiniLM-L6-v2 via Transformers.js). Indexing costs 0 tokens.
  2. Retrieval — each question/edit sends only the top‑k relevant code chunks to Claude, never the whole codebase.
  3. Answer cache — semantically similar repeat questions are served from a local cache with no Claude call at all.

Claude is called only on a fresh (cache‑miss) question or an edit, and only for a handful of code chunks.

Install

npm install -g gitasking
# or, from source:
npm install && npm run build

API key

Provide your Anthropic key any of these ways (resolved in this order):

# a) environment variable (takes priority)
export ANTHROPIC_API_KEY=sk-ant-...

# b) save it once, locally (hidden input)
gitasking login

# c) do nothing — the first `gitasking ask`/`edit` prompts you for it
#    and offers to save it for next time

Resolution order: ANTHROPIC_API_KEY env var → saved file (~/.gitasking/credentials.json, owner‑only) → interactive hidden prompt. Remove a saved key with gitasking logout.

Commands

| Command | What it does | |---|---| | gitasking index [path] | Index a repo locally (no Claude tokens). Default path: current dir. Incremental — re‑embeds only changed files. | | gitasking ask "<question>" | Answer a question with code snippets, citing path:line. Claude only on a cache miss. | | gitasking edit "<instruction>" | Propose search/replace edits, show a diff, then apply after confirmation. | | gitasking clear-cache | Clear the answer cache for a repo. | | gitasking login / gitasking logout | Save / remove the Anthropic API key. |

Every run prints the banner to stderr, so it never pollutes piped stdout (e.g. gitasking ask "..." > answer.md).

Usage

# 1. Index a repo (local, no tokens)
gitasking index
gitasking index /path/to/repo

# 2. Ask questions (Claude only on a cache miss)
gitasking ask "how does authentication work?"
gitasking ask "where is the HTTP server started?" --path /path/to/repo
gitasking ask "..." --model claude-sonnet-4-6   # cheaper model
gitasking ask "..." --top-k 12                   # retrieve more chunks
gitasking ask "..." --no-cache                   # always call Claude

# 3. Edit code from an instruction (diff + confirm)
gitasking edit "rename the function fooBar to fooBaz where it's defined"
gitasking edit "add input validation to parseConfig" --dry-run   # preview only
gitasking edit "..." --yes                                        # apply without confirming

# 4. Maintenance
gitasking clear-cache
gitasking login     # save key (hidden input)
gitasking logout    # remove saved key

Editing code

gitasking edit "<instruction>" retrieves the relevant chunks, asks Claude for exact search/replace edits, prints a diff, and applies them only after you confirm (default answer is No). Flags: --dry-run shows the diff without writing, --yes skips the confirmation. Edits that don't match a file exactly (or aren't unique, or escape the repo) are skipped and reported. After applying, run gitasking index to refresh the index.

Re‑running gitasking index re‑embeds only changed files and clears the (possibly stale) answer cache.

Models

Default: claude-opus-4-8. Cheaper alternatives via --model:

| Model | Input / Output ($/1M) | |---|---| | claude-opus-4-8 (default) | $5.00 / $25.00 | | claude-sonnet-4-6 | $3.00 / $15.00 | | claude-haiku-4-5 | $1.00 / $5.00 |

Programmatic API

import { resolveConfig, runIndex, retrieve, answer, proposeEdits, planEdits, writePlan } from 'gitasking';

const cfg = resolveConfig('/path/to/repo');
await runIndex(cfg, console.log);

// Q&A
const { chunks } = await retrieve(cfg, 'how does routing work?');
const text = await answer(cfg, 'how does routing work?', chunks, (t) => process.stdout.write(t));

// Edit
const edits = await proposeEdits(cfg, 'add a health check route', chunks);
const plan = await planEdits(cfg.repoPath, edits);
await writePlan(plan); // writes the files

How it stores data

Per repo, under .gitasking/:

  • index.json — code chunk vectors + metadata
  • meta.json — per‑file content hashes (incremental indexing)
  • answer-cache.json — cached question embeddings + answers

The API key (if saved) lives separately at ~/.gitasking/credentials.json.

Add .gitasking/ to your .gitignore.

Requirements

  • Node.js ≥ 18
  • git on PATH (indexing uses git ls-files, so it respects .gitignore)

License

MIT