What is Hackers' Pub?

Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed.

0

Jaeyeol Lee shared the below article:

Subagent는 Tool Use입니다.

자손킴 @jasonkim@hackers.pub

지난 글에서는 Tool Use가 무엇이고 어떻게 동작하는지 알아보았다. 이번 글에서는 subagent가 Tool Use 위에서 어떻게 동작하는지 알아볼 것이다.

Tool Use 정리

Subagent 설명에 앞서 Tool Use를 간단히 정리해보고 넘어가자.

┌─────────────────────────────────────────────────────────────┐
│                        메인 메시지 루프                         │
│                                                             │
│   ┌──────┐    request     ┌─────────┐    API call   ┌─────┐ │
│   │ User │ ─────────────► │  Agent  │ ────────────► │ LLM │ │
│   │      │ ◄───────────── │         │ ◄──────────── │     │ │
│   └──────┘    response    │         │   tool_use    └─────┘ │
│                           │    │    │                       │
│                           │    ▼    │                       │
│                        ┌──────────────┐                     │
│                        │    Tools     │                     │
│                        │ (Bash, Read, │                     │
│                        │  Glob, ...)  │                     │
│                        └──────────────┘                     │
└─────────────────────────────────────────────────────────────┘

Tool Use는 LLM이 외부 도구를 호출할 수 있게 해주는 메커니즘이다. Agent는 LLM에게 사용 가능한 도구 목록을 제공하고 LLM은 필요할 때 tool_use 응답을 반환한다. Agent는 해당 도구를 실행하고 결과를 다시 LLM에게 전달한다. 이 과정이 반복되면서 복잡한 작업을 수행한다.

Subagent란?

Subagent는 특정 작업에 특화된 AI 에이전트다. 각 subagent는 자신만의 컨텍스트 윈도우에서 독립적으로 작동하며 완료되면 결과를 메인 에이전트에게 반환한다.

Claude Code에서 subagent는 Task라는 도구로 구현되어 있다. 메인 에이전트의 시스템 프롬프트에는 Task 도구의 description으로 사용 가능한 모든 subagent 목록과 각각의 용도가 포함된다. 메인 에이전트는 이 description을 참고하여 적절한 subagent를 선택한다. 예를 들어 "코드베이스 구조 파악"이 필요하면 Explore를, "데이터베이스 스키마 설계"가 필요하면 database-schema-architect를 호출한다.

Subagent의 구조

Subagent는 마크다운 파일로 정의되고 YAML frontmatter에 다음과 같은 설정을 포함한다.

---
name: code-reviewer
description: Expert code review specialist. Use immediately after writing or modifying code.
tools: Read, Grep, Glob, Bash
model: sonnet
---

You are a senior code reviewer ensuring high standards of code quality and security.

When invoked:
1. Run git diff to see recent changes
2. Focus on modified files
3. Begin review immediately

Review checklist:
- Code is simple and readable
- Functions and variables are well-named
...

각 필드의 역할은 다음과 같다:

필드 설명
name subagent의 고유 식별자
description 언제 이 subagent를 사용해야 하는지 설명
tools 이 subagent가 사용할 수 있는 도구 목록
model 사용할 모델 (sonnet, opus, haiku 또는 inherit)

YAML frontmatter 아래의 마크다운 본문이 subagent의 시스템 프롬프트가 된다. 이 프롬프트는 subagent가 호출될 때 API 요청의 system 필드에 주입되어 subagent의 행동을 정의한다.

이 subagent 정의는 메인 에이전트의 시스템 프롬프트에 있는 tools 섹션의 Task 도구 설명에 포함된다:

{
  "name": "Task",
  "description": "Launch a new agent to handle complex, multi-step tasks autonomously.

Available agent types and the tools they have access to:
- Explore: Fast agent specialized for exploring codebases. (Tools: All tools)
- Plan: Software architect agent for designing implementation plans. (Tools: All tools)
- database-schema-architect: Use this agent when you need to design database schemas...
...
"
}

Task 도구의 input schema는 다음과 같다:

{
  "type": "object",
  "properties": {
    "subagent_type": {
      "type": "string",
      "description": "The type of subagent to launch"
    },
    "prompt": {
      "type": "string",
      "description": "The task to delegate to the subagent"
    },
    "description": {
      "type": "string",
      "description": "Short description of what the agent will do"
    }
  }
}
  • subagent_type: 호출할 subagent 종류 (Explore, Plan, general-purpose 등)
  • prompt: subagent에게 전달할 작업 지시. 이 내용이 subagent의 user 메시지가 된다
  • description: 3-5단어의 짧은 요약. 로그나 UI에 표시된다

