Back to list
jamesjlundin

context-diet

by jamesjlundin

Monorepo template for building full-stack web and mobile apps. Next.js 16 + React Native + Better Auth + PostgreSQL + Drizzle + AI streaming. Auth, database, email, CI/CD—all wired up and ready to deploy on Vercel in minutes.

25🍴 0📅 Jan 18, 2026

SKILL.md


name: context-diet description: Optimize Claude Code context window usage. Identify what to keep in context vs fetch on-demand. Use when context is bloated, responses are slow, hitting token limits, or want to slim down context. allowed-tools: Read, Grep, Glob

Context Diet

Optimizes context window usage for efficient Claude Code sessions.

When to Use

  • "Too much context"
  • "Slim down context"
  • "Hitting token limits"
  • "Session feels slow"
  • "What should I keep in context?"

Context Budget

PriorityKeep in ContextFetch on Demand
AlwaysCLAUDE.md (~500 tokens)Full file contents
Task-specificCurrent fileRelated files
ReferenceFunction signaturesImplementation details

This Repo's Essential Files

Always Relevant (Keep Short Reference)

FileWhat to KnowSize
CLAUDE.mdCommands, rules, structure~500 tokens
Active file being editedFull contentVaries

Fetch When Needed

TaskFiles to Fetch
API workapps/web/app/api/_lib/, specific route
Databasepackages/db/src/schema.ts
Authpackages/auth/src/index.ts
TestsSpecific test file only
MobileSpecific screen/component

Skip (Already Known)

  • Standard TypeScript patterns
  • React/Next.js conventions
  • Node.js fundamentals
  • Common library usage

Procedure

Step 1: Assess Current Task

What's the user working on?

  • Single file edit → Keep only that file
  • Cross-package feature → Keep interface files, fetch impl
  • Debugging → Keep error context, fetch related

Step 2: Identify Essential Context

For the current task, what's truly needed?

## Essential for This Task

1. {file1} - {why needed}
2. {file2} - {why needed}

## Can Fetch If Needed

- {file3} - Only if {condition}
- {file4} - Only if {condition}

## Skip

- {file5} - Already known / not relevant

Step 3: Context Shortlist

Generate a minimal file list:

## Context Shortlist

### Must Have (read fully)

- `{path}` - Active editing

### Reference Only (read signatures)

- `{path}` - Import types
- `{path}` - Check pattern

### Fetch If Blocked

- `{path}` - Implementation details

Step 4: Recommend Actions

## Recommendations

### To Reduce Context Now

1. {action} - saves ~{tokens}
2. {action} - saves ~{tokens}

### For Future Sessions

- Start with: "I'm working on {task}. Files: {shortlist}"
- Use subagents for exploration
- Split large tasks into focused sessions

Context Patterns

Bad (Context Bloat)

"Read the entire codebase"
"Show me all the packages"
"Give me everything about auth"

Good (Focused)

"I'm editing apps/web/app/api/users/route.ts"
"Show me the getCurrentUser function signature"
"What tables are in the schema?"

Token Estimates

Item~Tokens
Average TypeScript file500-1500
Large component1000-2000
Schema file800-1200
Full CLAUDE.md500
Test file400-800

Guardrails

  • DO NOT recommend skipping CLAUDE.md
  • Always include the file being actively edited
  • Prefer interfaces over implementations
  • Suggest subagents for broad exploration
  • Be specific about what "fetch if needed" means

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon