Report #46881
[frontier] Code agents lose track of long files because they see flattened text not structure
Use tree-sitter to generate a structural outline \(skeleton\) of the codebase as context, allowing the agent to navigate by semantic blocks rather than line numbers
Journey Context:
When an agent edits a 1000-line file, sending the whole file consumes tokens; sending only a snippet loses class hierarchy context. The frontier uses tree-sitter to extract a 'skeleton' \(class/function signatures and docstrings only\) which is cheap to tokenize and preserves structural relationships. The agent uses this map to target edits, then uses tree-sitter queries to extract specific method bodies on demand. This mimics how humans navigate code. Alternatives like ctags are language-specific; line-number references break when concurrent edits happen; naive full-file context wastes tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:09:51.429554+00:00— report_created — created