How to use Jev with Claude Code, Codex and Cursor

By

How to use Jev with Claude Code, Codex and Cursor: install TypeSafe's agent skill, give the agent the docs, and review the Jev code it writes.

~~~

You use Jev with Claude Code, Codex and Cursor by installing TypeSafe’s agent skill, then asking the agent to write code that calls Jev. The agent keeps its usual model. Jev ends up inside the app the agent builds for you.

Jev is TypeSafe’s decision model. You send it some text and a few typed questions, and it returns a yes/no probability, one option from a list you wrote, or a position on a scale you described, each with probabilities. It doesn’t generate text. If you’re new to it, start with my deep dive into Jev.

Here’s how to add the skill to each agent:

AgentHow to add the TypeSafe skill
Claude Codeclaude plugin marketplace add typesafe-ai/skills, then claude plugin install typesafe@typesafe-ai
Codexnpx skills add typesafe-ai/skills --skill typesafe-ai and pick Codex
Cursornpx skills add typesafe-ai/skills --skill typesafe-ai and pick Cursor
OpenCodenpx skills add typesafe-ai/skills --skill typesafe-ai and pick OpenCode
Other agentsThe same npx skills add command, or paste TypeSafe’s “copy to your agent” prompt

Then give the agent the docs as Markdown, start with a planning prompt, and review what it writes against the checklist further down.

Can Jev replace the model inside my coding agent?

No. There’s no setting like model: "jev-latest" that turns Claude Code or Cursor into a Jev-powered agent.

A coding agent needs a model that writes text, calls tools and edits files, and Jev does none of that. TypeSafe’s page on Jev with coding agents says to keep your LLM-based agent and use it to write code that calls Jev where your product needs a fast, structured decision.

Why do coding agents get Jev wrong?

Coding agents learned from years of code that calls LLM APIs, and they bring those habits to Jev.

The first is asking one question per call. With an LLM you ask something, read the answer, then decide what to ask next. Jev runs every question in parallel against the same state, so you send all the independent questions in one request and let code pick the answers it needs. TypeSafe calls this speculative fan-out.

Agents also invent request fields. A Jev request has three top-level fields, model, state and questions, and code written from LLM habits tends to grow things like messages, temperature or max_tokens. TypeSafe’s agent skill page lists invented request and response fields as a known issue, usually caused by a stale copy of the skill.

Then there’s asking Jev to write something, like a summary, a reply or an extracted value. Jev only picks from options you supply, so to pull a value out of text, code finds the candidates (with a regex, for example) and Jev chooses one.

Math and dates end up inside questions too. “Is the invoice more than 30 days overdue?” looks like a judgment, but it’s arithmetic. TypeSafe’s jaggedness page says Jev doesn’t count reliably and reads dates as text, so that work belongs in code. I wrote more about this habit in don’t let the LLM do the math.

TypeSafe also says agents aren’t great at writing questions, so expect to edit them together.

How do I install the TypeSafe skill in Claude Code?

Claude Code gets the skill as a plugin. Run these two commands in your terminal:

claude plugin marketplace add typesafe-ai/skills
claude plugin install typesafe@typesafe-ai

The first registers TypeSafe’s GitHub repository as a plugin marketplace, the second installs the typesafe plugin from it. The plugin is installed for your user, so it works in every project. Add --scope project to the install command to record it in the repository for your team.

Claude Code loads the skill when a task looks related. To force it, run /typesafe:typesafe-ai or write “use the TypeSafe skill” in your prompt.

To update it later:

claude plugin marketplace update typesafe-ai
claude plugin update typesafe@typesafe-ai

Restart Claude Code or run /reload-plugins to load the new version. You can also turn on auto-update from /plugin, under Marketplaces.

How do I install it in Codex, Cursor and other agents?

For every other agent, TypeSafe uses the skills CLI from Vercel Labs:

npx skills add typesafe-ai/skills --skill typesafe-ai

It clones the repository and asks which agents you want to install for. You can skip the picker by naming them with -a, and -y skips the confirmation:

npx skills add typesafe-ai/skills --skill typesafe-ai -a codex -a cursor -y

By default it installs into the current project. As of September 2026 a project install writes:

  • the skill to .agents/skills/typesafe-ai/, which Codex and Cursor both read
  • a symlink in .claude/skills/typesafe-ai if you also pick Claude Code
  • a skills-lock.json file in the project root that records where the skill came from

Commit those files and everyone who clones the repository gets the skill.

Add -g to install it for your user instead. The copy goes to ~/.agents/skills/typesafe-ai/, which Codex and Cursor load in every project, with a symlink in ~/.claude/skills/ for Claude Code.

Use one installation method per agent. If you installed the Claude Code plugin, don’t also pick Claude Code in the picker, or you’ll have two copies of the same skill.

In Codex you can name the skill in a prompt with $typesafe-ai (I cover skills in my Codex guide). In Cursor, type / in the Agent chat and pick typesafe-ai. fx also looks in .agents/skills/, so a project install covers it too.

