learn-codebase

learn-codebase is a cursor rule for Cursor from GktuOktay/ai-skills. It costs 0 tokens per session (1,122 once invoked), scanned A, original, MIT.

A method for quickly understanding an unfamiliar software project by starting with its documentation, dependencies, directory structure, and main architectural patterns.

In plain words
What is it for?
Use it when joining a project, investigating how it works, locating relevant files, or preparing to contribute safely.
Why use it?
It reduces the time needed to find the important parts of a large or new codebase before making changes.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when joining a project, investigating how it works, locating relevant files, or preparing to contribute safely.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/gktuoktay/ai-skills/learn-codebase
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/GktuOktay/ai-skills

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for learn-codebase

README.md
[![agentmods](https://agentmods.dev/badge/rules/gktuoktay/ai-skills/learn-codebase/github.svg)](https://agentmods.dev/rules/gktuoktay/ai-skills/learn-codebase)
Your own site
<a href="https://agentmods.dev/rules/gktuoktay/ai-skills/learn-codebase"><img src="https://agentmods.dev/badge/rules/gktuoktay/ai-skills/learn-codebase/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for learn-codebase

Your own site · 80×15
<a href="https://agentmods.dev/rules/gktuoktay/ai-skills/learn-codebase"><img src="https://agentmods.dev/badge/rules/gktuoktay/ai-skills/learn-codebase.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,122 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01122
Opus 5 $0.00000 $0.00561
Sonnet 5 $0.00000 $0.00224
Haiku 4.5 $0.00000 $0.00112

Measured 8d ago against content hash ed988cc0ba2f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

learn-codebase scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/cursor/rules/learn-codebase.mdc · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Learn Unfamiliar Codebase Skill

Overview

This skill provides a systematic approach to rapidly onboarding onto, understanding, and navigating large, unfamiliar codebases. It is designed to move an agent from zero knowledge to productive contribution in the shortest time possible by prioritizing high-signal files and architectural patterns.

Phase 1: The First-Pass Strategy (High-Level Context)

Do not dive into source code immediately. Understand the box before looking inside.

1. Documentation & Manifests

Read these files first to understand what the project is, what it depends on, and how it is built.

  • README.md, CONTRIBUTING.md, ARCHITECTURE.md
  • Package manifests: package.json (Node), pom.xml (Java), Cargo.toml (Rust), go.mod (Go), Podfile / Package.swift (iOS), requirements.txt / pyproject.toml (Python).

Goal: Answer "What are the core dependencies?" (e.g., React, Express, CoreData, Django).

2. Directory Structure Analysis

Use directory listing tools to get a bird's-eye view. Look for standard conventions.

  • src/, lib/, app/ -> Source code.
  • tests/, spec/, __tests__/ -> Testing structure.
  • config/, scripts/, docker/ -> Infrastructure.

Goal: Answer "How is the code organized?" (e.g., by feature, by layer/type, monolith vs. microservices).

Phase 2: Finding Entry Points

To trace execution, you must know where it begins.

  • Web Apps: Look for index.js, main.ts, App.tsx, pages/_app.tsx (Next.js).
  • Backend APIs: Look for server.js, main.go, manage.py, Program.cs, routes configurations.
  • Mobile Apps: Look for AppDelegate.swift, @main struct App, MainActivity.java.
  • CLIs: Look for bin/, cli.js, main.rs.

Phase 3: Identifying Architectural Patterns

Analyze the code organization to determine the architectural style. Look for:

  1. MVC (Model-View-Controller): Are there directories explicitly named models, views, controllers?
  2. Clean Architecture / Hexagonal: Are there layers for domain, usecases, infrastructure, adapters?
  3. Feature-Based Modular: Is code grouped by domain concept? (e.g., src/features/authentication/, src/features/users/).
  4. State Management: Look for Redux (store/, reducers/), Vuex, Context APIs, or core database abstraction layers (ORMs, DAOs).

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 86 lines · 1,122 tokens per session scan A ed988cc0ba2f

Subscribe to this mod's changes

learn-codebase is a cursor rule published in the GitHub repository GktuOktay/ai-skills (2 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,122 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.