gcx-self

A self-check command for the GitCortex repository, which is a codebase indexed as a searchable graph. It installs the local command-line tool, indexes the repository, and runs sample searches.

In plain words
What is it for?
Use it after building GitCortex or changing its indexing and query features. It checks version consistency, repository indexing, symbol lookup, callers, and definitions.
Why use it?
It verifies that the locally built tool works against its own source code. It also exposes installation errors or searches that unexpectedly return no results.

Command for Claude Code

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 commands/bharath03-a/gitcortex/gcx-self
Clone the repo
git clone --depth 1 https://github.com/bharath03-a/GitCortex

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 299 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.00299
Opus 5 $0.00000 $0.00150
Sonnet 5 $0.00000 $0.00060
Haiku 4.5 $0.00000 $0.00030

Measured 2d ago against content hash 46a831c29c30, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gcx-self 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 2d 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.

.claude/commands/dev/gcx-self.md · 24 lines

What it actually says

Dogfood GitCortex on its own repo. Installs the local gcx binary, indexes this workspace, and prints a sanity tour.

Steps:

  1. Build and install from source: cargo install --path crates/gitcortex-cli --force

  2. Confirm version: gcx --version matches Cargo.toml workspace version.

  3. If .git/hooks/post-commit does not contain gcx hook, run gcx init in the repo root. Otherwise skip (already initialised).

  4. Force a full index of current branch: gcx hook --force (or equivalent reindex flag — check gcx hook --help)

  5. Smoke queries:

    • gcx query tour --limit 5 — top 5 centrality symbols
    • gcx query lookup-symbol GraphStore — should find the trait
    • gcx query find-callers apply_diff — should list parser/indexer callers
    • gcx query list-definitions crates/gitcortex-core/src/schema.rs
  6. Report: index path (~/.local/share/gitcortex/...), branch indexed, node/edge count if surfaced, any query that returned empty unexpectedly.

If install fails, surface the cargo error and offer rust-build-fixer. If a query returns empty when it shouldn't, that's a real bug — report as a finding, don't paper over it.

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. 2d ago First seen · 24 lines · 0 tokens per session scan A 46a831c29c30

Subscribe to this mod's changes

gcx-self is a command published in the GitHub repository bharath03-a/GitCortex (7 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 299 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.