Most people treat CLAUDE.md like a prompt file.
That’s the mistake.
If you want Claude Code to feel like a senior engineer living inside your repo, your project needs structure.
Claude needs 4 things at all times:
• the why → what the system does
• the map → where things live
• the rules → what’s allowed / not allowed
• the workflows → how work gets done
I call this:
The Anatomy of a Claude Code Project 👇
━━━━━━━━━━━━━━━
1️⃣ CLAUDE.md = Repo Memory (keep it short)
This is the north star file.
Not a knowledge dump. Just:
• Purpose (WHY)
• Repo map (WHAT)
• Rules + commands (HOW)
If it gets too long, the model starts missing important context.
━━━━━━━━━━━━━━━
2️⃣ .claude/skills/ = Reusable Expert Modes
Stop rewriting instructions.
Turn common workflows into skills:
• code review checklist
• refactor playbook
• release procedure
• debugging flow
Result:
Consistency across sessions and teammates.
━━━━━━━━━━━━━━━
3️⃣ .claude/hooks/ = Guardrails
Models forget.
Hooks don’t.
Use them for things that must be deterministic:
• run formatter after edits
• run tests on core changes
• block unsafe directories (auth, billing, migrations)
━━━━━━━━━━━━━━━
4️⃣ docs/ = Progressive Context
Don’t bloat prompts.
Claude just needs to know where truth lives:
• architecture overview
• ADRs (engineering decisions)
• operational runbooks
━━━━━━━━━━━━━━━
5️⃣ Local CLAUDE.md for risky modules
Put small files near sharp edges:
src/auth/CLAUDE.md
src/persistence/CLAUDE.md
infra/CLAUDE.md
Now Claude sees the gotchas exactly when it works there.
━━━━━━━━━━━━━━━
Prompting is temporary.
Structure is permanent.
When your repo is organized this way, Claude stops behaving like a chatbot…
…and starts acting like a project-native engineer.
An easy trick to improve your retention while working through a bank of review or challenge problems like LeetCode, HackerRank, etc:
Go through the question bank breadth-first, not depth-first.
URL, URI, URN - Do you know the differences?
The diagram below shows a comparison of URL, URI, and URN.
🔹 URI
URI stands for Uniform Resource Identifier. It identifies a logical or physical resource on the web. URL and URN are subtypes of URI. URL locates a resource, while URN names a resource.
A URI is composed of the following parts:
scheme:[//authority]path[?query][hashtag# fragment]
🔹 URL
URL stands for Uniform Resource Locator, the key concept of HTTP. It is the address of a unique resource on the web. It can be used with other protocols like FTP and JDBC.
🔹 URN
URN stands for Uniform Resource Name. It uses the urn scheme. URNs cannot be used to locate a resource. A simple example given in the diagram is composed of a namespace and a namespace-specific string.
If you would like to learn more detail on the subject, I would recommend W3C’s clarification.
--
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/FIzCeaWsZV
What is event-driven architecture, and how does it work?
Quite a lot of the tasks modern-day systems are required to do are in response to changes in state.
Adding an item to a shopping cart, liking a post, and paying a bill are all state changes that trigger a set of tasks in their respective systems.
This requirement has paved the way for a popular approach to system architecture known as event-driven architecture (EDA).
Event-driven architecture has four main components:
1) Events
These are significant changes in state. For example, a user signing up to a trial might be an event in a SaaS product. They're generally immutable, typically lightweight and can carry a payload containing information about the change in state.
2) Producers
The role of a producer is to detect or cause a change in state, and then generate an event that represents this change. The change can be initiated by a variety of sources such as system processes, user interactions, and external triggers.
3) Consumers
Consumers are the entities that are interested in and react to events. They subscribe to specific types of events and execute when those events occur.
4) Channels
Meanwhile, channels facilitate sending events between producers and consumers.
Advantages of EDA:
🟢 Decoupling: producers and consumers operate independently, enhancing system flexibility and maintainability.
🟢 Scalability: EDA can efficiently handle a surge in events, making it suitable for systems with varying loads.
🟢 Real-time responsiveness: systems can react immediately to state changes, enhancing user experience and system reliability.
🟢 Resilience: failures in one component don't necessarily cascade through the system, thanks to the buffering capabilities of many channels.
Use cases:
🔸 IoT systems: devices and sensors in IoT setups generate a plethora of events that EDA can efficiently manage.
🔸 Microservices: EDA facilitates communication between decoupled microservices, ensuring smooth system operations.
🔸 Real-time analytics: immediate processing and analysis of data as it's generated is a forte of EDA.
Disadvantages:
🔴 Complexity: tracing and debugging issues in an event-driven system can be more challenging than in traditional architectures.
🔴 Event order: ensuring events are processed in the correct sequence, especially in distributed setups, can be tricky.
🔴 Potential overhead: introducing a message broker or channel can add latency, especially if not optimized.
While EDA offers a robust framework for building dynamic, responsive systems, it's essential to consider its potential pitfalls. Like any architecture, it works best when applied thoughtfully to the right scenarios.
~~
Thank you to our partner Postman who keeps our content free to the community.
📣 Postman has a special online event. The CTO is discussing AI and APIs.
Secure your seat before they run out (it’s free): https://t.co/IYIJZyzg6h
What do Amazon, Netflix, and Uber have in common?
They are extremely good at scaling their system whenever needed.
Here are 8 must-know strategies to scale your system.
1 - Stateless Services
Design stateless services because they don’t rely on server-specific data and are easier to scale.
2 - Horizontal Scaling
Add more servers so that the workload can be shared.
3 - Load Balancing
Use a load balancer to distribute incoming requests evenly across multiple servers.
4 - Auto Scaling
Implement auto-scaling policies to adjust resources based on real-time traffic.
5 - Caching
Use caching to reduce the load on the database and handle repetitive requests at scale.
6 - Database Replication
Replicate data across multiple nodes to scale the read operations while improving redundancy.
7 - Database Sharding
Distribute data across multiple instances to scale the writes as well as reads.
8 - Async Processing
Move time-consuming and resource-intensive tasks to background workers using async processing to scale out new requests.
Over to you: Which other strategies have you used?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/uc5M7CdXXC
Best ways to test system functionality.
Testing system functionality is a crucial step in software development and engineering processes.
It ensures that a system or software application performs as expected, meets user requirements, and operates reliably.
Here we delve into the best ways:
1. Unit Testing: Ensures individual code components work correctly in isolation.
2. Integration Testing: Verifies that different system parts function seamlessly together.
3. System Testing: Assesses the entire system's compliance with user requirements and performance.
4. Load Testing: Tests a system's ability to handle high workloads and identifies performance issues.
5. Error Testing: Evaluates how the software handles invalid inputs and error conditions.
6. Test Automation: Automates test case execution for efficiency, repeatability, and error reduction.
Over to you: How do you approach testing system functionality in your software development or engineering projects?
Over to you: what's your company's release process look like?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/uc5M7CdXXC
How does Docker work?
The diagram below shows the architecture of Docker and how it works when we run “docker build”, “docker pull” and “docker run”.
There are 3 components in Docker architecture:
🔹 Docker client
The docker client talks to the Docker daemon.
🔹 Docker host
The Docker daemon listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes.
🔹 Docker registry
A Docker registry stores Docker images. Docker Hub is a public registry that anyone can use.
Let’s take the “docker run” command as an example.
1. Docker pulls the image from the registry.
2. Docker creates a new container.
3. Docker allocates a read-write filesystem to the container.
4. Docker creates a network interface to connect the container to the default network.
5. Docker starts the container.
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/FIzCeaWsZV
What does a typical microservice architecture look like? 👇
The diagram below shows a typical microservice architecture.
🔹Load Balancer: This distributes incoming traffic across multiple backend services.
🔹CDN (Content Delivery Network): CDN is a group of geographically distributed servers that hold static content for faster delivery. The clients look for content in CDN first, then progress to backend services.
🔹API Gateway: This handles incoming requests and routes them to the relevant services. It talks to the identity provider and service discovery.
🔹Identity Provider: This handles authentication and authorization for users.
🔹Service Registry & Discovery: Microservice registration and discovery happen in this component, and the API gateway looks for relevant services in this component to talk to.
🔹Management: This component is responsible for monitoring the services.
🔹Microservices: Microservices are designed and deployed in different domains. Each domain has its own database. The API gateway talks to the microservices via REST API or other protocols, and the microservices within the same domain talk to each other using RPC (Remote Procedure Call).
Benefits of microservices:
- They can be quickly designed, deployed, and horizontally scaled.
- Each domain can be independently maintained by a dedicated team.
- Business requirements can be customized in each domain and better supported, as a result.
Over to you: 1). What are the drawbacks of the microservice architecture?
2). Have you seen a monolithic system be transformed into microservice architecture? How long does it take?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/uc5M7CdXXC
Cookie Basics 🍪
At its core, HTTP is stateless - each request/response cycle stands on its own, with the server forgetting everything after responding. But often we need to remember things between requests, like user logins or shopping carts. That's where cookies come in.
Cookies are tiny text files stored in your browser. When a server wants to remember something, it sends a "Set-Cookie" header telling your browser to create a cookie. From then on, your browser sends that cookie data back with each request to the server, allowing it to "remember" you.
But it goes further - cookies enable sessions, which are like personal data stores on the server tied to your specific interactions. The server gives you a unique "session ID" cookie, and when you send it back, the server recognizes you and accesses your session data.
There are some security and privacy controls baked in. Same-site cookies only get sent to the originating site to prevent cross-site attacks. Cookies are also isolated by domain and path to limit access. Secure cookies only transmit over encrypted HTTPS, while HttpOnly cookies are hidden from browser JavaScript code to stop cross-site scripting.
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/6j06DUIbVn
What does API gateway do?
The diagram below shows the detail.
Step 1 - The client sends an HTTP request to the API gateway.
Step 2 - The API gateway parses and validates the attributes in the HTTP request.
Step 3 - The API gateway performs allow-list/deny-list checks.
Step 4 - The API gateway talks to an identity provider for authentication and authorization.
Step 5 - The rate limiting rules are applied to the request. If it is over the limit, the request is rejected.
Steps 6 and 7 - Now that the request has passed basic checks, the API gateway finds the relevant service to route to by path matching.
Step 8 - The API gateway transforms the request into the appropriate protocol and sends it to backend microservices.
Steps 9-12: The API gateway can handle errors properly, and deals with faults if the error takes a longer time to recover (circuit break). It can also leverage ELK (Elastic-Logstash-Kibana) stack for logging and monitoring. We sometimes cache data in the API gateway.
Over to you: 1) What’s the difference between a load balancer and an API gateway?
2) Do we need to use different API gateways for PC, mobile and browser separately?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/uc5M7CdXXC
I asked ChatGPT what line I should add to my project.clj in order to get srf4j-nop.jar onto the build classpath. It gave me a good answer. So I asked it where if found the information. It refused to tell me. Asshole!