Subagent 호출 과정

실제 메시지 흐름을 통해 subagent가 어떻게 동작하는지 살펴보자.

1단계: 메인 에이전트가 Task 도구 호출

사용자가 "선물을 주고받는 기능을 위한 entity 설계"를 요청했다고 하자. 메인 에이전트(Opus 4.5)는 먼저 코드베이스를 탐색해야 한다고 판단하고 Explorer subagent를 호출한다:

{
  "content": [
    {
      "type": "thinking",
      "thinking": "사용자가 선물을 주고받는 기능을 위한 entity 설계를 요청했습니다. Plan mode가 활성화되어 있으므로, 먼저 코드베이스를 탐색하여 기존 구조를 이해해야 합니다.\n\nPhase 1에 따라:\n1. 기존 entity 구조와 패턴을 이해하기 위해 Explore agent를 사용\n2. 선물 관련 기존 구현이 있는지 확인\n3. 사용자와 아이템 관련 entity가 어떻게 구성되어 있는지 파악\n\n먼저 Explore agent를 사용하여 기존 entity 구조를 파악하겠습니다."
    },
    {
      "type": "text",
      "text": "선물 주고받기 기능을 위한 entity 설계를 시작하겠습니다. 먼저 기존 코드베이스의 entity 구조와 관련 패턴을 탐색하겠습니다."
    },
    {
      "type": "tool_use",
      "id": "toolu_01QjShG7gnF36vLgGKCWBNjg",
      "name": "Task",
      "input": {
        "subagent_type": "Explore",
        "prompt": "이 NestJS TypeScript 프로젝트에서 entity 구조를 탐색해주세요:\n\n1. 기존 entity 파일들의 위치와 구조 파악...",
        "description": "Entity 구조 탐색"
      }
    }
  ]
}

thinking 블록에서 메인 에이전트는 현재 상황(Plan mode 활성화)을 파악하고 Explore agent를 선택한 이유를 명시적으로 추론했다.

2단계: 새로운 메시지 루프에서 Subagent 실행

Agent는 Task 도구 호출을 받으면 완전히 새로운 메시지 루프를 시작한다. 이 때 위에서 보았던 YAML frontmatter 하단의 마크다운 본문이 subagent 전용 시스템 프롬프트로 주입된다.

{
  "model": "claude-haiku-4-5-20251001",
  "system": [
    {
      "type": "text",
      "text": "You are Claude Code, Anthropic's official CLI for Claude."
    },
    {
      "type": "text",
      "text": "You are a file search specialist for Claude Code...

=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
- Creating new files
- Modifying existing files
- Deleting files
...

Your strengths:
- Rapidly finding files using glob patterns
- Searching code and text with powerful regex patterns
- Reading and analyzing file contents
..."
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": "<system-reminder>\nAs you answer the user's questions, you can use the following context:\n# claudeMd\nCodebase and user instructions are ... <system-reminder>"
    },
    {
      "role": "user",
      "content": "이 NestJS TypeScript 프로젝트에서 entity 구조를 탐색해주세요..."
    }
  ],
  "tools": [
    {"name": "Bash", ...},
    {"name": "Glob", ...},
    {"name": "Grep", ...},
    {"name": "Read", ...}
  ]
}
  • 모델: Explorer는 빠른 탐색을 위해 Haiku 4.5를 사용한다 (메인은 Opus 4.5)
  • 시스템 프롬프트: 읽기 전용 모드로 제한된 전용 프롬프트가 주입된다
  • 도구 제한: 메인 에이전트가 가진 모든 도구가 아닌, 탐색에 필요한 도구만 제공된다
  • CLAUDE.md 전달: 프로젝트의 CLAUDE.md 내용이 user 메시지의 <system-reminder> 태그 안에 포함되어 전달된다. 따라서 subagent도 프로젝트 컨벤션을 따른다
  • 메시지: 메인 에이전트의 prompt가 user 메시지로 전달된다

3단계: Subagent의 도구 사용

Subagent도 자신만의 메시지 루프에서 도구를 사용한다:

