Guide
Connect long context as a file, not a paste
Stop pasting 10,000-line logs into chat. Connect them into the core and have your agent grep, summarise, and ask follow-up questions against the file.
5/18/2026 · connect0 · 3 min
Connect big context into the core as a file so your agent queries it with real tools instead of burning tokens on a paste.
A common anti-pattern: pasting a giant log file into chat, hoping the agent reads it all, then watching half the conversation get truncated. The right move is to put the log on disk and have the agent operate against it with grep / awk / python.
The setup
> I'm going to share a 500 KB stack-trace log. Make me an upload link, content_type text/plain.
You PUT (or drop via the browser helper). Sub-second for a 500 KB text file.
What the agent does next
It doesn't cat the whole thing. It searches.
sh "wc -l /workspace/logs/stack-trace.log"
sh "grep -n 'OutOfMemory' /workspace/logs/stack-trace.log | head -20"
sh "awk '/Caused by/,/at .*\\.java/' /workspace/logs/stack-trace.log | head -200"
The agent reads ~3 KB of carefully-chosen output per call instead of 500 KB of raw log. Token cost stays bounded; the file is still there for the next question.
Why this beats paste-into-chat
- Token cost. Pasting 500 KB into chat is ~125,000 tokens. The agent's context window has to absorb all of it. Uploading + targeted
grepis ~10 tokens for the upload + a few hundred per query. - Persistence. The file stays for the next conversation. You don't re-paste tomorrow.
- Real tools.
grep,awk,jq,sqlite3— the actual investigative toolset, not the LLM trying to do it in its head. - No truncation surprises. The agent picks what to read; you don't worry about chat-window length.
When to actually paste
For < 100 lines of code, < 5 KB of text, paste is fine. The upload-then-grep loop is overkill for small inputs.
Heterogeneous "context" sources
- Server logs: upload, grep by request id.
- JSON dumps: upload,
jqto slice. - CSV exports: upload, query with
duckdborsqlite3. - A repo's git log:
git archive+ upload, thengrepagainst the working tree. - A long PDF: upload, extract text via
pdftotext, then grep.
Limits
- 1 MB inline via
upload.write, no upper limit onupload.create_link. Use the latter for anything bigger than a config file. - Sandbox FS is the persistence boundary — restarting the project doesn't lose the file (R2-backed), but soft-deleting the project queues it for cleanup.
- Privacy — see the audit guide; the
target_pathis logged, content is not.
Next steps
Where this fits
This is the Connect everything pillar of connect0 — the core that connects everything your company runs on. Connecting a log or dump into the core as a file turns unbounded context into a real source your agent can grep, slice, and query on demand. Start building → · All guides →