AI Powered Software Development
November 17, 2026 4 min read

Context engineering

HS
HEMANT SINGH
Technical Writer & Educator

Objective: Learn how to provide, organize and manage information that an AI model needs to complete a task accurately.

Context Engineering is one of the most important concepts in modern AI development, especially when working with Google Antigravity, Claude Code, Cursor and other AI coding agents.


What is Context Engineering?

Context Engineering is the process of selecting, organizing and providing relevant information to an AI model so it can perform a task effectively.


Let's understand with an example.

Suppose you ask an AI:

Create a student management module.

The AI does not know:

  1. Which framework you are using.
  2. Which database you have.
  3. How your existing project is structured.
  4. Which coding standards you follow.
  5. Which student fields are required.


Now imagine you provide this information:


PROJECT: Pathshalaguru

TECHNOLOGY:
- Laravel 12
- Livewire
- Tailwind CSS v4
- MySQL

EXISTING DATABASE:
- students table
- classes table
- sections table

CODING RULES:
- Follow existing architecture.
- Use Form Requests where appropriate.
- Use proper authorization.
- Avoid unnecessary packages.

Then you ask:

Create a student management module.

Now the AI has relevant information to make better decisions.

This process of preparing and supplying the right information is Context Engineering.


Prompt Engineering vs Context Engineering


These concepts are related but different.



Prompt Engineering

Context Engineering

Designs effective instructions

Organizes relevant information

Focuses on what to ask

Focuses on what AI needs to know

Defines the task

Provides background and supporting information

Example: Create a student module

Example: Provide database schema and project architecture


An easy way to remember:

  1. Prompt Engineering = What should AI do?
  2. Context Engineering = What does AI need to know to do it?



Practical Example: Context Engineering in Laravel

Suppose you are developing a Fee Management Module for Pathshalaguru.

Before asking AI to develop it, you should provide the following context.

A. Project Information

Project: Pathshalaguru

Framework: Laravel 12
Frontend: Livewire
CSS: Tailwind CSS v4
Database: MySQL

B. Database Structure

CREATE TABLE students (
id BIGINT PRIMARY KEY,
name VARCHAR(255),
class_id BIGINT
);

CREATE TABLE fees (
id BIGINT PRIMARY KEY,
student_id BIGINT,
amount DECIMAL(10,2),
payment_status VARCHAR(50)
);

C. Business Rules

1. Every fee payment belongs to a student.
2. A student can have multiple fee payments.
3. Payment status can be pending or paid.
4. Every payment must have a unique receipt number.
5. Only authorized users can record payments.

D. Current Task

Create a fee collection module.

Allow administrators to:
- View student fee details.
- Record fee payments.
- Generate payment receipts.
- View payment history.

Now the AI has the technical and business information required to understand the task.



What Is Context Window Management?

Every AI model has a limited context window.


For example, imagine an AI model has a context window of 100,000 tokens.

Your instructions, conversation history, project files and retrieved information all consume part of that available space.


Illustrative context window

Instructions

10,000 tokens


Conversation history

30,000 tokens


Project files and documentation

40,000 tokens


Current task and other information

20,000 tokens


Total

100,000

Illustrative example only. Actual allocation depends on the model and application.



This is why context management is important.


What happens when too much context is provided?

  1. Important information can become harder to locate.
  2. Unnecessary information consumes tokens.
  3. Older conversation details may be omitted or summarized.
  4. The model may overlook relevant requirements.


This is sometimes associated with a problem called Context Rot: as context becomes very large or noisy, the model may use relevant information less reliably.



How to Write a Context Engineering Instruction

Here is a practical example you can use with an AI coding agent.

Context Engineering Prompt

Before starting development, understand
my existing project.

Project:
Pathshalaguru

Technology:
Laravel 12, Livewire and MySQL.

Instructions:

1. Inspect the project structure.
2. Read the relevant models and migrations.
3. Understand existing database relationships.
4. Identify existing coding conventions.
5. Review relevant business rules.

Context Rules:

- Prefer existing project patterns.
- Do not assume missing requirements.
- Ask questions if important information
is unavailable.
- Do not modify unrelated files.

After analyzing the project, provide
a summary of your understanding.

Do not start implementation until
the plan is reviewed.