You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
csp init / plugin agent templates: wrong filePath key, stale "index not auto-updated" guidance, missing --max-snippet-lines #111
The agent instructions that csp init writes and the ones the csp plugin ships have drifted from both upstream semble and csp's own behavior. Three problems affect every csp init and plugin user. Two of them are outright wrong.
Problems
Wrong result key (bug). The templates say "pass filePath and line from a prior search result". The CLI/MCP wire dict is snake_case file_path (crates/csp/src/utils.rs:30), so an agent that looks for filePath finds nothing.
Stale indexing guidance (bug). The templates tell agents to run csp index -o cached_index first and say "an index is not automatically updated". csp auto-caches under $HOME/.csp/index/ and invalidates the cache by content hash (ADR-0002, cache_orchestrator.rs). Following the template pins agents to a stale --index copy and bypasses the fresh auto-cache. Upstream now says the index is "cached automatically on first run and invalidated when files change".
Missing --max-snippet-lines guidance (upstream #198). Upstream examples use --max-snippet-lines 10 and say "do not re-search or grep for the same content". csp's CLI defaults to the full chunk, so agents following the csp templates spend more tokens than they need to.
Affected files
crates/csp/src/bin/csp/agents/*.md (all 10 templates; e.g. claude.md:27,37,51,55)
Activity
fix(init): align agent templates with csp output and auto-cache (#111)
fix(init): align agent templates with csp output and auto-cache (#122)