Agent skill

Table State

by octanejs in octanejs/octane

Read, select, subscribe to, and control React Table V9 state with useTable selectors, table.state, table.Subscribe, table.atoms, table.store, and external TanStack Store atoms.

MITAuto-check passedDevelopment

Install Table State

skills CLI
$ npx skills add octanejs/octane --skill table-state -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install octanejs/octane table-state --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/octanejs/octane.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/tanstack-table/upstream/skills/table-state .claude/skills/table-state && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
table-state
GitHub stars
1.4k
Token cost
~2.2k tokens
SKILL.md length
695 words
Files
1
Skills in repo
18
Repo updated
First seen
Licence
MIT

At a glance

Read, select, subscribe to, and control React Table V9 state with useTable selectors, table.state, table.Subscribe, table.atoms, table.store, and external TanStack Store atoms.

  • Works in 4 steps: Use internal state by default and call… → Use initialState. only to set the… → Prefer a stable external atom in atoms.… → …
  • Development work in your project
  • SKILL.md covers State Mental Model, Setup, Core Patterns and Choose State Ownership, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Table State is an agent skill from octanejs/octane. Read, select, subscribe to, and control React Table V9 state with useTable selectors, table.state, table.Subscribe, table.atoms, table.store, and external TanStack Store atoms. Load for controlled state, render performance, or React Compiler builder-method subscription problems.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with React and TanStack. The repository describes itself as: React’s programming model, compiled. The successor to Inferno. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/table-state”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Use internal state by default and call feature APIs such as table.setSorting, table.nextPage, column.toggleVisibility, or…
  2. Use initialState. only to set the starting and reset value. Changing initialState later does not reset the table.
  3. Prefer a stable external atom in atoms. when Table, Query, routing, or another component must share the slice. Table APIs write that atom…
  4. Use state. plus its matching on[State]Change for simple React-controlled state or Table V8-style integrations. Always resolve both raw…

What it can do on your machine

Read from SKILL.md and the folder at commit 40fdefd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Table State loads about 2.2k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 695 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from octanejs/octane at commit 40fdefd, republished under its MIT licence (© octanejs). 695 words, ~2,187 tokens.

