Ask Daniel's CODEX · index

Grok Projects as Custom Agents

Grok Projects as Custom Agents

[1] DANIEL:

Hey when I create the instructions in a GROK project folder it's basically that I'm creating an agent? Or at least it seems like that because each time I go to a different folder I get a different behavior.


[2] GROK:

Yes, you're spot on—creating instructions in a Grok project (or what some call a workspace) is essentially building a lightweight custom agent tailored to that specific context.

Here's what's happening under the hood:

That's why switching folders/projects feels like jumping between entirely different versions of Grok. One might act like a strict coding mentor with technical style guidelines, another like a creative writing partner with a fun tone, and a third like a research analyst that always cites sources in a certain format.

How it compares to a "full" agent

Quick tips to make the most of it

If you're building several of these, it's one of the most powerful ways to turn Grok into a multi-tool setup without needing external code or complex setups.

Want help refining instructions for a specific type of "agent" you're trying to create in one of your projects? Just describe what behavior you're going for (e.g., coding helper, content writer, analyst), and I can suggest a solid starter prompt.


[3] DANIEL:

And if there's a big file uploaded and every time we open a new thread does that use up some of the tokens in that thread


[4] GROK:

Yes, that's a great question—and the answer is yes, but it's more nuanced than a simple "every time it eats tokens." Here's exactly how it works in Grok projects (also called workspaces):

How uploaded files work in a Grok project

Token usage on a new thread

- The project's instructions and file metadata/context are injected into the system prompt or early context for that thread. - For a truly massive file (e.g., something that would be 50k–200k+ tokens if fully loaded), Grok typically processes it via document search / retrieval rather than loading 100% of the raw text into the context window right away. - This means: The initial prompt for a new thread includes some overhead from the project setup (instructions + file references), and then relevant sections get pulled in as you ask questions. This is more token-efficient than older systems that forced the whole document in every time.

- New thread: Starts relatively "clean" — you get the project instructions + file access, but no prior chat history. The file's presence still adds some token cost upfront. - Continuing the same thread: Conversation history builds up, which can compound with the file context and eventually push against the token limit faster.

Practical tips for big files in projects

- Put key summaries or outlines in the custom instructions instead of relying solely on a giant raw file. - Use follow-up questions in the same thread to build on retrieved info (cheaper than starting fresh). - For very large codebases or docs, some users combine project files with targeted pasting of excerpts when needed.

In short: Opening a new thread in the project does use some tokens for the persistent setup (instructions + file context), but Grok's retrieval approach keeps it from being as wasteful as fully re-including a massive file every single time.

If your big file is causing noticeable slowdowns, weird truncations, or high "thinking" time in new threads, feel free to describe the file type/size (e.g., 100-page PDF, large codebase) and what you're trying to do with it. I can help you optimize the project instructions or workflow to minimize token waste.


[5] DANIEL:

So project folders should not be treated like categories you know like a book in one and search in another but rather defined by the actual work tasks like having a sub worker rather than a category of the project


[6] GROK:

Yes, you've nailed the most effective way to think about Grok projects (also called workspaces).

Treat them as specialized sub-workers or dedicated agents focused on specific work tasks or workflows, rather than broad categories like "All Books" or "General Research."

Why task-oriented > category-oriented

- Custom instructions define the role, rules, tone, output format, and expertise for that sub-worker. - Uploaded files (docs, code, data, guidelines) give it ongoing context without you having to re-explain everything. - Every new thread inside the project inherits this setup, so the behavior feels consistent—like switching between different specialized colleagues.

- A "Books" project might mix fiction writing, research notes, reading summaries, and reviews → instructions and files become too broad, retrieval gets noisier, and responses lose focus. - A "Search/Research" project would pull in unrelated topics and dilute the specialized behavior.

- "Book Writing Assistant" — Instructions: "You are a strict developmental editor for sci-fi novels. Always check plot consistency, character arcs, and pacing. Output chapter feedback in this exact table format..." - Upload: style guide, previous chapters, world-building doc. - "Competitor Analysis Worker" — Instructions: "Act as a market intelligence analyst. For any company mentioned, pull key metrics, strengths/weaknesses, and compare in a standardized SWOT + pricing matrix..." - Upload: past analysis templates, industry benchmarks. - "Code Review Sub-Worker" — Instructions: "Senior Python engineer focused on clean, performant, testable code. Always suggest refactors with before/after snippets and explain trade-offs." - Upload: project codebase files or architecture docs.

This way, when you jump into the project, Grok immediately "becomes" that sub-worker without extra prompting.

Best practices for setting them up this way

  1. Name them by role or task, not topic:

- Good: "Novel Editor Agent", "Weekly Marketing Report Generator", "Personal Finance Analyst" - Less ideal: "Books", "Marketing", "Finance"

  1. Make instructions role-heavy and specific:

- Start with: "You are [precise role] working on [specific goal]." - Include: preferred output formats, what to always check/avoid, step-by-step workflows, tone, and how to handle the attached files. - Keep it concise but detailed—bullet points or structured sections work great.

  1. Attach only relevant files to keep context clean and token-efficient.

- For big files, the retrieval system helps, but tighter focus = better relevance.

  1. Use multiple projects like a team:

- One for deep creative work. - One for analytical tasks. - One for routine reporting. - You can even have a "General Orchestrator" project that coordinates ideas across others if needed.

This approach turns Grok from a single chatbot into a flexible team of specialists, which is exactly why the project system feels so powerful once you lean into the "sub-worker" mindset.

If you want, describe one or two actual tasks/workflows you're handling (e.g., "I'm writing a technical book on AI" or "I do monthly competitor research for my product"), and I can help you draft strong custom instructions + suggested file setup for a dedicated project. What's one you're thinking of building?

Ask Daniel's CODEX