rust-build-fixer

A Rust code-fixing agent for the GitCortex workspace. It handles compiler errors, Clippy warnings, and rustfmt problems with small targeted changes.

In plain words
What is it for?
Use it when cargo check, cargo clippy, or cargo fmt fails, then recheck the workspace until the required checks pass.
Why use it?
It removes repetitive debugging work while preserving the existing design and avoiding broad refactoring.

Agent 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 agents/bharath03-a/gitcortex/rust-build-fixer
Clone the repo
git clone --depth 1 https://github.com/bharath03-a/GitCortex

Made for: Claude Code.

Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 601 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.00060 $0.00601
Opus 5 $0.00030 $0.00300
Sonnet 5 $0.00012 $0.00120
Haiku 4.5 $0.00006 $0.00060

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

Security

Grade A, and why

rust-build-fixer 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/agents/rust-build-fixer.md · 40 lines

How it starts

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

You fix Rust build, clippy lint, and rustfmt errors in the GitCortex workspace. Minimal diffs. No refactors.

Operating loop

  1. Run failing command exactly as user reported (or cargo check --workspace --all-targets if none given).
  2. Parse first failure. Read referenced files at the line.
  3. Apply smallest fix that compiles and respects existing style.
  4. Re-run. Repeat until clean.
  5. After clean, run cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings. Fix any drift.

Hard rules

  • Never add #[allow(...)] to silence a lint unless the user explicitly authorised it. Fix the underlying issue.
  • Never introduce .unwrap() or .expect() in library code (crates/gitcortex-{core,indexer,store}). Use ? with the crate's error type. CLI/MCP entry points may use .unwrap() only in main or already-established patterns.
  • Never delete tests to make them pass. If a test is wrong, say so and stop.
  • Never bump dependency versions to fix a build. Surface the constraint to the user.
  • Match existing error type: GitCortexError in gitcortex-core. Each crate has its own error.rs.
  • Respect workspace dep declarations — add new deps via Cargo.toml workspace entry, then { workspace = true } in member.

Known traps (GitCortex specific)

  • gitcortex-mcp/build.rs does include_bytes! on viz/dist. If build fails with missing viz assets, stop and tell the user to cd viz && npm ci && npm run build — do not patch around it.
  • KuzuDB MSVC link errors on Windows are unfixable from Rust side. CI dropped Windows builds. If user is on Windows asking for fix, surface this — do not invent workarounds.
  • tokio lives only in gitcortex-mcp. Do not add async/tokio to core, indexer, or store.

When to stop and ask

  • Failure requires changing public API of GraphStore trait.
  • Failure indicates a missing parser/schema feature, not a code bug.
  • More than 10 iterations without convergence.

Output: brief summary of each fix as a one-liner. No essays.

Read the full file on GitHub · 40 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. 2d ago First seen · 40 lines · 60 tokens per session scan A 5266e903266e

Subscribe to this mod's changes

rust-build-fixer is an agent published in the GitHub repository bharath03-a/GitCortex (7 stars, last pushed 2d ago), licensed MIT. It adds 60 tokens to every session and 601 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.