Skip to content

feat: support .engram-project file for project name override#63

Open
angel-r wants to merge 1 commit intoGentleman-Programming:mainfrom
angel-r:feat/engram-project-override
Open

feat: support .engram-project file for project name override#63
angel-r wants to merge 1 commit intoGentleman-Programming:mainfrom
angel-r:feat/engram-project-override

Conversation

@angel-r
Copy link

@angel-r angel-r commented Mar 12, 2026

Summary

  • Add .engram-project file support to override auto-detected project names
  • When the file exists in the project root, its trimmed content is used as the project name
  • Falls back to current basename behavior when the file doesn't exist (no breaking change)

Motivation

Closes #62

In monorepo setups, basename produces names that don't match the desired engram project name. For example, a directory myorg.backend-api gets project name myorg.backend-api instead of backend-api. This causes duplicate projects when MCP tools (which accept an explicit project param) and hooks (which use basename) save to different project names.

Usage:

# In your project root
echo "backend-api" > .engram-project

Changes

  • plugin/claude-code/scripts/session-start.sh — check for .engram-project before falling back to basename
  • plugin/claude-code/scripts/subagent-stop.sh — same
  • plugin/claude-code/scripts/post-compaction.sh — same
  • plugin/opencode/engram.tsextractProjectName() reads .engram-project if it exists

Test plan

  • go test ./... — all pre-existing tests pass (failures in store/sync/setup are pre-existing Windows file-locking issues, unrelated to this change)
  • Manual testing: created .engram-project with content backend-api in a myorg.backend-api directory, verified hooks resolve the correct project name

When a .engram-project file exists in the project root, its content
is used as the project name instead of deriving it from basename.

This fixes project name mismatches in monorepo setups where the
directory name differs from the desired engram project name
(e.g. gymfever.poolcomapi → poolcomapi).

Closes Gentleman-Programming#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support .engram-project file for project name override

2 participants