sensegrep-cli

sensegrep-cli is a skill for Claude Code, Codex from Stahldavid/sensegrep. It costs 50 tokens per session (6,320 once invoked), scanned A, original, Apache-2.0.

A command-line skill for finding code by meaning, structure, or exact text using the sensegrep tool. It uses AI-based similarity search and syntax-tree analysis to explore a codebase.

In plain words
What is it for?
Use it to discover related functions or classes, explore project structure, search for exact text or patterns, inspect code relationships, and check for duplicates.
Why use it?
It helps locate code when you know what behavior you need but not the function or file name. Exact searches remain available for checking known strings or verifying every occurrence.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to discover related functions or classes, explore project structure, search for exact text or patterns, inspect code relationships, and check for duplicates.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stahldavid/sensegrep/sensegrep-cli
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Stahldavid/sensegrep --skill sensegrep-cli
Clone the repo
git clone --depth 1 https://github.com/Stahldavid/sensegrep

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sensegrep-cli

README.md
[![agentmods](https://agentmods.dev/badge/skills/stahldavid/sensegrep/sensegrep-cli/github.svg)](https://agentmods.dev/skills/stahldavid/sensegrep/sensegrep-cli)
Your own site
<a href="https://agentmods.dev/skills/stahldavid/sensegrep/sensegrep-cli"><img src="https://agentmods.dev/badge/skills/stahldavid/sensegrep/sensegrep-cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sensegrep-cli

Your own site · 80×15
<a href="https://agentmods.dev/skills/stahldavid/sensegrep/sensegrep-cli"><img src="https://agentmods.dev/badge/skills/stahldavid/sensegrep/sensegrep-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,320 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.06320
Opus 5.5 $0.00020 $0.02528
Sonnet 5.5 $0.00010 $0.01264
Haiku 4.5 $0.00005 $0.00632

Measured 26d ago against content hash 1a140c6d7aa0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sensegrep-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 26d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sensegrep-cli/SKILL.md · 477 lines

How it starts

The opening of the file, as written. The whole thing — 477 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Search code by meaning, not text patterns, by running the sensegrep command-line tool. Uses AI embeddings + tree-sitter AST parsing. This skill is CLI-first: it runs shell commands and reads their output. It does not require the sensegrep MCP server. If the sensegrep MCP tools are available in your environment, prefer those; otherwise use the CLI commands below.

Setup

Install the CLI once (global), then index the project before the first search:

npm install -g @sensegrep/cli
sensegrep index            # builds the semantic index for the current directory

Add --json to search, context, audit, survey, cluster, graph, index-health, or detect-duplicates commands to get machine-readable output that is easy to parse programmatically. When --json is active, stdout is reserved for JSON; human progress and warnings go to stderr.

Use sensegrep --version to confirm the installed CLI version.

When to Use

  • sensegrep search: Finding functions/classes by behavior, exploring structure, semantic queries, multi-criteria searches
  • sensegrep literal: Exact strings and regex proof; add --filesystem when the evidence universe must not depend on the index
  • grep/ripgrep: Fallback only when Sensegrep is unavailable or custom raw filesystem behavior is required

Routing rule: Start with sensegrep search whenever the task asks where or how behavior is implemented, even if the request contains candidate keywords. Use sensegrep literal only when the text or regex is already known, every textual occurrence is required, or you are verifying/refining a semantic result. If unsure, choose sensegrep search.

Local execution and evidence quality

  • On Windows PowerShell, use sensegrep.cmd if execution policy blocks npm's sensegrep.ps1 wrapper. No policy change is needed.
  • For local embeddings, set provider: "ollama", embedModel: "qwen3-embedding:0.6b", embedDim: 1024, and baseUrl: "http://127.0.0.1:11434" in ~/.config/sensegrep/config.json. Confirm the resolved provider with selftest; environment and CLI overrides can take precedence.
  • Use incremental index --no-watch for normal updates. A missing index warrants indexing; a known text lookup does not.
  • Start conceptual searches with a domain or framework when known (for example, "Clerk session token refresh"). If results are weak, reformulate before raising the result limit. Avoid premature kind filters: a business rule may live in a helper rather than a framework mutation.
  • Follow relevant result IDs with show, then verify claims in source. confidence is a ranking heuristic, not a calibrated probability that a result answers the question.
  • If context reports status: "incomplete" or retrieval.truncated, inspect selected IDs and expand missing evidence with show; a small token budget can omit an important file.
  • graphCoverage measures resolved edges divided by resolved, unresolved, and ambiguous edges considered by the graph. It is not recall against every real reference in the repository. Use compiler-aware tools before refactoring when completeness matters.
  • Report CLI wall time separately from internal search timings. Do not attribute process startup time to the embedding model.
  • benchmark measures provider request concurrency, not index worker concurrency or Ollama server slots. Sequential adapters (including native Ollama) report a baseline without a recommendation; an OpenAI-compatible sample fitting in one HTTP batch also cannot compare concurrency. On older versions, disregard Ollama concurrency recommendations.
  • Index plans distinguish internal estimatedBatches/batchSize from estimated HTTP requests. Ollama exposes httpBatchSize; request estimates exclude retries, and dry-run estimates may overstate work when vectors will be reused.

Read the full file on GitHub · 477 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 26d ago Changed · +26 lines 1a140c6d7aa0
  2. 1mo ago First seen · 451 lines · 50 tokens per session scan A 02779e82f302

Subscribe to this mod's changes

sensegrep-cli is a skill published in the GitHub repository Stahldavid/sensegrep (1 stars, last pushed 4d ago), licensed Apache-2.0. It adds 50 tokens to every session and 6,320 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ast-grep

Write, debug, and validate ast-grep structural code search rules. Use for syntax-aware code search, AST pattern matching, structural refactor discovery, or searches plain text tools like rg can miss — functions with particular descendants, calls inside specific contexts, decorators, or other Tree-sitter-backed…

bahayonghang/my-ai-cli-toolkit · 76 tokens

semhood

Use semantic code search before reading files. Find relevant chunks by intent (e.g. "where is auth handled?") via the semhood MCP server, then read only what's needed.

AhmeedGamil/semhood · 40 tokens

ccc

This skill should be used when code search is needed (whether explicitly requested or as part of completing a task), when indexing the codebase after changes, or when the user asks about ccc, cocoindex-code, or the codebase index. Trigger phrases include 'search the codebase', 'find code related to', 'update the…

cocoindex-io/cocoindex-code · 80 tokens

x-ray

Deep codebase exploration using semantic search and relationship mapping. Use when you need to understand the current codebase.

bartolli/codanna · 25 tokens

tree-sitter-language-pack-extracting-code-structure

Use when the user wants structured code metadata from a source file — functions, classes, imports, exports, symbols, docstrings, comments, or syntax diagnostics. Covers ts-pack process feature flags, the JSON result shape, and the default feature set.

xberg-io/tree-sitter-language-pack · 52 tokens

tree-sitter-language-pack-parsing-source

Use when the user wants a tree-sitter syntax tree for a source file — an s-expression dump or JSON tree. Covers ts-pack parse, language auto-detection vs --language, stdin input, and reading haserrors.

xberg-io/tree-sitter-language-pack · 48 tokens