Skip to content

Creating a graffify for less token use for AI models #6

Description

@DivyanshuX9

Problem

Every time an AI agent (GitHub Copilot, Claude, GPT, etc.) starts a new session on this repo, it must cold-scan the entire source tree to orient itself — reading files across app/, components/, hooks/, lib/, types/, plus config files and the README.

A full cold-start scan of RideHub consumes 3,000–6,000+ tokens per agent session just for orientation, before any useful work begins. This causes:

  • 💸 Cost — tokens wasted on orientation instead of the actual task
  • 🐢 Speed — multiple tool-call round-trips just to build a mental model
  • 🧠 Context pressure — large scans exhaust the context window before writing any code
  • 🎲 Inconsistency — different agents explore different file subsets and arrive at different (sometimes wrong) mental models of the codebase

Root Cause

There is no single, structured, machine-readable document that gives an agent everything it needs in one read. Agents are forced to cat/grep/glob through dozens of files to reconstruct what any human contributor already knows.

Proposed Solution

Add a /graffify folder — an Agent Context Hub — that pre-digests the repo into a small set of structured markdown files any agent can read in 1–2 tool calls:

File Purpose
graffify/README.md Explains the folder and how agents should use it
graffify/context.md Tech stack, project structure, env vars, scripts, conventions, backend API surface
graffify/architecture.md Pages, component tree, auth flow, data flow, hooks/utilities reference
graffify/types.md Every TypeScript interface and type in the codebase

Estimated token savings

Approach Tokens for orientation
Cold scan (status quo) ~4,000–6,000
Read /graffify (3 files) ~1,200–1,500
Savings ~70–75%

Resolution

Addressed in PR #5: feat: add /graffify agent context hub to eliminate token-heavy repo scanning
#5

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions