Claude Code hook

AI Saas Starter

AI SaaS boilerplate for Next.js 16 — Better Auth, Stripe subscriptions, credits system, AI image generation. AI-native: AGENTS.md, Claude Code skills & hooks.

29 stars 14 forksHooks Source

Install

From source
git clone https://github.com/nikandr-surkov/ai-saas-starter.git

From the README

ai-saas-starter

The free, open-source AI SaaS boilerplate and starter kit for Next.js 16.

Auth, Stripe subscriptions, an append-only credits ledger, and AI image
generation — built as an AI-native repo that Claude Code, Cursor, and
Codex can extend without breaking the money paths.

Live demo ·
Deploy guide ·
Pro version

What is this?

- This website is the demo — sign up,
  everything works.
- The code is a free GitHub repo — MIT, clone it.
- You build YOUR product on top — auth and payments are done.

A free, open-source SaaS boilerplate / starter kit for Next.js 16 ·
React 19 · TypeScript strict · Better Auth · Drizzle + PostgreSQL ·
Stripe · AI SDK 6 · Tailwind v4 + shadcn/ui · Resend · Vitest +
Playwright.

See it

Why another SaaS boilerplate?

AI assistants are good at building product features and bad at the 20% that
loses money when improvised: webhook retries, concurrent spends, refund
paths, idempotency. This repo ships that 20% finished and tested — an
append-only credit ledger whose balance is enforced equal to
SUM(amount), Stripe webhooks that verify raw-body signatures and survive
replays, a double-spend race test against real Postgres — plus the context
files (AGENTS.md, rules, skills, hooks) that keep an agent from quietly
unpicking any of it while you vibe-code the product on top.

Quickstart (60 seconds)

That boots with graceful degradation: no Stripe keys → billing page shows a
setup card; no Resend key → emails no-op with a console warning; no OAuth
keys → those buttons hide; AI_MOCK=true → image generation is free and
offline. Every variable is documented in .env.example.

Quickstart for AI agents

Paste this into your coding agent:

Works with Claude Code, Cursor, Codex, Copilot, and Gemini CLI. The repo
briefs the agent itself — AGENTS.md,…
Read the full README on GitHub

How hooks work

  • Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
  • They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
  • A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Claude Code docs

Details

Type
Hooks
Language
TypeScript
License
MIT
Last updated
26 July 2026
Topics
agents-mdai-image-generationai-saasai-saas-boilerplatebetter-authclaude-codecredits-systemdrizzle-ormnextjsnextjs-boilerplatepostgresqlsaas-boilerplate

FAQ

What is AI Saas Starter?

AI SaaS boilerplate for Next.js 16 — Better Auth, Stripe subscriptions, credits system, AI image generation. AI-native: AGENTS.md, Claude Code skills & hooks. It is a hook for Claude Code, from nikandr-surkov/ai-saas-starter on GitHub.

How do I install AI Saas Starter?

Clone nikandr-surkov/ai-saas-starter from GitHub and follow the setup steps in its README.

Is AI Saas Starter popular?

nikandr-surkov/ai-saas-starter has 29 GitHub stars and 14 forks. It was last updated on 26 July 2026.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.