Business Implementation
4 min read

Building Context as Code: My Approach

I remember the first time I heard 'context is the new code'. It was like a light bulb moment. Suddenly, everything clicked. I realized that context isn't just a backdrop—it's a dynamic, living part of our development cycle, much like the code itself. In today's rapidly evolving tech landscape, understanding and leveraging context can be a game changer. It's no longer just about writing efficient code; it's about orchestrating the right context around it. Here's how I tackle this challenge in my daily workflow, integrating context into every phase, from development to optimization. We'll cover security, testing, and how to distribute this context because, trust me, I've learned some lessons the hard way. Get ready to see context from a new perspective.

Modern minimalist illustration on context development life cycle with geometric shapes and indigo gradients for AI technology article.

I remember the first time I heard 'context is the new code'. It was like a light bulb moment. Suddenly, everything clicked. I realized that context isn't just a backdrop—it's a dynamic, living part of our development cycle, much like the code itself. In today's fast-evolving tech landscape, understanding and leveraging context can be a game changer. It's not just about writing efficient code anymore; it's about orchestrating the right context around it. Let me show you how I tackle this challenge in my daily workflow. First, I build context as code, integrating it into every phase (yes, even in testing and validation). Then, I ensure it's secure before distributing it. And finally, I observe and optimize it. Trust me, I've learned some hard lessons about security and distribution. But every mistake became a valuable learning experience. Get ready to see context from a new perspective.

Understanding Context as the New Code

When I started integrating AI coding agents, it quickly became clear that context isn't just a mere metadata. It's a living entity, evolving with the application itself. I treat it as such because it profoundly influences how my applications behave. A concrete example: using context filters to dynamically refine application behavior. It's a game changer. It's no longer just about coding, but understanding how each contextual element interacts. This is where specification-driven development comes into play. I use it to clearly define the context right from the start.

Modern illustration of navigating context development life cycle with geometric shapes and violet gradients, representing AI technology.
Navigate the context development life cycle with modern geometric shapes.

I've found that using an AI SBOM, a software bill of materials, is crucial for keeping track of context components. It helps ensure that all aspects of the context are accounted for and updated.

  • Context as a living entity: It evolves with the application and is never static.
  • Clear specifications: Specification-driven development helps define this context precisely.
  • Tracking components: Using an AI SBOM to keep an eye on contextual elements.

First, I map out the context requirements alongside code requirements. This is a crucial step, often overlooked. Then, I iterate through context creation, much like code sprints. This process allows me to test the adaptability of the context against various real-world scenarios. But watch out, overcomplicating context can lead to inefficiencies. I've had to learn to balance between detailed context and overall performance.

Back in 2009, DevOps was already a talking point, and I see a similarity here: smoothly collaborating between context and code is essential.

  • Mapping needs: Aligning context needs with those of the code.
  • Iterations and testing: Adapting context as we do with code.
  • Balance: Don't overload the context to avoid inefficiencies.

Testing and Validating Context: My Workflow

Testing context is as crucial as code testing. You can't skip this. I use automated tests to ensure the context behaves as expected. I've often hit a 100% success rate on some tests, but don't let that fool you—thoroughness is key. I validate context against edge cases to ensure robustness. Sometimes, manual testing reveals nuances that automated tests miss.

Modern illustration of context testing and validation, professional workflow with geometric shapes and violet gradients.
Professional workflow for testing and validating context.
  • Automated tests: Ensuring context works as expected.
  • Manual tests: Revealing subtleties that automation might miss.
  • Edge case validation: Ensuring the context remains robust.

Packaging and Distributing Context

I package context into reusable libraries for efficiency. This approach saves time and ensures consistency across projects. Security is key: I implement strict access controls on context libraries. Watch out for bloated packages that slow down distribution. I often revisit and refine these libraries based on feedback.

  • Reusability: Packaging context for effective use.
  • Security controls: Ensuring only the right people have access.
  • Continuous optimization: Refining libraries for better performance.

Observing and Optimizing Context Usage

I monitor context usage to identify bottlenecks. Optimizing context can lead to significant performance gains. Don't ignore user feedback—it's invaluable for context refinement. I use analytics tools to track context effectiveness. Continuous observation helps me keep context relevant and efficient.

Modern illustration on observing and optimizing context usage in AI, featuring geometric shapes and indigo gradients for a tech blog.
Enhancing context efficiency through continuous observation.
  • Monitoring: Identifying potential bottlenecks.
  • Performance gains: Optimizing context for better results.
  • User feedback: Invaluable for ongoing refinement.

For further insights, check out our article on mastering generative AI.

