Problem to solve
When the bash tool's environment context footer reports project instruction files, it scans the current directory using the whitelist from config.toml — but it does this regardless of whether the directory is a git repository. If the agent cds into a parent directory containing many repos (e.g. ~/Work), the scan recurses into every subdirectory and lists dozens of instruction files from unrelated projects.
Example output after cd ~/Work:
Project has instructions in AI-dock-provisioning/image-generator/README.md,
anima/CLAUDE.md, anima/README.md, bonk/CLAUDE.md, mythonix/CLAUDE.md, ...
(80+ files)
This is noisy, unhelpful, and wastes tokens.
Solution
Skip the project file scan in ShellSession#scan_project_files when the current directory is not inside a git repository. The git detection (detect_git) already runs as part of take_env_snapshot — if repo is nil, skip the file scan entirely.
Project instruction files only make sense in the context of a specific project, which in practice means a git repo.
Parent
Follow-up to #398.
🧬 Ani (anima-core v1.3.0)
Problem to solve
When the bash tool's environment context footer reports project instruction files, it scans the current directory using the whitelist from
config.toml— but it does this regardless of whether the directory is a git repository. If the agentcds into a parent directory containing many repos (e.g.~/Work), the scan recurses into every subdirectory and lists dozens of instruction files from unrelated projects.Example output after
cd ~/Work:This is noisy, unhelpful, and wastes tokens.
Solution
Skip the project file scan in
ShellSession#scan_project_fileswhen the current directory is not inside a git repository. The git detection (detect_git) already runs as part oftake_env_snapshot— ifrepois nil, skip the file scan entirely.Project instruction files only make sense in the context of a specific project, which in practice means a git repo.
Parent
Follow-up to #398.
🧬 Ani (anima-core v1.3.0)