{"slug": "stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development", "title": "Stop Wasting Tokens: I Built a File-Mapping Standard for AI-Assisted Development", "summary": "A 16-year-old developer built FolioDux, an open-source file-mapping standard that reduces token usage in AI-assisted development by providing a compact index of a project's structure. Instead of feeding the entire codebase to an AI on every query, FolioDux lets the AI read a single index file first, then load only the relevant files, cutting token consumption from thousands to hundreds. The tool works with any AI that accepts a system prompt, including Claude, ChatGPT, Gemini, Cursor, and Copilot.", "body_md": "Every time I started a new AI chat session, it read my entire codebase.\n\n50 files. Thousands of tokens. On every single message. Whether I was asking about authentication, database schema, or a single UI component — the AI read everything.\n\nI'm 16 and building AI-powered products. Token costs add up fast. Context windows fill up. The AI loses track of older files. Responses slow down.\n\nSo I built something to fix it.\n\nWhen you work with AI on large projects, you face a choice:\n\nThere's no middle ground — or at least there wasn't.\n\n**FolioDux** is a lightweight, open-source file-mapping standard for AI-assisted development.\n\nThe idea is simple: instead of giving your AI every file, you give it a compact index that tells it *where everything is* and *what it does*. The AI reads the index first, identifies the relevant files, and reads only those.\n\n**One file. Two rules. Any AI.**\n\nIt works with Claude, ChatGPT, Gemini, Cursor, Copilot — any tool that accepts a system prompt.\n\nYou add one file — `FOLIODUX.md`\n\n— to your project root.\n\n```\n# FOLIODUX · TaskFlow · v1.0 · 2026-06-18 · 17 files\n\nSTACK: React19+TypeScript+Vite · Express+SQLite · JWT\n\n---\n\n## TASKS\nauth/login/register   → AuthView.tsx, authService.ts, server.ts\ncreate/edit task      → TaskForm.tsx, taskService.ts, server.ts, types.ts\nlist/filter tasks     → TaskList.tsx, taskService.ts\ndatabase              → db.ts, server.ts\n\n---\n\n## INDEX\nApp.tsx           | fe  | root: routing, auth state, layout wrapper\nAuthView.tsx      | fe  | login + register forms, error display\ntaskService.ts    | svc | CRUD tasks, local cache, optimistic updates\nserver.ts         | be  | Express: all routes — auth, tasks, projects, user\ndb.ts             | be  | SQLite setup, schema creation, migrations on boot\ntypes.ts          | typ | Task, Project, User, Status(todo|in-progress|done)\n\n---\n\n## GROUPS\nFrontend:  App.tsx · AuthView.tsx · TaskList.tsx · TaskForm.tsx\nServices:  authService.ts · taskService.ts\nBackend:   server.ts · db.ts\n\n---\n\n## NOTES\n- All routes except /api/auth/* require Authorization: Bearer {JWT}\n- Task status values: todo | in-progress | done only\n```\n\nThen you add two rules to your AI system prompt:\n\n```\nRULE 1 — NAVIGATE BEFORE RESPONDING\nAt the start of every response, before reading any other file:\n1. Read FOLIODUX.md in full.\n2. Check TASKS — if the request matches a keyword, read ONLY those files.\n3. If no match in TASKS, scan INDEX keywords to identify relevant files.\n4. Read ONLY the identified files. Never read the full codebase unless asked.\n\nRULE 2 — UPDATE AFTER CREATING\nAfter creating any new file, add one line to FOLIODUX.md INDEX:\n{filename} | {type} | {keywords — no articles, no filler verbs, max 8 words}\nUpdate TASKS and GROUPS if needed.\n```\n\nThat's it. Your AI now navigates the project like a developer who already knows the codebase.\n\n**Without FolioDux:**\n\nYou ask \"fix the login bug\". Your AI reads all 50 files. Uses 4,000 tokens before even starting to think about your question. Maybe hits the context limit halfway through.\n\n**With FolioDux:**\n\nYour AI reads `FOLIODUX.md`\n\n, finds `auth/login → AuthView.tsx, authService.ts, server.ts`\n\n, reads 3 files. Uses ~300 tokens. Answers faster and more accurately.\n\n```\ncurl -O https://raw.githubusercontent.com/matteo-turri/foliodux/main/foliodux-init.mjs\nnode foliodux-init.mjs\n```\n\nThe CLI script scans your project, detects the tech stack from `package.json`\n\n, classifies every file by type, extracts descriptions from comments and exports, and generates `FOLIODUX.md`\n\nin seconds.\n\nZero external dependencies. Node.js 18+ only.\n\nThe only part the script can't fill automatically. Open `FOLIODUX.md`\n\nand map your most common requests to the files they need:\n\n```\n## TASKS\nauth/login/register   → AuthView.tsx, authService.ts, server.ts\ncreate/edit product   → ProductForm.tsx, productService.ts, server.ts, types.ts\npayment/checkout      → CheckoutView.tsx, paymentService.ts, server.ts\n```\n\nCopy the two rules above into your AI tool's system prompt. Templates for Claude Projects, ChatGPT, Cursor, and generic tools are available in the repo.\n\nFolioDux uses a compressed keyword syntax designed to be readable by both humans and AI while using as few tokens as possible.\n\n**Description rules:**\n\n`+`\n\nfor \"and\", `|`\n\nfor \"or\", `→`\n\nfor \"calls\"| ❌ Verbose | ✅ FolioDux |\n|---|---|\n| This is the main server file that handles all the API routes | Express: all routes — auth, tasks, projects, user |\n| A service that manages authentication and user sessions | login, register, logout, JWT session storage |\n\n**Type codes:**\n\n| Code | Meaning |\n|---|---|\n`fe` |\nFrontend component |\n`be` |\nBackend / API |\n`svc` |\nService / logic |\n`cfg` |\nConfig / build |\n`typ` |\nTypes / interfaces |\n`doc` |\nDocumentation |\n`tst` |\nTest |\n`dpl` |\nDeploy / infra |\n\n**One file.** No config, no database, no server. Just a Markdown file in your project root.\n\n**Tool-agnostic.** Works with any AI that accepts a system prompt.\n\n**Token-first.** Every design decision optimizes for token efficiency.\n\n**Self-updating.** Rule 2 makes the AI maintain the index automatically as the project grows.\n\n**Human-readable.** Valid Markdown. Open, edit, and version-control it like any other file.\n\nThe full project — including the CLI script, prompt templates for Claude/ChatGPT/Cursor, and a complete example — is on GitHub:\n\n**→ github.com/matteo-turri/foliodux**\n\nOpen source. MIT license. Stars and feedback welcome.\n\n*Built this to solve my own problem while working on my projects. I'm 16 and based in Milan — if you try FolioDux, let me know what you think in the comments.*", "url": "https://wpnews.pro/news/stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development", "canonical_source": "https://dev.to/matteoturri/stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development-o25", "published_at": "2026-06-19 21:49:29+00:00", "updated_at": "2026-06-19 22:06:58.086101+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-tools", "ai-products", "generative-ai"], "entities": ["FolioDux", "Claude", "ChatGPT", "Gemini", "Cursor", "Copilot", "Node.js", "Matteo Turri"], "alternates": {"html": "https://wpnews.pro/news/stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development", "markdown": "https://wpnews.pro/news/stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development.md", "text": "https://wpnews.pro/news/stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development.txt", "jsonld": "https://wpnews.pro/news/stop-wasting-tokens-i-built-a-file-mapping-standard-for-ai-assisted-development.jsonld"}}