▲reactivite
/packages/docs/courses/cli/skillpool/promaster/contact
all docs

$ npm view gitasking

CLI

gitasking

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

npm versiondownloads
npm github
$ npm install 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#

CommandWhat 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-cacheClear the answer cache for a repo.
gitasking login / gitasking logoutSave / 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:

ModelInput / 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

  • home
  • packages
  • skillpool
  • docs
  • cli
▲reactivite

// The fastest way to scaffold production-ready React apps. Built by developers, for developers.

$ npm create reactivite@latest

resources/

  • └─ documentation
  • └─ packages
  • └─ cli
  • └─ courses
  • └─ markdown
  • └─ diff
  • └─ run
  • └─ radio
  • └─ tv
  • └─ games
  • └─ about
  • └─ contact

community/

  • └─ github

© 2026 reactivite — all rights reserved