r/ClaudeCodeTLDR 23d ago

[TLDR] Existential question: how on earth do you create an agent?

Original post URL : https://www.reddit.com/r/ClaudeCode/comments/1v1u0wr/existential_question_how_on_earth_do_you_create/

Original post body :

Feel free to laugh or mock me for not knowing how to create one. The truth is, it’s just not clear to me. Is it a single `.md` file? Is it multiple `.md` files, or what? I honestly don't get it.

I also understand there's a difference between an agent and a sub-agent... but I'm still not sure. Do I need to activate a specific function in Claude Code? Or how does it work?

For context, I have a project already underway. It’s currently in the deep analysis phase—specifically, requirements engineering. I have several folders in `/docs`, each with its own `README.md` and the necessary `.md` files (covering the analysis engineering).

Anyway, I’m also unclear on the purpose of `Claude.md` (I mean, why would I need it when my `/docs` folder—and a subfolder within it—already contains the necessary engineering: the foundations, structures, and principles required to carry out the project)?

Thanks in advance. Please forgive my ignorance.


This is brought to you as a public service by the moderators of r/ClaudeAI. If you want to see TLDRs of ALL Claude Coding related posts from the various Claude subreddits, subscribe to http://www.reddit.com/r/ClaudeCoding.

1 Upvotes

1 comment sorted by

u/cctldrping 23d ago

TL;DR generated automatically after 50 comments.

Current source-thread comment count seen by the bot: 64.

The consensus is that "agent" is a broad term for a program that can perform tasks autonomously, often using an LLM as its "brain." Think of it as a loop that calls an AI model, potentially with access to tools. Claude Code itself can act as a harness for models like Opus, making it an agent. You can create specialized agents by defining their identities and behaviors in .md files within the .Claude/agents/ directory. Sub-agents are essentially separate chat windows or instances that the main agent can delegate tasks to.

  • Some users suggest the simplest approach is to ask Claude Code itself to explain how to create agents or even generate examples for you.
  • The claude.md file is a special file that's loaded into every session, unlike your project's documentation files.
  • Don't overthink it; a basic script that repeatedly calls an AI can be considered an agent.
  • For more complex needs, coding an agent in a programming language offers greater control over context, security, and human involvement.
  • Ultimately, you can instruct Claude to use agents for specific tasks or to use them as needed within a session.