CodeSkeleton AI
Developed by KiranLabs

Stop AI models from skipping lines and hallucinating on large codebases. Supports both Function-Level Focus and File / Folder Architectural Skeletons.
🌟 Why CodeSkeleton AI?
When pasting code into ChatGPT, Claude 3.5, Gemini 1.5 Pro, or DeepSeek, models suffer from attention degradation on long files:
- They skim through hundreds of lines of boilerplate.
- They get lazy and ignore critical lines of logic.
- They answer with
// ... existing code ... or hallucinate non-existent variables.
CodeSkeleton AI solves this on both the Function and File levels:
- 🎯 Function-Level Focus: Place your cursor inside any function (or highlight code) -> CodeSkeleton automatically detects the enclosing function boundaries, keeps that target 100% intact, and collapses all other functions in the file into signatures (
{ /* ... omitted ... */ }).
- 📄 File-Level Skeleton: Right-click any file in the Editor or Explorer sidebar to instantly generate a complete structural map of imports, exports, classes, and method signatures with all bodies collapsed.
- 📁 Folder / Multi-File Skeletons: Right-click any folder or multiple files in Explorer to generate a compact architectural blueprint of your entire module or workspace.
- 🧠 Zero Attention Fatigue: Reduces token load by 70%–90%, keeping the LLM's attention sharp and focused on your target code.
🚀 How to Use
1. Function Level (Inside the Editor)
- Place your cursor anywhere inside a function (or highlight a block of code).
- Right-click and choose "CodeSkeleton AI: Focus on Function / Selection (Collapse File)".
- CodeSkeleton AI auto-detects the enclosing function, preserves it with 100% full implementation, collapses all other functions, and copies the result with an AI directive to your clipboard!
2. File Level (From Editor or Explorer)
- Right-click any file in the Explorer sidebar or in an active editor.
- Select "CodeSkeleton AI: Copy File Skeleton (Collapse All Functions)".
- All function bodies are collapsed into signatures, preserving imports, classes, and types.
3. Folder / Workspace Level (From Explorer)
- Right-click any folder (or select multiple files) in VS Code's Explorer sidebar.
- Select "CodeSkeleton AI: Copy Folder / Selected Files Skeleton".
- It recursively gathers all code files (skipping binaries &
.git/node_modules) and generates a unified multi-file architectural skeleton!
4. Export to File
- Choose "CodeSkeleton AI: Export Skeleton to .txt File" to save the generated skeleton directly to disk.
📄 Output Preview
Function Focus Example:
================================================================================
CODESKELETON AI: PaymentService.js
Original Lines: 284 | Skeletons Collapsed: 8
Estimated Tokens: ~340 (Saved ~1,850 tokens / 84% reduction)
================================================================================
🎯 FOCUS TARGET: 'processRefund' (Lines 142-178 - 100% full implementation shown)
💡 AI DIRECTIVE: Please read EVERY SINGLE LINE of the Focus Target carefully.
================================================================================
1 | import { Database } from '../db';
2 | import { PaymentGateway } from './gateway';
3 |
4 | export class PaymentService {
5 | constructor(private db: Database) { /* ... omitted ... */ }
6 | async validateCard(token: string): Promise<boolean> { /* ... omitted ... */ }
7 |
>142 | async processRefund(transactionId: string) {
>143 | const tx = await this.db.find(transactionId);
>144 | if (!tx || tx.status !== 'completed') {
>145 | throw new Error('Invalid transaction status');
>146 | }
>147 | return await this.gateway.refund(tx.id, tx.amount);
>148 | }
149 |
150 | async sendReceipt(email: string): Promise<void> { /* ... omitted ... */ }
151 | }
⚙️ Settings
Configure preferences in VS Code Settings (Ctrl + , -> search CodeSkeleton AI):
| Setting |
Default |
Description |
codeSkeleton.includeLineNumbers |
true |
Include aligned original line numbers |
codeSkeleton.includePromptHeader |
true |
Include token savings summary and AI reading directive |
codeSkeleton.placeholderText |
/* ... omitted ... */ |
Placeholder inside collapsed function bodies |
📦 About KiranLabs
KiranLabs builds developer tooling to make programming with AI fast, seamless, and reliable.
📄 License
MIT License. Free to use, modify, and distribute.