After a few hours of research, Here are some best open source reference of how to build a 'Claude Code': - Open Code: - Gemini CLI: - Claude Code system prompt: ——— A basic coding agent compose of below: Agent: Can be basic tool call agent with system prompt + Tools: - Bash: Run command - Grep: Search for text within a file - Glob: Find finds - Read: Read code/pdf/img, etc. - Write: Create new files - Edit: Edit existing file, file_path, old_string, new_string -> Basically agent output exact old string to replace (surprised this was the approach, but make sense!) - MultiEdit: file_path + []array of old_string & new_string, when there are multiple places need to edit within a file ———— With the above you already get a semi-working Claude code agent, Some unique features to make it better: - Sub agent: Claude code has this dispatch_agent feature, to do deeper code base searching task (so it doesn’t mess up with the main conversation thread too much) - Thinking tool: A thinking tool to get agent do deeper analysis - Todo: Claude Code has create/update ToDo tool as their planning stage - Context management: Compress past conversation history for long running tasks, both gemini, claude code, open code has it, but an opt-in process - Codebase indexing: Claude code doesn’t index codebase, and it works perfectly fine; @cline also shared similar view: - Versioning: Gemini CLI has this checkpointing feature built in, which auto save a snapshot whenever Edit tool is called ----- One of key learnings here is even with basic setup (Base tools, no codebase index), agent already doing a great job; So keep the simplest setup possible and get the model do its work (e.g. I was surprised Edit tool just asking agent to output string to replace, and it does it well!) Comment below if i missed anything
29,66K