{
  "content": [
    {
      "type": "text",
      "text": "이 NestJS 프로젝트의 entity 구조를 철저하게 탐색하겠습니다."
    },
    {
      "type": "tool_use",
      "id": "toolu_01VHysdohmuy9r58aVdcUQRh",
      "name": "Glob",
      "input": {
        "pattern": "**/*.entity.ts"
      }
    },
    {
      "type": "tool_use",
      "id": "toolu_01QYrMBhzbXpExYwgCFM7MLb",
      "name": "Bash",
      "input": {
        "command": "find /Volumes/project/src -type f -name \"*.ts\" | grep -E \"(entity|entities)\" | head -20",
        "description": "Find entity files in src directory"
      }
    }
  ]
}

Explorer subagent는 두 개의 도구를 병렬로 호출했다. Glob으로 entity 파일 패턴을 찾고 Bash로 디렉토리를 탐색한다. 이 과정이 반복되면서 subagent는 필요한 정보를 수집한다.

4단계: Subagent 완료 및 결과 반환

Subagent가 탐색을 완료하면 수집한 정보를 정리하여 최종 응답을 반환한다. 이 응답은 메인 에이전트의 Task 도구 호출에 대한 tool_result로 전달된다:

┌─────────────────────────────────────────────────────────────────────┐
│                           메인 메시지 루프                              │
│                                                                     │
│  User ──► Agent ──► LLM(Opus)                                       │
│                │                                                    │
│                ▼ tool_use: Task                                     │
│     ┌─────────────────────────────────────────────────────┐         │
│     │           Subagent 메시지 루프 (Explorer)              │         │
│     │                                                     │         │
│     │   prompt ──► Agent ──► LLM(Haiku)                   │         │
│     │                   │                                 │         │
│     │                   ▼ tool_use                        │         │
│     │              ┌─────────┐                            │         │
│     │              │  Glob   │                            │         │
│     │              │  Bash   │                            │         │
│     │              │  Read   │                            │         │
│     │              └─────────┘                            │         │
│     │                   │                                 │         │
│     │                   ▼                                 │         │
│     │              최종 응답                                │         │
│     └────────────────────┬────────────────────────────────┘         │
│                          │                                          │
│                          ▼ tool_result                              │
│                 Agent 계속 진행                                       │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘

메인 에이전트는 Explorer의 조사 결과를 바탕으로 다음 단계(예: database-schema-architect 호출)를 진행한다.

마무리

지금까지 subagent의 동작 방식에 대해서 알아보았다. 핵심을 정리하면:

Subagent는 Tool Use다. 메인 에이전트가 Task 도구를 호출하면, 새로운 메시지 루프가 생성되어 전용 시스템 프롬프트와 제한된 도구로 작업을 수행한다.

왜 사용하는가?

  • 컨텍스트 분리: 탐색/분석 과정이 메인 대화를 오염시키지 않는다
  • 전문화: 각 subagent가 특정 작업에 최적화된 프롬프트와 도구를 가진다
  • 효율성: 목적에 맞게 가벼운 모델(Haiku)이나 무거운 모델(Opus)을 취사선택

주의할 점:

  • Subagent는 메인 대화 히스토리를 모른다. 필요한 정보는 Task의 prompt에 명시해야 한다 (단, CLAUDE.md는 자동 전달됨)
  • Subagent는 subagent를 호출할 수 없다 (무한 중첩 방지를 위해 Task 도구를 사용하지 않는다.)
  • 각 호출은 새로운 컨텍스트에서 시작한다 (단, resume 파라미터로 이전 대화 이어가기 가능)

결국 subagent는 Tool Use 패턴의 확장이다. 단순한 Function Call이라면 코드 실행 결과를 텍스트로 반환하지만 subagent는 별도의 메시지 루프에서 LLM이 생성한 텍스트를 반환한다는 차이만 있다. 메인 에이전트 입장에서는 둘 다 tool_result로 받는 텍스트일 뿐이다.

Read more →
2

https://www.yna.co.kr/view/AKR20251225037552030

쿠팡 스스로 사람, 증거 다 조사해서 추가 유출 없다는 결론까지 내다니,

전문용어?로 시나리오 쓰고 있네... 버린 맥북까지 찾았다는 부분에서는 웃지도 못하겠다.

저 회사는 얼마나 국가를 우습게 보면 저럴 수가 있나.

0

