codesynapse-cli

เครื่องมือบรรทัดคำสั่งที่เก็บแผนผังความสัมพันธ์ของโค้ด เช่น ฟังก์ชันที่เรียกหากัน คลาสที่สืบทอดกัน และตำแหน่งไฟล์

In plain words
What is it for?
ใช้ค้นหาว่าโค้ดส่วนใดทำงานอะไร ติดตามผู้เรียกและผู้ถูกเรียก หาเส้นทางระหว่างส่วนต่าง ๆ และประเมินว่าส่วนใดอาจได้รับผลกระทบจากการเปลี่ยนแปลง
Why use it?
ช่วยตอบคำถามเกี่ยวกับโครงสร้างโปรแกรมและการไหลของคำขอได้ตรงกว่าการค้นหาข้อความในไฟล์เพียงอย่างเดียว

Cursor rule

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 rules/sohilladhani/codesynapse/codesynapse-cli
Clone the repo
git clone --depth 1 https://github.com/sohilladhani/codesynapse
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,032 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.00000 $0.01032
Opus 5 $0.00000 $0.00516
Sonnet 5 $0.00000 $0.00206
Haiku 4.5 $0.00000 $0.00103

Measured yesterday against content hash e3057cf06e0e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codesynapse-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 yesterday.

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.

integrations/cursor/rules/codesynapse-cli.mdc · 100 lines

How it starts

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

Codesynapse CLI

Codesynapse has pre-indexed this codebase into a knowledge graph that knows about classes, functions, their relationships (calls, extends, implements), and source locations. The graph is more precise than grep for architecture questions.

MCP may not be available. All codesynapse commands run via bash terminal (Cmd+J / Ctrl+J). Use the codesynapse binary — if not found, try /usr/local/bin/codesynapse then ~/.local/bin/codesynapse (the two standard install locations). The project graph is at ./codesynapse-out/graph.json. Run codesynapse module list to see all indexed modules.

Use codesynapse CLI commands before grep/find for architecture questions.

Quick Reference

Intent Command
General codebase query codesynapse query "<question>" --graph <path>
Node details + relationships codesynapse explain <id> --path <graph-path>
Shortest path A → B codesynapse path <A> <B>
Blast radius of X codesynapse affected <X> --graph <path> --depth 2
Graph statistics codesynapse stats <path>
God/central nodes codesynapse analyze <path>
Community detection codesynapse cluster <path>
Module list codesynapse module list
Graph diff codesynapse diff <path> --baseline <other>

Decision Tree

STEP 1 — Architecture questions ("how does X work", "what handles Y", "where is Z defined"):

codesynapse query "<question>" --graph ./codesynapse-out/graph.json

STEP 2 — Need details on a specific node:

codesynapse explain <ClassName> --path ./codesynapse-out/graph.json

STEP 3 — Blast radius / change impact:

codesynapse affected <ClassName> --graph ./codesynapse-out/graph.json --depth 2

STEP 4 — Dependency tracing / request flow:

codesynapse path <FromClass> <ToClass>

STEP 5 — Module ownership:

codesynapse query "<concept>" --graph ./codesynapse-out/graph.json
# Check file paths in results

Read the full file on GitHub · 100 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. yesterday First seen · 100 lines · 0 tokens per session scan A e3057cf06e0e

Subscribe to this mod's changes

codesynapse-cli is a cursor rule published in the GitHub repository sohilladhani/codesynapse (8 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,032 tokens. 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.