Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
YerbaPageย 
posted an update 3 days ago
Post
4527
**Build Claude Code from Scratch Together**

I'm building a minimal, open-source AI agent that runs in the terminal to help with programming tasks. Think of a simplified, from-scratch version of the Claude Code agent ๐Ÿ’ป.

You can check out the basic framework I've already started here: [github.com/YerbaPage/Terminal-Agent](https://github.com/YerbaPage/Terminal-Agent) ๐Ÿ”ฅ

To be clear, the goal isn't to create a perfect, commercial-grade tool. This is a for-fun project geared towards research and exploration. The main idea is to build a **flexible and minimal framework** that helps us understand the modules and functionalities of sophisticated agents like Claude Code. It's a playground to explore how we can enable agents to handle more complex tasks effectively.

I'm looking for a few people who'd be interested in exploring this together. We could experiment with ideas like adding a to-do list manager to improve planning or finding better ways for the agent to manage its memory like some MCPs do. ๐Ÿค”

If you're into LLMs and want to build a cool, exploratory project from the ground up, leave a comment or check out the repo! ๐Ÿค—

ooooh cool! ๐Ÿ’–

say, what tool calling format do you use?
Im transitioning from thus verbose one:

# Thought
Hmmmm let me thing - okay imma call this tool

# Actions
[
{
"name": "tool_name", 
"args": {"arg1": value, ...}
}
]

# Observation
results here

# Thought
[...]

to this much simpler format:

blablabla my thoughts here

Tool: tool_name(arg1, arg2, ...)
Result: results here

aha okay, let me iterate based on the results

Tool: [...]

works great for rapid calls, but u gotta handle all those parenthesis... incase it wants to useultiline strings and such...

oh yea - im building a FOSS Godot game engine assistant, in case anyone cares

whats your experience been like?

ยท

Hey! Your Gopilot Assist looks really cool! ๐ŸŽฎ

Regarding tool calling formats - I actually use the standard OpenAI format that gets sent directly to the API server. Looking at my chat history structure, the overall format is:

{
  "timestamp": "...",
  "model": "...", // model name
  "temperature": 0.0,
  "message_count": 5, // number of messages
  "messages": [
    {
      "role": "system",
      "content": "..." // system prompt
    },
    {
      "role": "user", 
      "content": "..." // user message
    },
    {
      "role": "assistant",
      "content": "",
      "tool_calls": [
        {
          "id": "call_...",
          "type": "function",
          "function": {
            "name": "...",
            "arguments": "{\"command\":\"...\",\"description\":\"...\"}"
          }
        }
      ]
    },
    {
      "role": "tool",
      "content": "Command: ...\nDescription: ...\nExit Code: 0\nStdout: ...\nStderr: ...",
      "tool_call_id": "call_..."
    },
    {
      "role": "user",
      "content": "..." // next user message
    }
  ],
  "tools_count": 10,
  "tools": ["run_shell_command", "list_directory", "read_file", ...]
}

So yeah, I just send this JSON structure directly to the API server - no custom parsing needed on my end.

Your simplified format looks really clean for rapid development! Actually I've also encountered some problems with the tool usage formats when switching between deepseek, gemini, and anthropic APIs. The parentheses handling for multiline strings is definitely a challenge. Since my primary focus is on replicating the thinking and planning ability of Claude Code, I haven't devoted much time to the tool calling format yet. Thanks for your sharing and I'll keep an eye on this part!

My experience: I'm an NLP researcher working on LLM for Code (e.g. the SWE-bench task), so I've been exploring different approaches in LLM agent planning and tool calling. I hope the Terminal-Agent project can serve as a starting point for the community to enable more advanced features in coding agents that work in the terminal, developing from the ground up.

BTW, if you're interested in joining our project development, we can share some API budget and GPU support (although the GPU part may not be useful, lol) to work together and make the agent more powerful! ๐Ÿš€