ai-codex

by skibidiskibVerified

Generate a compact codebase index for AI assistants — saves 50K+ tokens per conversation

388
Stars
31
Forks
TypeScript
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/skibidiskib/ai-codex

Getting Started

Guides for using skills like ai-codex.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

ai-codex

Built by Claude Code License: MIT TypeScript

This project was entirely designed, written, and published by Claude Code (Anthropic's AI coding assistant). The concept, implementation, documentation, and examples were all generated in a single conversation session.

Generate a compact codebase index that gives AI coding assistants instant context about your project structure. Instead of wasting 50K+ tokens on file exploration at the start of every conversation, your AI assistant reads a pre-built index and gets to work immediately.

Why

Every time you start a conversation with an AI coding assistant (Claude Code, Cursor, GitHub Copilot, etc.), it spends thousands of tokens exploring your codebase -- reading files, scanning directories, building a mental model. This happens every single conversation.

ai-codex solves this by generating compact, structured reference files that capture:

  • Every API route with its HTTP methods
  • Every page with its rendering strategy (client vs. server)
  • Every library function signature
  • Your database schema (key fields, relationships)
  • Your component tree with props

The result: 5 small files that replace 50K+ tokens of exploration, every time.

Quick Start

Run it in your project root:

npx ai-codex

That's it. It auto-detects your framework and generates the index.

Output

By default, files are written to .ai-codex/ in your project root:

FileWhat it contains
routes.mdAPI routes grouped by resource, with HTTP methods
pages.mdPage tree with client/server rendering tags
lib.mdLibrary exports -- function signatures, classes
schema.mdDatabase schema -- key fields, FKs, relationships
components.mdComponent index with props, grouped by feature

Files that don't apply are skipped (e.g., no schema.md if you don't use Prisma).

Configuration

CLI Flags

npx ai-codex --output .claude/codex     # custom output directory
npx ai-codex --include src lib           # only scan these directories
npx ai-codex --exclude tests __mocks__   # skip these directories
npx ai-codex --schema prisma/schema.prisma  # explicit schema path

Config File

Create a codex.config.json in your project root:

{
  "output": ".ai-codex",
  "include": ["src", "lib", "app"],
  "exclude": ["tests", "__mocks__"],
  "schema": "prisma/schema.prisma"
}

CLI flags override config file values.

Output Format Examples

routes.md

## products
GET,POST     /api/products [auth,db]
GET,PUT,DELETE /api/products/:id [auth,db]
POST         /api/products/:id/images [auth]

## orders
GET,POST     /api/orders [auth,db]
GET          /api/orders/:id [auth,db]
POST         /api/orders/:id/refund [auth,db]

pages.md

[client]   /                                                  HomePage
[server]   /products                                          ProductsPage
[client]   /products/:id                                      ProductDetailPage
[server]   /cart                                               CartPage
[client]   /checkout                                           CheckoutPage

lib.md

## lib
cart-utils.ts
  fn calculateTotal
  fn applyDiscount
  fn formatPrice
auth.ts  fn validateSession
stripe.ts  fn createPaymentIntent

schema.md

## Product
  id                     String    PK
  categoryId             String
  -> Category, OrderItem[], Review[]

**Order** id(PK) | userId | status -> User, OrderItem[]
**User** id(PK) | email(UQ) -> Order[], Review[]

components.md

## components
(c) CartDrawer  items, onRemove, onCheckout
(c) ProductCard  product, onAddToCart
    PriceDisplay  amount, currency
(c) SearchBar  onSearch, placeholder

Integration with AI Assistants

Claude Code

Add this to your CLAUDE.md:

## Codebase Index
Pre-built index files are in `.ai-codex/`. Read these FIRST before exploring the codebase:
- `.ai-codex/routes.md` -- all API routes
- `.ai-codex/pages.md` -- page tree
- `.ai-codex/lib.md` -- library exports
- `.ai-codex/schema.md` -- database schema
- `.ai-codex/components.md` -- component tree

Cursor / Other AI IDEs

Add the .ai-codex/ directory to your AI assistant's context or rules file. Most AI coding tools support a way to include reference files.

Auto-Refresh

Git Pre-Commit Hook

# .git/hooks/pre-commit
npx ai-codex --quiet
git add .ai-codex/

npm Script

{
  "scripts": {
    "codex": "npx ai-codex --quiet",
    "precommit": "npx ai-codex --quiet && git add .ai-codex/"
  }
}

CI/CD

# GitHub Actions example
- name: Update codebase index
  run: npx ai-codex
- name: Commit index
  run: |
    git add .ai-codex/
    git diff --cached --quiet || git commit -m "chore: update codebase index"

Supported Frameworks

FrameworkAuto-detectedWhat it scans
Next.js (App Router)Yesapp/ or src/app/ (api/**/route.ts, **/page.tsx), lib/, components/
Next.js (Pages Router)Yespages/ or src/pages/ (api/**/*.ts, **/*.tsx excl. _app/_document/_error), lib/, components/
SvelteKitYessrc/routes/ (+server.ts routes, +page.svelte pages), src/lib/, components
Generic TypeScriptYessrc/, lib/, utils/, components/

Schema sources are auto-detected from multiple ORMs:

  • Prisma at prisma/schema.prisma (or nested under prisma/schema/)
  • Drizzle at db/schema.ts, src/db/schema.ts, lib/db/schema.ts, src/lib/db/schema.ts, app/db/schema.ts, src/app/db/schema.ts, database/schema.ts, drizzle/schema.ts, or src/lib/server/db/schema.ts (SvelteKit convention) — including split-file layouts where <base>/schema/ is a directory of .ts files

Override with --schema <path> for either ORM (file extension determines the parser).

Supported Runtimes

RuntimeAuto-detectedWhat it detects
Node.jsYes (default)Standard Node project
Cloudflare WorkersYes (SvelteKit)adapter-cloudflare in svelte.config.js, or wrangler.jsonc/wrangler.toml — extracts D1, R2, KV bindings. Next.js projects are always reported as Node.js.

What Gets Skipped

  • node_modules/, .next/, dist/, build/, .git/, .worktrees/, __pycache__/, .turbo/, .cache/, coverage/, .nyc_output/, .parcel-cache/, and ai-codex's own output (.ai-codex/, .claude/)
  • .d.ts declaration files, .map source maps, .min.js / .min.css minified files
  • Backup files (*.backup.*, *-backup-*)
  • shadcn/radix UI primitives (button, dialog, etc.) in components/ui/

Contributing

  1. Fork the repo
  2. Create a feature branch: git checkout -b my-feature
  3. Make your changes
  4. Test on a real project: cd /path/to/your/project && npx tsx /path/to/ai-codex/src/generate-codex.ts
  5. Submit a pull request

Ideas for Contributions

  • Support for more frameworks (Remix, Astro)
  • Support for more ORMs (TypeORM, Knex)
  • Watch mode (--watch) for continuous regeneration
  • Token count estimation in output
  • Support for Python projects (FastAPI, Django)

License

MIT

Frequently Asked Questions

What is ai-codex?

ai-codex is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by skibidiskib. Generate a compact codebase index for AI assistants — saves 50K+ tokens per conversation. It has 388 GitHub stars.

Is ai-codex safe to use?

Yes. ai-codex passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install ai-codex?

Clone the repository with "git clone https://github.com/skibidiskib/ai-codex" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is ai-codex written in?

ai-codex is primarily written in TypeScript. It is open-source under skibidiskib on GitHub, so you can review or fork the full source.

Are there alternatives to ai-codex?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh ai-codex against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details