Problem
When the session working directory is $HOME, the system-prompt loader includes both the project and the global copy of each overlay file, even though they resolve to the same on-disk path. Confirmed for:
AGENTS.md / ~/AGENTS.md
.jcode/prompt-overlay.md / ~/.jcode/prompt-overlay.md
.jcode/preferred-tools.md / ~/.jcode/preferred-tools.md
Result: the same content appears twice in every prompt (~2-5 KB duplicated per turn).
Repro
cd $HOME
jcode # inspect the assembled system prompt; project + global sections are identical
readlink -f ./.jcode/preferred-tools.md ~/.jcode/preferred-tools.md # same inode
Suggested fix
Canonicalize each candidate path (std::fs::canonicalize) and dedup before concatenation in the layer-4/5/6 loaders described in docs/SYSTEM_PROMPT_CONFIG.md.
Impact
- Wastes input tokens every turn for users who launch jcode from
$HOME.
- Confuses new users about which file to edit.
- Version: v0.84.0 (57d5878).
Problem
When the session working directory is
$HOME, the system-prompt loader includes both the project and the global copy of each overlay file, even though they resolve to the same on-disk path. Confirmed for:AGENTS.md/~/AGENTS.md.jcode/prompt-overlay.md/~/.jcode/prompt-overlay.md.jcode/preferred-tools.md/~/.jcode/preferred-tools.mdResult: the same content appears twice in every prompt (~2-5 KB duplicated per turn).
Repro
Suggested fix
Canonicalize each candidate path (
std::fs::canonicalize) and dedup before concatenation in the layer-4/5/6 loaders described indocs/SYSTEM_PROMPT_CONFIG.md.Impact
$HOME.