Diving into 'Context as Code' has been a game changer for me. By treating context with the same diligence as code, I've seen firsthand improvements in efficiency and performance. Here are some key takeaways:

  • Integrate context into your development life cycle — it reduces friction and optimizes deployments.
  • Test and validate your context just like your code — it prevents surprises in production.
  • Package and distribute your context with your code — it standardizes your workflow.

But watch out, it’s not without its challenges. You need to define your context requirements clearly upfront, or you risk losing clarity. If you’re ready to revamp your approach to context, start by mapping out your context requirements today and see where it takes you! Check out Patrick Debois' full video on YouTube for a deeper dive: https://www.youtube.com/watch?v=bSG9wUYaHWU. Trust me, it's worth your time.

Frequently Asked Questions

Context as code means treating context as a dynamic, essential part of software development, just like the code itself.
I test context using automated and manual tests to ensure it behaves as expected, taking edge cases into account.
Packaging context into libraries saves time, ensures consistency, and simplifies distribution across different projects.
Security is crucial to protect access to context libraries and ensure only authorized personnel can use them.
I optimize context usage by monitoring performance, gathering user feedback, and continuously refining the context.
Thibault Le Balier

Thibault Le Balier

Co-fondateur & CTO

Coming from the tech startup ecosystem, Thibault has developed expertise in AI solution architecture that he now puts at the service of large companies (Atos, BNP Paribas, beta.gouv). He works on two axes: mastering AI deployments (local LLMs, MCP security) and optimizing inference costs (offloading, compression, token management).

Related Articles

Discover more articles on similar topics

Mastering Generative AI: A Practical Guide
Business Implementation

Mastering Generative AI: A Practical Guide

I still recall diving into AI coding, thinking generative AI was just another buzzword. Then I realized it’s a real game changer, but only if you know how to harness it. First, I immersed myself in its fundamentals—understanding how these tools transform how we code. Engineers spend barely two hours a day on actual coding; the rest is orchestration. And that’s where AI steps in, boosting productivity and redefining our roles. I’ll walk you through how I navigated this complex landscape, from the environmental impact of AI technologies to prompt engineering and context management. Let's explore how mastering generative AI can revolutionize our approach to software development.

Mastering Cloud Code: More Than Just Coding
Business Implementation

Mastering Cloud Code: More Than Just Coding

I remember the moment I realized writing code was just a fraction of my job. I was knee-deep in Cloud Code tools, believing I was optimizing, but in reality, I was merely scratching the surface. The true game-changer? Understanding the bigger picture. In a world where technology evolves at breakneck speed, a software engineer must wear multiple hats. It's no longer just about the code—it's about leveraging tools, grasping business needs, and driving profits. I've learned that mastering Cloud Code is far more than just coding. And what really shifts the game is the ability to turn lines of code into business impact.

Programming Fundamentals: Why They Matter
Business Implementation

Programming Fundamentals: Why They Matter

I remember the first time I had to debug without understanding the basics. It was like navigating a maze blindfolded. Trust me, skipping the fundamentals is a shortcut to nowhere. In our rush to build and deploy, we often overlook the importance of programming basics. But here's the kicker: even the most advanced tools and models can't save you from the pitfalls of poor coding practices. Whether you're a seasoned developer or just starting out, understanding the importance of fundamentals is crucial. I dive into how large language models are influencing our practices and why hands-on experience remains indispensable. Stick with me to see why, in ten or twenty years, the foundations you lay today will still matter.

Code Simplification: 12K to 200 LoC with Markdown
Business Implementation

Code Simplification: 12K to 200 LoC with Markdown

I was staring at a 12,000 line codebase, knowing there had to be a better way. That's when I decided to strip it down to just 200 lines using Markdown. This wasn't just a cleanup—it was a revelation. In software development, efficiency isn't just a goal—it's a necessity. By leveraging tools like Git Word Trees and embracing cross-platform strategies, we can dramatically simplify our codebases while enhancing functionality. In this talk, I delve into how I implemented Asian Skills and Sub Asians, optimized cross-platform compatibility, and tackled challenges in agent tracking and feature discoverability. Discover how Cursor 3.0 is pushing boundaries and setting the stage for the future of development.

Industrial Capabilities on the Moon: Key Insights
Business Implementation

Industrial Capabilities on the Moon: Key Insights

I've spent years tinkering with tech on Earth, but moving operations to the moon? That’s a game changer. Imagine extracting silicon, aluminum, iron, and titanium directly from the lunar surface. With 3D printing using molten regolith, we can build complex structures without ever leaving lunar orbit. And Y Combinator is right in the mix, playing a crucial role in these space projects. Let me show you how we’re building these industrial capabilities in space, and why it’s not just sci-fi anymore.