얘네가 얼마나 무섭냐면... 회사들이 AI 모델 지들끼리만 몰래 학습시키고 있던 시기에 얘네 모델이 유출됨 자 다른 회사였으면 진짜 난리 났을거거든? 막 고소니 뭐니 난리를 떨 거 아냐 근데 조용해 아무 반응도 없고 그래서 사용자들이 어? 써도 되나? 하고 지들이 데이터 모아서 더 학습시킨 모델 올리고 쓰기 좋게 인터페이스도 만들고 이 모델 위주로 사람들이 공부하고 자 그럼 어떻게 돼? 이제 메타는 사람들이 더 학습시킨 모델이랑 인터페이스 갖다 쓰고 공부한 사람들 뽑아서 바로 실무 투입 가능함 진짜 무서운 새끼들이라니까

RE: https://bsky.app/profile/did:plc:7fbikvxjgwiomstwwnd2gp42/post/3mas6qzx4xc2i

0
1
0
1
2
0
0
0
0

게임 만드는 성인 여성입니다...~!! 현재 요리타이쿤 게임 스푸키친( s.team/a/3588570 )을 만들고 있어요!👻🎃 그림, 플밍, 글, 작곡 고루고루 하고, 스타듀밸리, 돈스타브같은 인디 게임을 매우 즐겨 합니다~! 맞구독, 교류 모두 좋아요! 흔적 남겨주시면 무멘팔로 찾아뵐게요🥰

0
1
0
2

You'd think after publishing 9 novels in 13 years, I'd have made my peace w/ the need to promote them.

I'm still conflicted re: anything that smacks of self-promo. I believe in my work. I'm proud of what I write & very much want to share it with readers.

But the work doesn't magically announce itself to the world.

So if you're looking for SF&F books that are earnest, honest, compelling & character focused, give them a try?

2 are free/pay what you will at Gumroad.

ljcohen.gumroad.com/

8 of my 9 novels, spines out. From left to right:

The Between, Changeling's Choice book 1
Time and Tide, Changeling's Choice, book 2

Future Tense (standalone)

Derelict, Halcyone Space book 1
Ithaka Rising, Halcyone Space book 2
Dreadnought and Shuttle, Halcyone Space book 3
Parallax, Halcyone Space book 4
A Star in the Void, Halcyone Space book 5Full front cover of Litany for a Broken World showing an abandoned graffiti marked brick building with golden light pouring from a window. Dwarfed by the building are 2 human figures and a small dog.
0
0
0
1
0
1
1
0
0
3

트위터의 이미지 AI리터칭 기능에서 가장 먼저 우려되는건 사이버불링이다. 누군가의 사진을 제3자가 프롬프트로 손쉽게 수정 가능하고, 거기에 원 사진을 게시한 사람에게 멘션을 바로 보낼 수 있다. 현 트위터 운영진, 특히 머스크가 여기까지 생각해 봤을거라는 믿음은 안든다. 그냥 이렇게 하면 게시물 피드백이 바로바로 갈 수 있으니 더 활성화 될거고 조회수와 노출도도 활성화 되겠지. 정도까지만 생각했으리라 본다. 만약 이 기능의 악용에 대해서 일말의 우려라도 했다면, 최소한 계정 설정이나 게시물 옵션에 "리터칭 비허용"을 넣었을거다.

0
0

Debanking, Vorschlag

Moin, liebe Mitradikalen gegen die Marktradikalen

Also... ich wäre dann soweit fertig damit auf kleine, symptomatische Genossenschaftsbanken einzuprügeln, und würde vorschlagen die Aufmerksamkeit nun u.a. auf Herrn #Merz als "Patient Null" zu richten.

Zugegeben, ob die "Bromance auf den 1. Blick" zw. dem frisch wiedergewählten #Trump und dem frisch zweiterwahlgang-gewählten #Sauertrump nur korreliert, oder ein kausaler Zusammenhang zw.

"es gibt keine linke Politik mehr in Deutschland"

und

"es gibt (bald)
keine linken Bankkonten mehr in Deutschland"

besteht, vermag ich nicht abschließend zu beurteilen

Dazu mögen sich bitte alle "grünen und linken Spinner auf dieser Welt" ihr eigenes #Stadtbild machen.

Aber Fakt ist: Die #Debanking-Seuche hat mit seiner Kanzlerschaft begonnen, nur er hat aktuell die Macht sie zu stoppen, und weil das unwahrscheinlich ist, wäre eine wurzelige (radikale) Problembehandlung #stopptmerz, nicht FCKGLS.

Oder wollen wir gleich einen Schritt weitergehen, und die E.U. neu und in schön machen?

Oder irgendwas anderes außer lauthals über Symptome zu wehklagen, und von anderen Antifa-Handarbeit zu fordern?

