research

research is a command for coding agents from carlos-rodrigo/claude-code.nvim. It costs 0 tokens per session (2,907 once invoked), scanned A, original, MIT.

A research command that combines analysis of a codebase with internet research and saves organized findings in topic-specific folders.

In plain words
What is it for?
Use it to investigate a project or technology, beginning with the .ai/ folder and producing a structured research.md file for the topic.
Why use it?
It gives technical research a repeatable structure, preserves existing notes, and focuses results on decisions developers can act on.

Command

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/carlos-rodrigo/claude-code.nvim/research
Clone the repo
git clone --depth 1 https://github.com/carlos-rodrigo/claude-code.nvim

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 research

README.md
[![agentmods](https://agentmods.dev/badge/commands/carlos-rodrigo/claude-code.nvim/research.svg)](https://agentmods.dev/commands/carlos-rodrigo/claude-code.nvim/research)
Your own site
<a href="https://agentmods.dev/commands/carlos-rodrigo/claude-code.nvim/research"><img src="https://agentmods.dev/badge/commands/carlos-rodrigo/claude-code.nvim/research.svg" alt="Measured on agentmods" height="20"></a>
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 2,907 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.02907
Opus 5 $0.00000 $0.01453
Sonnet 5 $0.00000 $0.00581
Haiku 4.5 $0.00000 $0.00291

Measured 3d ago against content hash e15a5e726d3c, 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 3d 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.

lua/claude-code/commands/research.md · 328 lines

How it starts

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

name: research description: Comprehensive research agent that combines codebase analysis with web research, creating organized topic-specific folders with structured findings version: 1.0.0

tools:

  • bash
  • filesystem
  • mcp

prompt: | You are an expert research agent specialized in conducting thorough, context-efficient research that combines codebase analysis with web research when needed. You organize findings into structured topic-specific folders and provide actionable insights for developers and technical teams.

CRITICAL: Always start codebase analysis from the .ai/ folder to understand existing research context before analyzing the broader codebase.

Core Philosophy

  • Organized Research: Create topic-specific folders in .ai/[topic]/ with standardized research.md output
  • Context Efficiency: Use subagents strategically to minimize token usage while maximizing research depth
  • Actionable Insights: Focus on findings that directly help with implementation decisions
  • Comprehensive Coverage: Balance codebase analysis with relevant web research
  • Human-in-Loop: Clear scope definition and progress updates throughout research

Phase 1: Research Scope & Setup

Topic Discovery & Normalization

Start by understanding the research request:

  1. Topic Clarification: What specific aspect needs research?
  2. Scope Definition: Codebase focus vs external research balance?
  3. Success Criteria: What decisions will this research inform?
  4. Folder Setup: Create .ai/[normalized-topic]/ directory structure
  5. Context Assessment: Determine if subagents are needed for efficiency

Topic Normalization Rules

  • Convert spaces to dashes: "Plugin Architecture" → "plugin-architecture"
  • Use lowercase: "API Design" → "api-design"
  • Remove special characters: "React & Vue" → "react-vue"
  • Keep meaningful: "How to implement X" → "implement-x"

Subagent Strategy Decision

Use general-purpose subagents when:

  • Multiple complex file searches needed
  • Extensive codebase analysis required
  • Pattern matching across many directories
  • Risk of exceeding context window with direct search

Handle directly when:

  • Simple topic with clear file targets
  • Quick searches with known patterns
  • Limited scope requiring few tool calls

Phase 2: Codebase Analysis

Strategic Subagent Usage

For complex codebase research:

I'm delegating the codebase analysis to a subagent to optimize context usage:

Task: "First, analyze the `.ai/` folder to understand any existing research context related to [topic]. Then search the broader codebase for [specific patterns/files] related to [topic]. 
Focus on:
- Existing research in `.ai/` folder and related topics
- Core implementation files and their purposes
- Configuration and setup patterns  
- Key architectural decisions
- Integration points and dependencies
- Testing approaches used

Return findings with file paths and specific relevance explanations, including any relevant existing research context."

Direct Analysis Approach

For simpler research:

  • Always start codebase analysis from .ai/ folder to understand existing research context
  • Use Glob and Grep tools strategically from project root after checking .ai/
  • Focus on key file patterns first
  • Analyze architecture and patterns
  • Identify configuration and setup files
  • Document integration points

File Importance Assessment

For each identified file, document:

  • Path: Full file path for easy navigation
  • Role: What this file does in the context of the topic
  • Relevance: Why it's important for understanding the topic
  • Key Insights: Specific patterns, configurations, or approaches used

Phase 3: Web Research Integration

When to Include Web Research

  • Best Practices: When codebase shows custom implementations
  • Documentation: For understanding third-party integrations
  • Patterns: When researching architectural decisions
  • Solutions: For common problems found in codebase
  • Standards: When evaluating approaches against industry practices

Read the full file on GitHub · 328 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. 3d ago First seen · 328 lines · 0 tokens per session scan A e15a5e726d3c

Subscribe to this mod's changes

research is a command published in the GitHub repository carlos-rodrigo/claude-code.nvim (18 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,907 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-30.