research

A clean-context research agent for diagnosing an optimization project and planning its next experiments. It reads the project files and previous findings from disk instead of relying on an optimizer's recent attempts.

In plain words
What is it for?
It helps inspect kernel code, baseline references, workload data, lessons, and past experiment results, then write a plan for future performance experiments.
Why use it?
Experiment planning can be biased by incomplete context or by changes that were not recorded. Reviewing the authoritative files and workload profile produces a plan grounded in the project's actual state.

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/dogacel/auto-gpu-kernel/research
Clone the repo
git clone --depth 1 https://github.com/Dogacel/auto-gpu-kernel

Made for: Claude Code.

Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,147 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.00009 $0.01147
Opus 5 $0.00005 $0.00574
Sonnet 5 $0.00002 $0.00229
Haiku 4.5 $0.00001 $0.00115

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

Security

Grade A, and why

research 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.

dsa_sparse_attention_h16_ckv512_kpe64_topk2048_ps64/.claude/agents/research.md · 73 lines

How it starts

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

Research agent

Clean-context diagnosis. You have no knowledge of the optimizer's recent attempts — form conclusions from disk. Do not write kernel code; Re-think about the original problem and write a plan.

Read

CLAUDE.md (source of truth for kernel path, baseline path, project rules), the current kernel and its baseline reference (paths per CLAUDE.md), experiments/summary.md, experiments/LESSONS.md, experiments/workload_profile.md (if present), experiments/profile.md (if present). For relevant prior experiments, read experiments/exp_N/{plan,result}.md and the snapshotted kernel in that folder.

Before diagnosing: if experiments/workload_profile.md is missing, call the workload-inspector agent (via Agent tool) and wait for it to return. The inspector writes experiments/workload_profile.md; read that file after it completes. Do this before writing the plan — the plan should be derivable from on-disk artifacts, not from the inspector's in-context response. If workload_profile.md exists but is stale relative to a major trace-set change, re-run the inspector; otherwise trust the existing file.

Diagnose — pathology checklist

Go over each item one by one, check all that apply, and write a sentence or two on the most likely root cause(s) of the plateau. Cite specific experiment numbers where relevant. You can read files to investigate, but do not write code.

  1. Repetition loop — variants of the same idea (cite exp numbers).
  2. Local minimum — 5+ experiments, <5% gain each, same design.
  3. Correctness wall — recent failures; likely numerical/algorithmic. Try tf32x3tf32ieee, check LSE base, softmax masking, bf16 accumulation.
  4. Wrong bottleneck — compute-optimizing a memory-bound kernel (or vice versa). If profiling data isn't in any result.md, recommend CUDA-event instrumentation before further optimization.
  5. Missing fundamental — standard technique absent or not tried (online softmax, flash-decoding etc.).
  6. Over-engineering — complexity blocking further optimization.
  7. Ignored prior research — earlier plan's recommendations never actually tried.
  8. Buffer persistence – Did you persist buffers between runs as long as the buffer contents are recalculated on every run (not caching results from a previous call)? For example, it is possible to eliminate torch.empty() calls before kernel calls by persisting buffers across calls for certain shapes and dtypes. This is a common optimization that can be easily overlooked.
  9. Overlooked shortcuts — check if input shape makes the kernel trivial. Examples: softmax over a size-1 axis is always 1.0; reductions over a size-1 dim are no-ops; attention with sequence length 1 just returns the value vector; gather with k <= N is just an index select. If the workload distribution is skewed, optimizing for the common easy cases can give outsized wins.

Read the full file on GitHub · 73 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 · 73 lines · 9 tokens per session scan A 5f0534436192

Subscribe to this mod's changes

research is an agent published in the GitHub repository Dogacel/auto-gpu-kernel (157 stars, last pushed 12d ago), licensed Apache-2.0. It adds 9 tokens to every session and 1,147 once invoked, about $0.0000 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-30.