[Ich frage für einen Haufen gerechten Zorn, den ich lieber sinnvoll kanalisiert sähe.]

Meta-Hörtipp:
https://wind-und-wurzeln.podigee.io/7-gegen-die-gesellschaftliche-spaltung

0
0

Die GLS Bank ist eine Genossenschaft. Laut Satzung können die Mitglieder der Genossenschaft jederzeit eine ausserordentliche Generalversammlung mit Vorlaufzeit von 2 Wochen einberufen. Dazu bedarf es die Unterschriften von 1/10 der Mitglieder, höchstens jedoch 200 Mitglieder. Die sollten sich doch finden lassen.

Satzung vom 28.06.2025, §27 (2) in Verbindung mit §28 (2)-(4)

1/3

gls.de/media/PDF/Broschueren/G

§ 27 Frist und Tagungsort

[...]

(2) Außerordentliche Generalversammlungen können nach
Bedarf einberufen werden.

§ 28 Einberufung und Tagesordnung

[...]

(2) Die Mitglieder der Genossenschaft können in einem von
ihnen unter­zeichneten Antrag unter Angabe des Zwecks
und der Gründe die Einberufung einer außerordentlichen
Generalversammlung verlangen. Hierzu bedarf es der
Unterschriften mindestens des zehnten Teils der Genos-
senschaftsmitglieder, höchstens jedoch von 200 Mitglie-
dern.
0
0
0

hey heyyy hello fellow pocket people from all around our spinning blue space orb! we are alone together in a vast universe of stardust that defies our own ability to perceive it! but connected through invisible impulses and long cables beneath vast oceans! Im glad to be here with you alive as mammals looking at rectangles tonight! I’m sorry we all must live with so much suffering and hurting! let’s try to use our paltry privileges to help one another as best we can! I love you! hugs!🕊️

0
0
0
1
3
0
0
0
1
0
0
0
0
0
2

우리 블스 아직은 님을 아예 안 보이게 해줄 순 없습니다. 그렇게 했다간 세ㄱ계만 보이는 세계가 됩니다. 트위터가 AI봇만 보이는 상태처럼... 하지만 님이 모르는 사람한테 대뜸 공격당하지 않도록, 님이 아는 사람들이랑만 이야기할 수 있도록 하는 건 지금도 가능하니깐요!!! 님을 안보이게 할 순 없어도 님이 노출되어있어도 공격당하지 않게는 해줄 수 있습니다! 기능 꼭 활용하세요!

RE: https://bsky.app/profile/did:plc:iqga7bwbwbdo4z6suofriwa5/post/3marxqoaclk2h

0
0
0

우리 블스 아직은 님을 아예 안 보이게 해줄 순 없습니다. 그렇게 했다간 세ㄱ계만 보이는 세계가 됩니다. 트위터가 AI봇만 보이는 상태처럼... 하지만 님이 모르는 사람한테 대뜸 공격당하지 않도록, 님이 아는 사람들이랑만 이야기할 수 있도록 하는 건 지금도 가능하니깐요!!! 님을 안보이게 할 순 없어도 님이 노출되어있어도 공격당하지 않게는 해줄 수 있습니다! 기능 꼭 활용하세요!

RE: https://bsky.app/profile/did:plc:iqga7bwbwbdo4z6suofriwa5/post/3marxqoaclk2h

0

트위터의 이미지 AI리터칭 기능에서 가장 먼저 우려되는건 사이버불링이다. 누군가의 사진을 제3자가 프롬프트로 손쉽게 수정 가능하고, 거기에 원 사진을 게시한 사람에게 멘션을 바로 보낼 수 있다. 현 트위터 운영진, 특히 머스크가 여기까지 생각해 봤을거라는 믿음은 안든다. 그냥 이렇게 하면 게시물 피드백이 바로바로 갈 수 있으니 더 활성화 될거고 조회수와 노출도도 활성화 되겠지. 정도까지만 생각했으리라 본다. 만약 이 기능의 악용에 대해서 일말의 우려라도 했다면, 최소한 계정 설정이나 게시물 옵션에 "리터칭 비허용"을 넣었을거다.

0
0
0

일론은 비대한 자아 컨트롤 못할 정도로 멍청해서 그러고 다니는데 마크 주커버그 갸는 자아 컨트롤 가능할 정도로 영악한 새끼라서 더 무서운 거임

RE: https://bsky.app/profile/did:plc:7fbikvxjgwiomstwwnd2gp42/post/3mas6neebt22i

0