Download SKILL.mdSave it as .claude/skills/table-state/SKILL.md (or your agent's skills folder).
name
table-state
description
Read, select, subscribe to, and control React Table V9 state with useTable selectors, table.state, table.Subscribe, table.atoms, table.store, and external TanStack Store atoms. Load for controlled state, render performance, or React Compiler builder-method subscription problems.
metadata.type
framework
metadata.library
@tanstack/react-table
metadata.library_version
9.2.4
metadata.framework
react
requires
@tanstack/table-core#core, getting-started
sources
TanStack/table:docs/framework/react/guide/table-state.md, TanStack/table:docs/framework/react/guide/react-compiler.md…

This skill builds on @tanstack/table-core#core and getting-started. Read them first for table construction and feature-owned state.

State Mental Model

TanStack Table is primarily a state coordinator. Keep state internal unless another subsystem needs to read, persist, validate, or drive it. With no initialState, atoms, state, or on[State]Change options, the table owns all registered slices.

  • table.baseAtoms are the internal writable atoms initialized from resolved initial state.
  • table.atoms are readonly derived atoms for the active owner of each registered slice.
  • table.store combines those atoms into one readonly flat store.
  • table.state is only the value selected by the second useTable argument.

State is feature-based. Registering rowPaginationFeature creates pagination state and APIs; without it, pagination must not exist in initialState, state, atoms, table.atoms, table.store, or table.state. Treat a missing state API as a likely missing feature import, not a typing problem.

Keep features, data, and columns stable. State subscriptions do not compensate for new model-input references on every render.

Setup

tsx
import {
  rowSelectionFeature,
  tableFeatures,
  useTable,
} from '@tanstack/react-table'

const features = tableFeatures({ rowSelectionFeature })

export function SelectionCount({
  data,
  columns,
}: {
  data: Array<{ id: string }>
  columns: any[]
}) {
  const table = useTable({ features, data, columns }, (state) => ({
    rowSelection: state.rowSelection,
  }))
  return <output>{Object.keys(table.state.rowSelection).length}</output>
}

The optional selector controls which state changes rerender the component and which selected fields appear on table.state. Omitting it selects all registered slices.

Core Patterns

Subscribe at the expensive boundary
tsx
function SelectedRows({
  table,
}: {
  table: ReturnType<typeof useTable<typeof features, { id: string }>>
}) {
  return (
    <table.Subscribe selector={(state) => state.rowSelection}>
      {(rowSelection) => <output>{Object.keys(rowSelection).length}</output>}
    </table.Subscribe>
  )
}

At a top-level component holding the adapter's table instance, table.Subscribe selects from table.store. Use this after measuring or when the React Compiler cannot see state reads hidden behind table builder methods.

Control a slice with an external atom
tsx
import { useCreateAtom } from '@tanstack/react-store'

const selection = useCreateAtom<Record<string, boolean>>({})
const table = useTable({
  features,
  columns,
  data,
  atoms: { rowSelection: selection },
})

An external atom is both ownership and subscription source; it avoids value-or-updater glue.

Control a slice with React state
tsx
const [rowSelection, setRowSelection] = useState<Record<string, boolean>>({})
const table = useTable({
  features,
  columns,
  data,
  state: { rowSelection },
  onRowSelectionChange: setRowSelection,
})

Choose State Ownership

Choose exactly one owner for each slice:

  1. Use internal state by default and call feature APIs such as table.setSorting, table.nextPage, column.toggleVisibility, or row.toggleSelected.
  2. Use initialState.<slice> only to set the starting and reset value. Changing initialState later does not reset the table.
  3. Prefer a stable external atom in atoms.<slice> when Table, Query, routing, or another component must share the slice. Table APIs write that atom directly; do not also add on[State]Change.
  4. Use state.<slice> plus its matching on[State]Change for simple React-controlled state or Table V8-style integrations. Always resolve both raw values and updater functions.

External atoms take precedence over external state; external state synchronizes into the internal base atom. Do not declare the same slice in multiple ownership options and rely on precedence as application logic. The global Table V8 onStateChange callback is gone in Table V9; control slices individually or subscribe to table.store to observe all state.

Show full SKILL.md (299 more words)Show less

Initialize, Update, and Reset

Prefer feature methods over direct atom writes because feature methods preserve related behavior. table.baseAtoms.pagination.set(...) is a low-level escape hatch only for internally owned state; write the supplied external atom when atoms.pagination owns the slice.

Feature reset methods reset to table.initialState by default:

tsx
table.resetSorting()
table.resetPagination()
table.resetPagination(true) // feature blank/default state

Slice reset methods flow through that feature's updater and can update an external owner. Core table.reset() resets internal base atoms, so it is not the primary reset mechanism for externally owned atoms.

Use feature-specific types for owned slices and infer the full state from the feature set:

tsx
import type { PaginationState, TableState } from '@tanstack/react-table'

type AppTableState = TableState<typeof features>
const initialPagination: PaginationState = { pageIndex: 0, pageSize: 20 }

Common Mistakes

HIGH Treating a snapshot as subscription

Wrong:

tsx
const count = Object.keys(table.atoms.rowSelection.get()).length

Correct:

tsx
const count = Object.keys(table.state.rowSelection).length

atoms.*.get() and table.store.state return current values but do not subscribe a React render.

Source: packages/react-table/src/useTable.ts

HIGH Supplying only the change callback

Wrong:

tsx
const table = useTable({
  features,
  columns,
  data,
  onRowSelectionChange: setRowSelection,
})

Correct:

tsx
const table = useTable({
  features,
  columns,
  data,
  state: { rowSelection },
  onRowSelectionChange: setRowSelection,
})

Once a callback takes ownership, the corresponding controlled value must be written back.

Source: docs/framework/react/guide/table-state.md

HIGH Hiding builder reads from the React Compiler

Wrong:

tsx
function SelectionCell({ row }) {
  return (
    <input
      type="checkbox"
      checked={row.getIsSelected()}
      onChange={row.getToggleSelectedHandler()}
    />
  )
}

Correct:

tsx
import { Subscribe } from '@tanstack/react-table'

function SelectionCell({ row }) {
  return (
    <Subscribe
      source={row.table.atoms.rowSelection}
      selector={(selection) => selection[row.id]}
    >
      {(selected) => (
        <input
          type="checkbox"
          checked={!!selected}
          onChange={row.getToggleSelectedHandler()}
        />
      )}
    </Subscribe>
  )
}

With the default selector, useTable returns a fresh React-facing table reference on state changes. The remaining hazard is a nested component receiving only a stable core table, row, cell, column, or header object and hiding a state read behind one of its methods. Keep Subscribe inside that component, or pass its selected value to the child as a changing prop. An outer Subscribe that ignores the selected value is not enough.

Inside cell and header render contexts, table is typed as core Table, so import standalone Subscribe. Use source={table.store} with a selector for multiple slices, or a specific atom for the narrowest boundary.

Source: docs/framework/react/guide/react-compiler.md

MEDIUM Optimizing every cell preemptively

Wrong:

tsx
<table.Subscribe source={table.atoms.rowSelection}>
  {() => <Cell cell={cell} />}
</table.Subscribe>

Correct:

tsx
<Cell cell={cell} />

Default useTable state selection is the simpler starting point; introduce fine-grained boundaries where measurement or compiler behavior justifies them.

Source: docs/framework/react/guide/table-state.md

API Discovery

Inspect node_modules/@tanstack/react-table/dist/useTable.d.ts and Subscribe.d.ts. Core atom precedence and state slices live under node_modules/@tanstack/table-core/dist/.

© octanejs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in packages/tanstack-table/upstream/skills/table-state of octanejs/octane.

Open the folder on GitHubat commit 40fdefd

Compare with similar skills

Table State next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Table State compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Table State this skilloctanejs/octane1.4k—~2.2kAutomated safety check: PassMIT
Wagmi Feature Developmentwevm/wagmi6.8k—~3.8kAutomated safety check: PassMIT
Cleanup Specialistahaodev/shadmin174—~1.3kAutomated safety check: PassMIT
Tanstack Router Best PracticesDeckardGer/tanstack-agent-skills222—~1.1kAutomated safety check: PassMIT
Tanstack Routerbskimball/tanstack-hono119—~4.4kAutomated safety check: PassMIT
New React PlaygroundTanStack/ai3.2k—~266Automated safety check: NotesMIT

Similar skills

  • Walks through adding a Wagmi feature across its layers: a Viem-based core action, TanStack Query options, and React and Vue bindings.

    6.8k GitHub stars~3.8k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Cleanup Specialist

    ahaodev/shadmin

    Safe cleanup of Shadmin's Go backend, React frontend, Go CLI, and docs — remove dead code, consolidate duplication, and improve maintainability without changing behavior or adding features.

    174 GitHub stars~1.3k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Tanstack Router Best Practices

    DeckardGer/tanstack-agent-skills

    TanStack Router best practices for type-safe routing, data loading, search params, and navigation.

    222 GitHub stars~1.1k tokensUpdated 29 days ago
    DevelopmentAuto-check passed
  • Tanstack Router

    bskimball/tanstack-hono

    Type-safe routing for React and Solid applications with first-class search params, data loading, and seamless integration with the React ecosystem.

    119 GitHub stars~4.4k tokensUpdated 27 days ago
    DevelopmentAuto-check passed
  • A skill your agent uses when an agent in this TanStack AI monorepo needs a playground app to try a new feature.

    3.2k GitHub stars~266 tokensUpdated today
    DevelopmentAuto-check: notes
  • Tanstack Start

    secondsky/claude-skills

    TanStack Start (RC) full-stack React with server functions, SSR, Cloudflare Workers.

    227 GitHub stars~1.6k tokensUpdated 10 days ago
    DevelopmentAuto-check: notes

More from octanejs/octane

All 18 skills in this repo
  • Performance Audit

    octanejs/octane

    Audit or defend Octane performance. An agent skill from octanejs/octane.

    1.4k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Update Bindings

    octanejs/octane

    Audit one, several, or all existing Octane bindings; implement selected maintenance findings or remove redundant copied files with evidence matched to source ownership.

    1.4k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Handle Issue

    octanejs/octane

    Work a GitHub issue in the octane repo. An agent skill from octanejs/octane.

    1.4k GitHub stars~638 tokensUpdated today
    Auto-check passed
  • Migrate V8 To V9

    octanejs/octane

    Perform a complete @tanstack/react-table v8-to-v9 migration: hook and feature architecture, row-model slots, React state and subscriptions, rendering, composable tables, type helpers, and every…

    1.4k GitHub stars~4.7k tokensUpdated today
    Auto-check passed
  • Implement and verify new React-library ports or copied/rewritten React surfaces in Octane bindings from npm names or npm/GitHub links/lists.

    1.4k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Triage

    octanejs/octane

    Work out which part of the octane monorepo owns an unfamiliar failure or task.

    1.4k GitHub stars~374 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Table State

What does Table State do?

Read, select, subscribe to, and control React Table V9 state with useTable selectors, table.state, table.Subscribe, table.atoms, table.store, and external TanStack Store atoms. Table State is an agent skill from octanejs/octane.store, and external TanStack Store atoms.

When should I use Table State?

Table State fits situations like: development work in your project.

How do I install Table State in Claude Code?

Run `npx skills add octanejs/octane --skill table-state -a claude-code`. Or copy the skill folder (packages/tanstack-table/upstream/skills/table-state in octanejs/octane) into .claude/skills/table-state in your project. Claude Code loads it when a task matches its description.

How do I install Table State in Codex?

Run `npx skills add octanejs/octane --skill table-state -a codex`. Or copy the skill folder (packages/tanstack-table/upstream/skills/table-state in octanejs/octane) into .agents/skills/table-state in your project. Codex loads it when a task matches its description.

Can I use Table State in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add octanejs/octane --skill table-state -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/table-state, .gemini/skills/table-state, .github/skills/table-state and .opencode/skills/table-state in your project.

What does Table State need to run?

SKILL.md names no scripts, command-line tools or credentials: Table State is instructions for the agent only.

Does Table State access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Table State safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Table State use?

Table State is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Table State use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Table State?

Skills that share tags, products or a category with Table State: Wagmi Feature Development (wevm/wagmi, 6.8k stars), Cleanup Specialist (ahaodev/shadmin, 174 stars), Tanstack Router Best Practices (DeckardGer/tanstack-agent-skills, 222 stars) and Tanstack Router (bskimball/tanstack-hono, 119 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Table State?

octanejs (a GitHub organization) maintains it in octanejs/octane, which has 1,450 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on October 8, 2026.

Source: octanejs/octane on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.