Ask questions about your Span data from Claude Code or Cursor (/span:ask)

Last updated: November 12, 2026

The Span skill adds /span:ask to Claude Code and Cursor, so you can ask questions about your Span data in plain language from the coding assistant you already use.

Why it matters

  • For engineers and managers: you can check cycle time, PR throughput, deployments or AI adoption without leaving your editor or terminal.

  • For leaders and analysts: your assistant can pull Span numbers into the document, script or report you're already writing with it.

  • For admins: the skill uses Span's API with an ordinary API token, so the access it gets is exactly the access that token already has.

How it works

  • Local scripts, your token. The skill is a set of instructions and small shell scripts that run on your machine. The scripts call Span's Knowledge Graph API at api.span.app with the token you save in a local config file.

  • Answers follow the token's permissions. Every request runs as the token's owner. A Personal Access Token sees what you can see in Span. A service account token sees only what that service account can access.

  • It finds the right metric first. On first use the skill downloads a catalog of the data and metrics your token can reach and caches it locally. It then looks up the matching pre-built Span metric for your question instead of calculating its own.

  • It asks before guessing. If your question has no time range, the skill asks for one (it suggests the last 30 days). It also asks when the team, person or metric is unclear.

  • Two ways to start it. Type /span:ask followed by your question, or just ask a question about engineering data and the assistant uses the skill on its own.

The skill can answer questions in these areas:

  • Productivity: cycle time, PR throughput, review metrics, sprints and onboarding ramp-up.

  • DORA: deployment frequency, lead time, mean time to recovery and change failure rate.

  • Investment: effort allocation, workstreams, epics and cost capitalization.

  • AI Transformation: AI code ratio, adoption and AI spend.

  • Calendar: meeting load and focus time.

  • AI agent sessions: what happened inside agent sessions, such as skill and MCP usage, prompts, tool calls and file changes. This needs agent traces turned on for your organization and trace access on your token.

It can also look up the pull requests, commits, issues, epics, sprints, teams, people and repositories behind those numbers.

Setup

Before you start

  • A Span account in your organization.

  • curl and jq installed. curl is usually already there. Install jq with brew install jq (macOS) or apt install jq (Linux).

  • Network access from your machine to api.span.app.

Step 1: Install the skill

Claude Code. Inside Claude Code, run:

/plugin marketplace add Attuned-Corp/skills
/plugin install span@span-skills

Or from your terminal:

claude plugin marketplace add Attuned-Corp/skills
claude plugin install span@span-skills

Cursor. Cursor reads skills in the same format. Clone the repository, then link the skill into your user-level skills folder (all projects) or a single project's skills folder:

git clone https://github.com/Attuned-Corp/skills.git ~/span-skills

# All projects
ln -s ~/span-skills/skills/ask ~/.cursor/skills/ask

# One project (run from the project root)
ln -s ~/span-skills/skills/ask .cursor/skills/ask

See the Cursor Skills documentation for how Cursor finds and runs skills.

Step 2: Create a token

Follow How to Create a Span API Token. Pick the token that fits how you'll use the skill:

  • Personal Access Token (most people): Settings → Access Token under Personal, then Generate. The skill sees what you see in Span.

  • Service account token (a shared machine or a shared agent setup): an Owner or Admin creates a service account under Settings → Service Accounts and uses Manage Token → Generate. The service account gets its access from its own settings on that page, not from permission groups.

Step 3: Save the token

The first time you use the skill, it checks for a token and walks you through this step if it doesn't find one. To do it yourself, create the config folder and an auth.json file in it:

mkdir -p ~/.spanrc

Put this in ~/.spanrc/auth.json, replacing the placeholder with your token:

{
  "token": "your-span-token"
}

Then restrict the file so other users on the machine can't read it:

chmod 600 ~/.spanrc/auth.json

The skill adds two files to the same folder on its own: metadata-cache.json (the cached catalog of data and metrics) and api-version-detected (used to warn you when the skill needs an update). To keep the config somewhere else, set SPAN_CONFIG_DIR to that folder, for example export SPAN_CONFIG_DIR="/path/to/folder".

Step 4: Check that it works

  1. Start a new Claude Code session or Cursor Agent chat.

  2. Ask: /span:ask Show me the teams in Span (in Cursor, type /ask followed by the question).

  3. The first run fetches and caches the metadata catalog, then lists your teams. If you get an authorization error, check that auth.json holds the full token and that the token hasn't been revoked or regenerated.

Using it

Ask in plain language, and include a time range and a team or person when you have one. Some examples:

  • "How many PRs did we merge last week?"

  • "What's the cycle time for the Platform team over the last quarter, by week?"

  • "How often did we deploy in September, including all sub-teams of Payments?"

  • "What's our change failure rate this quarter?"

  • "Where is engineering effort going this month: features, maintenance or developer experience?"

  • "What percentage of our code was written with AI last month?"

  • "How many hours a week are engineers on my team in meetings?"

  • "Which skills do we use most in our agent sessions?"

A few requests the skill handles directly:

  • "Reload Span metadata" refreshes the cached catalog. Do this after your permissions change or when a metric you expect isn't found.

  • "What version is installed?" shows your installed version and checks GitHub for a newer one.

  • "Reconfigure Span skill" removes your saved token and runs setup again.

Things to know

  • Skill or MCP server. Both let an AI assistant read the same Span data with the same permissions. Use the skill in Claude Code or Cursor when you want a token-based setup that carries Span's query guidance with it, such as which metric to use and how to roll up teams. Use the Span MCP Server when you want browser sign-in (OAuth) instead of a saved token, or an assistant other than Claude Code or Cursor, such as Claude Desktop.

  • A token only sees what its owner can see. Worked example: your permission group covers the 14 people in your reporting line. You ask "How many PRs did the whole organization merge last month?" and the answer covers those 14 people only. A service account token answers only for what that service account can access.

  • Agent session content is scoped more tightly. Session counts, duration, tool and cost are available for every session your token can list. Prompts, tool calls and turn details are often limited to your own sessions. The skill says which scope it measured, for example that it surveyed one author out of twenty. Sessions held back by Trace Screening show a placeholder title and no content to anyone but their author. If the AI agent session data is missing entirely, agent traces aren't on for your organization or your token lacks trace access. That is different from having no activity.

  • Numbers can differ from the app. The skill queries Span's API, which applies filters separately from the pages in the Span app. A skill answer can differ from the matching page when the time range, team, filters or metric aren't exactly the same. To compare, ask the skill for the same metric, team and dates the page shows, and ask it which metric it used.

  • The skill never needs to see your token. Its instructions tell the assistant not to open, print or paste auth.json. The scripts read the token when they send a request and keep it out of the command line. The token stays in plain text on your machine, so keep the file at chmod 600, don't commit the config folder to a repository, and rotate or revoke the token in Span if the machine is shared or lost. Regenerating a token revokes the old one, so update auth.json afterward.

  • Keep the skill updated. When Span's API changes, the skill warns you that your installed version may not match and suggests an update. In Claude Code, refresh the marketplace with /plugin marketplace update span-skills, then update the span plugin from the /plugin menu. In Cursor, run git pull in your ~/span-skills clone.

  • The assistant does the reasoning. The skill gives your assistant Span's data and guidance on how to query it. Check the time range, team and metric it reports with each answer, and ask it to show the query when a number looks off.

Related articles

How to Create a Span API Token

Span MCP Server

Knowledge Graph API

Service Accounts

Roles & Permissions in Span

Understanding Agent Traces in Span (auspex)

Using Src to understand your engineering metrics

Need help?

Contact your Span account team or reach out to support@span.app.