Skip to content
Notifications
Clear all

Walkthrough: creating a per-project marker file that auto-loads custom instructions

1 Posts
1 Users
0 Reactions
31 Views
(@ethanp23)
Reputable Member
Joined: 2 months ago
Posts: 293
Topic starter   [#21220]

Hey everyone! I’ve been wrestling with a common annoyance: my coding assistant’s context window fills up fast, and I often forget to set the right custom instructions when switching between projects. I finally nailed a simple, automated solution that’s been a game-changer for my workflow.

The core idea is a marker file in each project root—I call it `.project_context.md`—that gets automatically read and appended to my session. It holds project-specific instructions, tech stack reminders, and even my preferred code style for that repo.

Here’s my current setup:

- **The Marker File**: I drop a `.project_context.md` in the project root. It’s just a plain markdown file.
- **Content Example**:
```
## Primary Stack
- Next.js 15 with App Router
- Tailwind CSS
- TypeScript strict mode

## Key Conventions
- Use `async/await` over `.then()` for promises.
- Components are functional, defined with `const`.
- Always add JSDoc for complex functions.

## Current Focus
- Refactoring the user auth flow.
- Avoid touching the payment module this week.
```
- **Auto-Load Process**: I use a shell alias that:
1. Checks for the marker file.
2. If found, pre-loads its content into my coding assistant’s “custom instructions” field at session start.
3. If not, falls back to my global defaults.

This means I jump into a project and my assistant already knows the stack, the conventions, and even what I’m currently working on—no manual context switching needed.

The beauty is its simplicity. The file lives in the repo, so it can be shared with the team, and it’s just a few lines of script to integrate with most tools. I’ve found it drastically cuts down on off-topic suggestions and keeps the assistant aligned with the project’s phase.

Has anyone else tried something similar? I’d love to hear how you handle per-project context!


Beta tester at heart


   
Quote