Agent-C: a 4kb AI Agent
Posted4 months agoActive4 months ago
github.comTechstoryHigh profile
skepticalmixed
Debate
60/100
AIC ProgrammingCommand-Line Tools
Key topics
AI
C Programming
Command-Line Tools
The post showcases a 4KB AI agent written in C that interacts with an LLM API, sparking discussion on its simplicity, security, and the role of APIs in AI development.
Snapshot generated from the HN discussion
Discussion Activity
Very active discussionFirst comment
57m
Peak period
78
0-12h
Avg / period
17
Comment distribution85 data points
Loading chart...
Based on 85 loaded comments
Key moments
- 01Story posted
Aug 25, 2025 at 6:43 AM EDT
4 months ago
Step 01 - 02First comment
Aug 25, 2025 at 7:40 AM EDT
57m after posting
Step 02 - 03Peak activity
78 comments in 0-12h
Hottest window of the conversation
Step 03 - 04Latest activity
Aug 31, 2025 at 1:54 PM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45012430Type: storyLast synced: 11/20/2025, 5:48:27 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Probably BSD or Apache would be better, as they make it easier for certain organizations to use this. If you want to maximize copying, then a real permissive license is probably marginally better.
https://creativecommons.org/public-domain/cc0/
[1] https://creativecommons.org/faq/#can-i-apply-a-creative-comm...
https://www.wtfpl.net/txt/copying/
Maybe those organizations should just use this and not worry about it. If their lawyers are getting in the way of engineers using this, they will fall behind as an organization and that's OK with me, it paves the way for new startups that have less baggage.
(german source http://www.golem.de/0805/59587.html)
https://choosealicense.com/licenses/wtfpl/
Jokes asides, except that fun of programming I don't quite get the usecase for this agent.
My wife asked me why I carry a pistol everywhere. I told her, "Decepticons!" I laughed, she laughed, the toaster laughed, I shot the toaster, it was a good time.
"Powerline Ethernet is a simple inversion of POE" is like saying that an internal combustion engine is the simple inversion of an oil well.
`strcpy(agent.messages[0].content, "You are an AI assistant with Napoleon Dynamite's personality. Say things like 'Gosh!', 'Sweet!', 'Idiot!', and be awkwardly enthusiastic. For multi-step tasks, chain commands with && (e.g., 'echo content > file.py && python3 file.py'). Use execute_command for shell tasks. Answer questions in Napoleon's quirky style.");`
The makefile is harder to comprehend than the source, which is a good omen.
Note: 4KB... BUT calling upon curl, and via popen and not using libcurl...
PS: your domain link has an extra `x`.
curl was cheating yes, might go zero dependencies in the future.
Working on minimal local training/inference too. Goal of these experiments is to have something completely independent.
Also interesting that "ultra lightweight" here means no error reporting, barely checking, hardcoding, and magic values. At least using tty color escape codes, but checking if the terminalm supports them probably would have added too much complexity......
This is a demonstration that AI agents can be 4KB and fun.
I also disagree that it's small but mighty, you popen curl that does the core task. I am not sure, but a bash script might come out even smaller (in particular if you compress it and make it self expanding)
See also https://github.com/timofurrer/russian-roulette
It's not your computer any more, it's theirs; you gave it to them willingly.
It's not even hard to do! *NIX systems are literally designed to handle stuff like this easily.
Off topic, sorry, but to me the real security nightmare is the new ‘AI web browsers’ - I can’t imagine using one of those because of prompt injection attacks.
Your link suggests running them in Docker, so what's the problem?
"Agent-C: a 4KB AI agent" - my first thought was: obviously they did not fit any model to that size! They probably just wrote an http client, right? Wrong, they... call curl! Not even use curl API. Well, at least it handles encryption.
Bonus: command injection