एक पूरी 2,000-line की file paste करना tokens बर्बाद करता है और उत्तर की गुणवत्ता को नुकसान पहुँचाता है। लक्ष्य AI को ठीक वह context देना है जो उसे आपकी समस्या पर तर्क करने के लिए चाहिए — और इससे ज़्यादा कुछ नहीं।
एक पूरी 2,000-line की file paste करना tokens बर्बाद करता है और उत्तर की गुणवत्ता को नुकसान पहुँचाता है। लक्ष्य AI को ठीक वह context देना है जो उसे आपकी समस्या पर तर्क करने के लिए चाहिए — और इससे ज़्यादा कुछ नहीं।
db एक Postgres pool है।"# Bad: paste the whole 800-line user-service.ts
# → AI wades through unrelated code, may anchor on the wrong function
# Good: send only what matters
// file: src/services/user-service.ts
// context: called from POST /users; `db` is a Postgres pool (pg)
type User = { id: number; email: string };
async function createUser(email: string): Promise<User> {
const { rows } = await db.query( // <-- the function I need help with
"INSERT INTO users (email) VALUES ($1) RETURNING id, email",
[email],
);
return rows[0];
}
// Question: how do I handle a duplicate-email conflict here?
दूसरा संस्करण AI को function, उसका return type (User), और db के बारे में एक-पंक्ति का note देता है — सटीक उत्तर देने के लिए पर्याप्त, बिना किसी असंबंधित code के जो उसका ध्यान भटकाए।
यह केवल लागत के बारे में नहीं है। अतिरिक्त code एक distraction है: model किसी असंबंधित function पर पकड़ बना सकता है, file में कहीं और मौजूद bug की नकल कर सकता है, या हज़ारों असंबंधित tokens में अपना ध्यान बाँट सकता है। एक केंद्रित prompt एक केंद्रित, सटीक उत्तर पैदा करता है।
Token budgets सीमित हैं और बड़े dumps speed और quality दोनों को घटाते हैं। न्यूनतम संबंधित slice भेजना — target function, उसके types, एक context सारांश, और file paths — tokens बचाता है और distractions हटाकर उत्तर को तेज़ बनाता है। Context को curate करना AI के साथ प्रभावी ढंग से काम करने की एक मूल skill है: आप जानकारी छिपा नहीं रहे हैं, आप ध्यान को उस ओर निर्देशित कर रहे हैं जो मायने रखता है।