OpenCode reads .agents/skills/ as well, both in the project and in your home folder, so the same installs work there. To install the skill for OpenCode alone, pass its agent name, opencode:

npx skills add typesafe-ai/skills --skill typesafe-ai -a opencode -y

OpenCode shows its model the list of installed skills, and the model loads one with its skill tool when a task matches. Write “use the TypeSafe skill” in your prompt to make sure it does.

To update, run npx skills update.

The CLI ends with a reminder that skills run with your agent’s permissions. The TypeSafe skill is a single Markdown file with no scripts, so reading it before you install takes a couple of minutes.

Can I just paste a prompt instead?

Yes. The agent skill page has a “copy to your agent” prompt that asks the agent to install the skill itself:

Install the TypeSafe skill. If you're in Claude Code, run `claude plugin marketplace add typesafe-ai/skills`, then `claude plugin install typesafe@typesafe-ai`. If you're in another agent, run `npx skills add typesafe-ai/skills --skill typesafe-ai` and select your agent. Use one installation method. You can read the skill directly at https://github.com/typesafe-ai/skills/blob/main/skills/typesafe-ai/SKILL.md (raw: https://raw.githubusercontent.com/typesafe-ai/skills/main/skills/typesafe-ai/SKILL.md). Then use the TypeSafe skill when working on this project.

The TypeSafe console home has a setup prompt for your agent too. You can also copy the skills/typesafe-ai folder from the GitHub repository into your agent’s skills directory by hand.

What is inside the TypeSafe SKILL.md?

The skill is one short file. It gives the agent a way of thinking about Jev and sends it to the live docs for the details. You can read it on GitHub.

It opens by calling the docs the source of truth. The agent should start from the llms.txt index, fetch pages as Markdown, and read the current API or SDK page before writing an integration, with a table that maps tasks to doc pages. If the docs can’t be reached, it tells the agent to say so and use the installed SDK types rather than invent details.

Then it explains how to find where Jev fits: start from what the app should show or hand off, and work backward to the judgments it needs. Known rules, calculations, exact lookups and execution stay in code. It lists patterns as starting points, from routing a request and filling its arguments to selecting a value instead of generating it, verifying claims and escalating to a person.

The section on questions covers which primitive to pick, backticked paths like ticket.messages[0].text to point at parts of the state, one narrow judgment per question, and a no-match option when nothing may fit.

It closes with composition. Ask independent questions over the same state together. Make a second request only when an earlier answer decides what to fetch or ask next. Confidence describes how spread out the probabilities are, not whether it’s safe to act, and a Noul near 0.5 means “can’t tell”, not “medium”. Test with real cases, and keep API keys on the server.

The skill doesn’t contain the exact request schema, the SDK method names or the model IDs. The agent has to read those from the docs, which is why the next step matters.

How do I give the agent the TypeSafe docs?

The docs run on Mintlify, so every page is also available as Markdown. Add .md to the URL:

curl -sL https://docs.typesafe.ai/confidence.md

The index of every page lives at https://docs.typesafe.ai/llms.txt. There’s also an llms-full.txt with the whole site in one file, but at roughly 900 KB it’s too big for a prompt, so point agents at the index.

If your agent supports MCP, the docs site also answers as a remote MCP server at https://docs.typesafe.ai/mcp (checked in September 2026). It exposes a search tool and a read-only tool that lists and reads the doc pages, so the agent can look things up without scraping the site.

In Claude Code:

claude mcp add --transport http typesafe-docs https://docs.typesafe.ai/mcp

In Codex:

codex mcp add typesafe-docs --url https://docs.typesafe.ai/mcp

In Cursor, add it to .cursor/mcp.json in the project:

{
  "mcpServers": {
    "typesafe-docs": {
      "url": "https://docs.typesafe.ai/mcp"
    }
  }
}

In OpenCode, add it to opencode.json in the project as a remote server:

{
  "mcp": {
    "typesafe-docs": {
      "type": "remote",
      "url": "https://docs.typesafe.ai/mcp"
    }
  }
}

Once the SDK is installed, its type definitions in node_modules/@typesafe-ai/sdk are the final word on option and field names for your version.

What should I ask the agent first?

Start with a plan, not code. TypeSafe suggests this brainstorming prompt, and it’s the one I’d use on an existing project:

Using the TypeSafe skill, explore the project and find opportunities for using
intelligent judgement to stand in for complex parsing or other fragile code.

Fragile code means things like regexes that keep breaking or prompts that ask an LLM for JSON. Review the list the agent comes back with before letting it touch anything.

For a new project, the quickstart has this starter prompt:

Let's build a simple CLI that uses the TypeSafe API to evaluate a set of supplied documents on multiple dimensions. Use the TypeSafe skill to understand how to use the TypeSafe API and how to structure the system. Ask me questions about what kinds of documents I want to evaluate and on what dimensions.

The last sentence makes the agent ask you what to evaluate instead of guessing.

If you have an API key from the console (see how to get access to Jev and an API key), the agent skill page also suggests exporting it as TYPESAFE_API_KEY and letting the agent run cheap test queries before proposing changes. As of late September 2026 TypeSafe has paused new signups because of demand, so that step needs an existing account.

How do I review the Jev code an agent wrote?

TypeSafe’s advice is to put the questions and thresholds in one file, because that’s what a human needs to review. Here’s the shape to ask for, a support ticket example saved as src/jev/questions.ts. If you’re reviewing the SDK calls themselves, how to use Jev in Node.js is the reference:

import { choice, noul, score } from '@typesafe-ai/sdk'

export const TICKET_QUESTIONS = {
  category: choice('What kind of request is `ticket.message`?', {
    billing: 'Charges, invoices, refunds, subscriptions',
    bug_report: 'Something is broken or shows an error',
    feature_request: 'Asks for something the product does not do yet',
    other: 'None of the above',
  }),
  refund_requested: noul('Does `ticket.message` ask for money back?'),
  bug_severity: score('If `ticket.message` reports a bug, how severe is it?', [
    'Cosmetic; no impact on functionality',
    'Broken or degraded feature, but a workaround exists',
    'Blocking issue; no workaround exists',
  ]),
}

export const THRESHOLDS = {
  minCategoryConfidence: 0.6,
  refundYes: 0.7,
  urgentBugScore: 1.5,
}

And the code that uses it sends every question in one call:

import { TypeSafeClient } from '@typesafe-ai/sdk'
import { THRESHOLDS, TICKET_QUESTIONS } from './questions.js'

const client = new TypeSafeClient()

export async function triage(message: string) {
  const { answers } = await client.systemOne({
    state: { ticket: { message } },
    questions: TICKET_QUESTIONS,
  })

  if (answers.category.confidence < THRESHOLDS.minCategoryConfidence) return 'human'
  if (answers.category.choice === 'billing') {
    return answers.refund_requested.noul > THRESHOLDS.refundYes ? 'refunds' : 'billing'
  }
  if (answers.category.choice === 'bug_report') {
    return answers.bug_severity.score > THRESHOLDS.urgentBugScore ? 'on_call' : 'bug_backlog'
  }
  return 'support'
}

The thresholds are placeholders to tune on your own labeled tickets. With that shape in mind, go through the agent’s code with this list:

  • One file for questions and thresholds. Not spread across route handlers.
  • One call per state. Independent questions about the same ticket go in the same systemOne() call. Looping over questions for one state is the LLM habit, looping over tickets is fine.
  • Confidence gating where it matters. Actions that are hard to undo check confidence and fall back to a person. When the code only needs the best option, choice is enough. I cover thresholds in how to use Jev confidence scores.
  • No arithmetic or dates in questions. Totals, counts and date comparisons happen in code.
  • An exit on every Choice. An other option, or “not stated” when the value may be missing, so Jev isn’t forced into a wrong answer.
  • Complete question text. Question IDs aren’t sent to the model, so the meaning has to be in the instructions.
  • Only real fields. model, state and questions in raw requests, and SDK types instead of hand-written ones.
  • The key stays on the server. The JavaScript SDK refuses to run in the browser unless someone sets dangerouslyAllowBrowser, so treat that option as a red flag.
  • The model version is logged. Every response includes the versioned model that answered, like jev-1.13.0. Log it, and pin it once the thresholds are tuned.

What should I put in AGENTS.md?

A skill loads when the agent thinks it’s relevant. A few lines in AGENTS.md keep the rules in front of it on every task that touches Jev. This is the snippet I’d paste:

## Jev (TypeSafe)

- Jev is a decision model, not an LLM. It returns typed answers (noul, choice, score) with probabilities and never generates text.
- Use the TypeSafe skill. Read the docs as Markdown: start at https://docs.typesafe.ai/llms.txt and add `.md` to any page URL.
- Use the official SDK. A raw request has only `model`, `state` and `questions`. Don't add other fields.
- Keep every question and threshold in `src/jev/questions.ts`.
- Send all independent questions about the same state in one call. Only make a second call when the first answer decides what to fetch or ask next.
- Write the full question in `instructions`. Question IDs are not sent to the model.
- Add an `other` or "not stated" option to every Choice that might not fit every input.
- Do math, counting, and date comparisons in code, never in a question.
- Gate irreversible actions on confidence and fall back to a person.
- Keep `TYPESAFE_API_KEY` on the server. Never set `dangerouslyAllowBrowser`.
- Log the `model` field from every response.

Change the file path to match your project. Codex, Cursor and OpenCode read AGENTS.md directly. Claude Code reads it when the project has no CLAUDE.md, otherwise add a line with @AGENTS.md to your CLAUDE.md to import it.

Once the skill, the docs and those rules are in place, pick one fragile piece of parsing in your project and give the agent the brainstorming prompt.

Tagged: AI · All topics

Want me to talk about your product? You can sponsor this site.

~~~

Related posts about ai: