Skip to main content
command CX Codex

route-research-for-testing — Claude Code command: test API routes

route-research-for-testing is a Claude Code command that collects changed routes from the current session and tests them via cURL to check edited API endpoints.

MIT ★ 10,055 updated 2026-07-13

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/route-research-for-testing.md
Open on GitHub

What route-research-for-testing does

The command scans .claude/tsc-cache logs for edited files, extracts those in /routes/, merges them with user-provided paths, and deduplicates. It resolves route prefixes by reading your app entry point (src/app.ts, src/server.ts, or similar). For each route, it builds a JSON record with path, HTTP method, expected request and response shapes, plus valid and invalid payload examples. Then it tests each route via cURL: sends a request with the right method and body, collects status codes and response shape, flags errors.

Requires a running dev server on localhost. You must know the port your app listens on and provide it when running tests.

What it helps with

  • collect changed routes from the current session into one list
  • merge auto-detected routes with user-provided paths
  • test API endpoints with different HTTP methods and payloads
  • generate a test report with status codes and errors

Example prompts for the agent

  • Test all routes you edited in this session
  • Test routes from /api/users and /api/posts
  • Run tests with extra paths /custom/endpoint

How to install route-research-for-testing

Manually: put the files in place

.claude/commands/route-research-for-testing.md

Call it with /route-research-for-testing. For all projects use ~/.claude/commands/

Questions about route-research-for-testing

How do I install route-research-for-testing in Claude Code?

Copy .claude/commands/route-research-for-testing.md from diet103/claude-code-infrastructure-showcase into your project's .claude/commands folder.

What does route-research-for-testing do?

It identifies routes you changed in this session, generates test cases for each, and runs them via cURL. Returns status codes and any errors found.

What tools does this command need?

Uses cat, awk, grep, sort, xargs, and sed. Your dev server must be running on localhost; you provide the port.

Source text

route-research-for-testing.md · MIT
---
description: Map edited routes & launch tests
argument-hint: "[/extra/path …]"
allowed-tools: Bash(cat:*), Bash(awk:*), Bash(grep:*), Bash(sort:*), Bash(xargs:*), Bash(sed:*)
model: sonnet
---

## Context

Changed route files this session (auto-generated):

!cat "$CLAUDE_PROJECT_DIR/.claude/tsc-cache"/\*/edited-files.log \
 | awk -F: '{print $2}' \
 | grep '/routes/' \
 | sort -u

User-specified additional routes: `$ARGUMENTS`

## Your task

Follow the numbered steps **exactly**:

1. Combine the auto list with `$ARGUMENTS`, dedupe, and resolve any prefixes
   defined in your API entry point (e.g. `src/app.ts`, `src/server.ts`, or
   wherever routes are registered).
2. For each final route, output a JSON record with the path, method, expected
   request/response shapes, and valid + invalid payload examples.
3. **Now test each route** using cURL or your project's test script:

```bash
# For each route, test with appropriate method and payload
curl -X GET http://localhost:<YOUR_PORT>/api/route-path
curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' http://localhost:<YOUR_PORT>/api/route-path
```

Substitute `<YOUR_PORT>` with your project's actual dev server port.

Report results for each route: status code, response shape, and any errors found.

© diet103 · MIT · diet103/claude-code-infrastructure-showcase

Similar slash commands

All slash commands for Testing and QA →

From the same set16

The whole set →
verify-setup verify-setup — a command that diagnoses your project's infrastructure, identifies what's broken, and guides you through fixes. Use it when Claude Code hooks, dependencies or configs fail. CX Codex +1 ★ 10,055repo stars source-command-verify-setup source-command-verify-setup executes infrastructure health checks and repairs broken configurations or hook dependencies. CX Codex +1 ★ 10,055repo stars dev-docs-update The dev-docs-update command records active work before a context reset, covering task files, project memory, unfinished work, and handoff notes. CX Codex +1 ★ 10,055repo stars dev-docs dev-docs generates a detailed implementation plan for any task: analyzes your codebase, breaks work into phases, creates task checklists with dependencies and effort estimates, and persists across context switches. CX Codex +1 ★ 10,055repo stars auto-error-resolver auto-error-resolver is a subagent that fixes TypeScript compilation errors from hook reports and verifies the build with tsc. CX Codex ★ 10,055repo stars frontend-error-fixer The frontend-error-fixer subagent investigates frontend failures during builds and in the browser. Use it for TypeScript, React, network, and rendering problems. CX Codex ★ 10,055repo stars refactor-planner refactor-planner — a subagent that studies your code structure and writes a phased refactoring plan with risk assessment. Use it before reworking a legacy module or an oversized component. CX Codex ★ 10,055repo stars plan-reviewer plan-reviewer reviews technical plans, migrations, and system integrations before writing code. Catches architectural traps, missing dependencies, and edge cases early. CX Codex ★ 10,055repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open