From harness-claude
Inspects cache state, query status, and network activity in the React Query DevTools panel. Debug refetches, verify mutation invalidation, and tune staleTime/gcTime.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:tanstack-devtoolsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Inspect cache state, query status, and network activity using the React Query DevTools panel
Inspect cache state, query status, and network activity using the React Query DevTools panel
staleTime, gcTime, and observer counts for performance tuning@tanstack/react-query-devtools as a dev dependency — never ship it to production accidentally.<ReactQueryDevtools> inside your QueryClientProvider — it mounts a floating panel in the browser.initialIsOpen={false} (default) to keep the panel collapsed at startup — it opens on demand via the TanStack logo button.buttonPosition to move the toggle button away from UI elements: 'top-left', 'top-right', 'bottom-left', 'bottom-right'.fresh, stale, fetching, paused), staleTime, gcTime, observer count, and cached data.// app/providers.tsx — QueryClientProvider with DevTools
'use client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { useState } from 'react';
export function QueryProvider({ children }: { children: React.ReactNode }) {
const [queryClient] = useState(() => new QueryClient({
defaultOptions: {
queries: { staleTime: 60 * 1000 },
},
}));
return (
<QueryClientProvider client={queryClient}>
{children}
{/* DevTools only loads in development — tree-shaken in production */}
<ReactQueryDevtools initialIsOpen={false} buttonPosition="bottom-right" />
</QueryClientProvider>
);
}
// Alternative: dynamic import to guarantee no production bundle impact
import dynamic from 'next/dynamic';
const ReactQueryDevtools =
process.env.NODE_ENV === 'development'
? dynamic(() =>
import('@tanstack/react-query-devtools').then(mod => ({
default: mod.ReactQueryDevtools,
}))
)
: () => null;
The React Query DevTools panel has three main areas:
Query panel (left sidebar): Lists all cached queries with color-coded status indicators. Green = fresh, yellow = stale, gray = inactive, blue = fetching, red = error. The number in parentheses is the observer count — how many components are currently subscribed to that query.
Query details (right panel): Clicking a query shows its full key, current status, staleTime, gcTime, last updated timestamp, observer count, and the raw cached data in an expandable JSON tree. This is the primary tool for debugging key mismatches and stale data issues.
Actions: Each query entry has actions: Refetch (triggers an immediate background refetch), Invalidate (marks stale and refetches active), Reset (removes cached data), and Remove (evicts from cache). These allow debugging cache behavior without modifying code.
Status meanings:
fresh: data is within staleTime — will not refetch on mountstale: staleTime expired — will refetch on next mount or window focusfetching: active network request in progresspaused: query is paused (offline or network issue)inactive: no components are subscribed — GC timer is runningerror: last fetch failedObserver count: An observer count of 0 means no component is mounted that uses this query — the GC timer is running. Once it hits 0 and gcTime expires, the entry is removed. Multiple observers on the same query means multiple components share one cache entry.
Production safety: @tanstack/react-query-devtools is automatically excluded from production builds when using Next.js or Vite's tree-shaking if imported conditionally. The process.env.NODE_ENV === 'development' guard ensures zero bundle impact.
https://tanstack.com/query/latest/docs/framework/react/devtools
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeManages server state with automatic caching, background refetching, pagination, infinite scrolling, and optimistic updates for React, Vue, Svelte, Angular apps.
Provides TanStack Query v5 reference for React data fetching, caching, server state management using useQuery/useMutation hooks, QueryClient setup, optimistic updates, Next.js SSR/hydration, testing, TypeScript, and advanced patterns.
Provides expertise in TanStack Query for React/Next.js data fetching, caching (staleTime/gcTime), mutations, optimistic updates, cache invalidation, and App Router SSR hydration.