sensegrep-cli

sensegrep-cli is a skill for Claude Code, Codex from Stahldavid/sensegrep. It costs 50 tokens per session (5,420 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

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.

agentmods
npx agentmods add skills/stahldavid/sensegrep/sensegrep-cli
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.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.svg" alt="Measured on agentmods" 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 5,420 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00050 $0.05420
Opus 5 $0.00025 $0.02710
Sonnet 5 $0.00010 $0.01084
Haiku 4.5 $0.00005 $0.00542

Measured 4d ago against content hash 02779e82f302, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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 · 451 lines

How it starts

The opening of the file, as written. The whole thing — 451 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.

Start with these defaults and adjust based on what you find:

Goal --limit --max-per-file Notes
Focused search (know what you want) 10 (default) 1 Tight, clean tree-shaking output
General exploration 20 2 Balanced — visibly better file coverage than limit=10
Broad discovery (large codebase) 20 3 Diminishing returns beyond 3; max-per-file=5 rarely adds value

Read the full file on GitHub · 451 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. 4d 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 19d ago), licensed Apache-2.0. It adds 50 tokens to every session and 5,420 once invoked, about $0.0003 per session on Opus 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 · 64 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

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

repomix

Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.

yamadashy/repomix · 58 tokens

grepai

Semantic code search and call-graph tracing. Use for intent questions ('where is authentication handled?'), exploring unfamiliar code, or tracing callers/callees — as a ranking layer on top of exact-match Grep, not a replacement for it.

yoanbernabeu/grepai · 52 tokens

gitnexus-exploring

Navigate unfamiliar code using GitNexus knowledge graph.

doobidoo/mcp-memory-service · 16 tokens