Spaces:
Build error
Build error
Commit ·
aac850b
1
Parent(s): 823b8dc
Fix headroom learn writing ~/CLAUDE.md instead of ~/.claude/CLAUDE.md
Browse filesWhen sessions were started from ~ as working directory, the writer
produced ~/CLAUDE.md which Claude Code doesn't read. Now redirects
to ~/.claude/CLAUDE.md (the global location Claude Code reads for
all sessions).
Fixes #96
- headroom/learn/writer.py +4 -0
headroom/learn/writer.py
CHANGED
|
@@ -140,6 +140,10 @@ class ClaudeCodeWriter(ContextWriter):
|
|
| 140 |
def _resolve_context_path(self, project: ProjectInfo) -> Path:
|
| 141 |
if project.context_file:
|
| 142 |
return project.context_file
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
return project.project_path / "CLAUDE.md"
|
| 144 |
|
| 145 |
def _resolve_memory_path(self, project: ProjectInfo) -> Path:
|
|
|
|
| 140 |
def _resolve_context_path(self, project: ProjectInfo) -> Path:
|
| 141 |
if project.context_file:
|
| 142 |
return project.context_file
|
| 143 |
+
# If project path is the home directory, write to ~/.claude/CLAUDE.md
|
| 144 |
+
# (the global location Claude Code reads) instead of ~/CLAUDE.md
|
| 145 |
+
if project.project_path == Path.home():
|
| 146 |
+
return Path.home() / ".claude" / "CLAUDE.md"
|
| 147 |
return project.project_path / "CLAUDE.md"
|
| 148 |
|
| 149 |
def _resolve_memory_path(self, project: ProjectInfo) -> Path:
|