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
0
0
0

Claude Code Hook으로 영어 공부하기 https://torch.vision/posts/claude-english-lecturer-hook

좋은 글

profile image

Claude Code Hook으로 영어 공부하기

배경 설명 평소에 영어로 프롬프트를 작성하면 모델이 더 좋은 성능을 보일 것이라고 생각하였고 겸사겸사 영어에 더 익숙해지기 위해서 되도록 Claude Code, Codex 등을 사용할 때는 영어로 prompt를 작성하였습니다. 그러나 이 경우에 부족한 영어 실력 때문에 의미나 뉘앙스가 잘못 전달되는 경우가 종종 있었습니다. 처음에는 prompt rewriter를 만들어서 기존 프롬프트를 자동으로 교정된 버전으로 대체하는 hook을 만들려고 했습니다. 하지만 Claude Code의 hook 시스템은 기존 프롬프트를 수정하는 것이 아니라 추가적인 프롬프트만 제공할 수 있었습니다. 또한 추가적인 프롬프트 제공도 완벽하지 않다는 이슈들이 있어 실제로 적용하는 데 어려움이 있었습니다. issue link 그러다 jiun.dev의 글에서 영어 공부용으로 hook을 활용하는 아이디어를 얻었고, 이를 참고해서 영어 공부용으로 수정해보기로 했습니다. 구현 저는 모델 성능 저하를 최소화하고 싶었기 때문에 메인 프롬프트에 context가 주입되지 않는 것이 이상적이었습니다. 이를 위하여 2가지 방법을 사용하였습니다. 메인 Claude Code 프로세스에서 영어 공부 프롬프트를 처리하지 않고 별도의 Claude Code 서브 프로세스에서 non-interactive모드와 structured output을 사용하여 처리하도록 하였습니다. hook의 output으로 systemMessage를 사용하여 유저에게만 메시지가 보일 수 있도록 하였습니다. (관련 claude code 문서) 이때 별도의 Claude Code 프로세스를 non-interactive 모드로 실행하더라도 hook이 주입되기 때문에 환경변수를 통해 아주 간단한 LOCK을 구현하였습니다. disableAllHooks 옵션을 통해 hook을 비활성화 할 수 있으나 이 경우에 structured output이 필요로하는 SDK hook이 동작하지 않아 structured output을 받을 수 없습니다. 설정 방법 1. 스크립트 설치 아래 스크립트를 ~/.claude/english-lecturer.sh로 저장합니다. ( 제 dotfiles 레포에서도 확인가능합니다 ) #!/bin/bash # acknowledge: https://github.com/crescent-stdio for prompt if [[ -n "$REWRITER_LOCK" ]]; then exit 0 fi INPUT_PROMPT="$(cat | jq '.prompt')" TARGET_LANGUAGE="Korean" JSON_SCHEMA=' { "type": "object", "properties": { "enhanced_prompt": { "type": "string", "description": "The improved prompt preserving original meaning" }, "has_corrections": { "type": "boolean", "description": "Whether the original prompt had any issues to improve" }, "corrections": { "type": "array", "items": { "type": "object", "properties": { "original": { "type": "string" }, "suggestion": { "type": "string" }, "category": { "type": "string", "enum": ["grammar", "vocabulary", "style", "spelling", "word_order"] }, "explanation": { "type": "string" } }, "required": ["original", "suggestion", "category", "explanation"] }, "description": "Gentle improvement suggestions, max 3 items" }, "tip": { "type": "string", "description": "One concise learning tip" } }, "required": ["enhanced_prompt", "has_corrections", "corrections", "tip"] } ' INPUT_PROMPT="\ You are a supportive, encouraging English coach for a $TARGET_LANGUAGE developer. Analyze the prompt below and return structured JSON. Rules: 1. enhanced_prompt: Rewrite to be clear, natural, professional English. Preserve the original intent exactly. If the prompt is code-only or already perfect English, return it unchanged. 2. has_corrections: true if you made any meaningful improvements, false if the prompt was already correct or is pure code/commands. 3. corrections: List up to 3 gentle improvement suggestions. Each must have: - original: the phrase from the original prompt - suggestion: the improved phrase - category: one of grammar, vocabulary, style, spelling, word_order - explanation: brief explanation in $TARGET_LANGUAGE (1 sentence, max 20 words). 4. tip: One memorable tip in $TARGET_LANGUAGE (1 sentence, max 30 words) about the most useful pattern. If no corrections, share a useful English expression tip. Focus on patterns $TARGET_LANGUAGE speakers commonly struggle with: articles (a/the), prepositions, singular/plural, tense consistency, word order. <PROMPT> $INPUT_PROMPT </PROMPT>\ " RESPONSE="$( \ REWRITER_LOCK=1 claude \ --no-session-persistence \ --model sonnet \ --output-format json \ --json-schema "$JSON_SCHEMA" \ -p "$INPUT_PROMPT" )" STRUCTURED_OUTPUT="$(echo "$RESPONSE" | jq -r '.structured_output')" # echo 'This is lesson message for user. Assistant should dismiss it.' if [[ -z "$STRUCTURED_OUTPUT" || "$STRUCTURED_OUTPUT" == "null" ]]; then OUTPUT_PROMPT="Failed to generate lesson." exit 0 fi ENHANCED="$(echo "$STRUCTURED_OUTPUT" | jq -r '.enhanced_prompt')" HAS_CORRECTIONS="$(echo "$STRUCTURED_OUTPUT" | jq -r '.has_corrections')" TIP="$(echo "$STRUCTURED_OUTPUT" | jq -r '.tip')" OUTPUT_PROMPT="$ENHANCED" if [[ "$HAS_CORRECTIONS" == "true" ]]; then CORRECTIONS_DISPLAY="$(echo "$STRUCTURED_OUTPUT" | jq -r ' .corrections[] | "- ✅ \(.category): \(.original) → \(.suggestion)\n - \(.explanation)\n" ')" OUTPUT_PROMPT="$OUTPUT_PROMPT $CORRECTIONS_DISPLAY" fi OUTPUT_PROMPT=" $OUTPUT_PROMPT ✨ $TIP" OUTPUT_PROMPT="$(echo -e "$OUTPUT_PROMPT")" # escape newlines OUTPUT_PROMPT="${OUTPUT_PROMPT//$'\n'/\\n}" # escape double quotes OUTPUT_PROMPT="${OUTPUT_PROMPT//\"/\\\"}" echo "{ \"suppressOutput\": false, \"systemMessage\": \"$OUTPUT_PROMPT\" }" exit 0 2. 설정 파일 수정 ~/.claude/settings.json에 다음 내용을 추가합니다. { "hooks": { "UserPromptSubmit": [ { "hooks": [ { "type": "command", "command": "~/.claude/english-lecturer.sh" } ] } ] } } 혹은 아래 명령어를 실행합니다. jq '.hooks.UserPromptSubmit = ((.hooks.UserPromptSubmit // []) + [{"hooks": [{"type": "command", "command": "~/.claude/english-lecturer.sh"}]}])' ~/.claude/settings.json > /tmp/settings.json && mv /tmp/settings.json ~/.claude/settings.json 3. 커스터마이징 스크립트 내의 다음 변수들을 수정해서 동작을 변경할 수 있습니다. TARGET_LANGUAGE: 문법 설명의 언어 (기본값: “Korean”) JSON_SCHEMA: Claude로부터 받을 응답의 구조 (프롬프트를 크게 변경하지 않는다면 수정이 필요하지 않습니다) 사용 모델 (기본값: “sonnet” / haiku의 경우 빠르긴 하나 성능이 떨어졌습니다) 이제 프롬프트를 제출할 때마다 자동으로 교정된 버전과 짧은 문법 설명을 받을 수 있습니다. Appendix: change log 2026/02/06: Claude Code에 추가된 systemMessage 기능 사용-history toggle 없이 표시, --no-session-persistence 옵션 추가 2026/02/02: 프롬프트 개선 2026/01/31: 포스트 첫 작성

torch.vision · Lab of ryul99

2
0
0

?

“Israeli forces strike residential building in Gaza, killing at least three Palestinians” [ ± 1-3 min]
by MiddleEastEye

youtube.com/shorts/GjNbVL1N0bE

Quote by MEE:
“Jan 31, 2026
An Israeli air strike hit a residential building in Gaza City on Friday, killing at least three Palestinians, including a child, local sources reported, violating the ceasefire.
There have been over 1,300 reported violations committed by Israel since the start of the ceasefire, with close to 500 Palestinians killed.
A truce secured by US President Donald Trump in October was intended to end more than two years of genocide in Gaza, which destroyed nearly 90 percent of the territory’s infrastructure.“




0

_Why_, in sed and perl, does the s/foo/bar/ syntax default to substituting just one occurrence, and not all of them?

I can't immediately remember any situation where that was specifically what I wanted. And I can remember lots of situations where I was caught out by forgetting to add the 'g' flag on the end. (One of them three minutes ago, oddly enough.)

Why isn't 'g' the default, and 'only substitute once' a special option you have to select?

0
0
0
0
0
0
0
0
0

Things I learned from FOSDEM / Guix Days:

- The MNT and Guix communities feel like they have a lot of overlap AND THEY DO
- The pocket reform is awesome and Guix users know it
- Everyone agrees purple is the best color (thank you I will not be soliciting further opinions on paint for the bikeshed at this time)

0
0

📆 25 February 2026
W3C Workshop on Smart Voice Agents, A virtual event with talks and interactive sessions.

Voice agents are essential applications on mobile phones, tablet devices, eBook readers, and gaming platforms.

Discussions will include: Voice interaction with smart devices also in the Web of Things; Control from Web browsers; and Interoperability and access to controls for accessibility/usability, e.g., smart cities

w3.org/events/workshops/2026/w

Header image for "W3C Workshop on Smart Voice Agents, February 2026, Virtual on Zoom"
0
0

Just had a salad that was so big, christian god saw it as a testament to collective human unity and, as with the Tower of Babel, smote and confounded me, scattering my mind into a million different voices, to teach me humility and the dangers of hubris.

0
0

지금 피겨 단체 방송을 JTBC 본채널이 아닌 JTBC스포츠 채널에서 하고 있는데.. 본채널은 지난 올림픽 재방송 중이다,. 이게 맞냐 JTBC야.. 심지어 좌측 하단 점프맵 자막을 가리기도 해서 여러모로 난감하다 아니 자막 위치 확인 안해..? 그리고 또 한가지.. 뭐 JTBC가 자체적으로 자막 등 OAP 면에서 자체 디자인 규격이 있는 건 알겠다만 올림픽 공식 방송의 둥근 테두리 느낌과 좀 맞추면 좋지 않을까? … 아니 뭐 4K UHD방송 신호도 못만드는 건 이해는 하겠다만..

0
0
0
0
0
0
0
0
0
0
0
0

아무 도움이나 청하지 마세요.

아무 손이나 잡지 마세요.

아무 돈이나 받지 마세요.

피와 땀과 눈물이 배어 있는 않은 열매는

독성이 숨어 있어 언젠가 나를 해칩니다.

May be an image of text that says '아무 도움이나 청하지 마세요. 아무 손이나 잡지 마세요. 아무 돈이나 받지 마세요. 피와 땀과 눈물이 배어 있는 않은 열매는 독성이 숨어 있어 언젠가 나를 해칩니다.'
0

“[Israel is] being hounded out of Lebanon, [its] freedom to operate within Syria has been halted. All that’s left to [Israel] is the freedom to kill Palestinians, and with Qatar, Turkiye and Egypt now being involved in Gaza, over Israel’s objection, it won’t be allowed to do that for much longer.”

Ori Goldberg

aljazeera.com/news/2026/2/4/so


0
0

어쨌든, Windows 11 Home 환경에서도 아무 문제 없이 돌아갑니다.

물론 프로필키 드라이버 깔기 위해서 Windows 메모리 부트-시간 및 실시간 무결성 검사를 꺼야 했습니다.

2

Wickは一人につき複数いいねをうてるので、認知的にイリュージョンが起きそう
実際にいいねしてくれた人の数は頑張れば通知から数えられるけど、概して÷3~÷4くらいにして考えるべきかも

0
1
1
2
0

Capitalism has convinced people that new always equals “better” so if you want to rebel against Capitalism start to recognize that “new” is often just a way to extract more money from you.

Existing (or “old”) things can be functional and beautiful, and often easier to repair.

The word “old” should not be an insult. Not to things or to people.

0
0
0
0
0
0
1
0

LB: a ideia de trazer uma cena local inteira pro Fediverso é genial. Trazer as bandas, os lugares que rolam os shows, os artistas, fazedores de camiseta, adesivos, zines...

Acho o trampo do pessoal da punkstodon.de mto foda, pq eles criaram as instâncias de mastodon, pixelfed e peertube, e ai vão fazendo oficinas nos shows e trocando ideia no boca a boca com a galera da cena pra virem pra cá e largarem as redes corporativas.

Isso tira aquela sensação de ser uma rede vazia pq meio que a galera já se conhece na vida real, e divulga o que ta rolando na cena local por aqui ao invés de fazer pela meta.

Me lembrou o comentário do @karibokaVitu outro dia sobre os anarquistas virem com muito mais facilidade pra cá do que outros grupos. Seria um sonho fazer um projeto assim com a cena brasileira

Dêem uma sacada em punx.social

Outras cenas punks começaram a fazer coisas parecidas, criando instâncias locais que funcionam como uma porta de entrada pro Fediverso

@fediverseFediverso

0

Daum (Kakao) 우편번호 서비스 도메인 & JS API 네임스페이스 변경 안내 (사전 공지)

https://github.com/daumPostcode/QnA/issues/1498

GeekNews에도 올리기는 했는데, 아무래도 국내 서비스에는 영향을 받는 곳이 많다보니, Hackers' Pub에도 공유해 둡니다.

  1. 공식 가이드 페이지
  1. CDN 도메인 변경 (적용 완료)
  1. 서비스 도메인 변경 일정 (예정)
  1. JavaScript API 네임스페이스 변경 안내
  • 기존 new daum.Postcode({...
  • 변경 new kakao.Postcode({...
  1. 서비스 종료 예정 도메인 안내 (중요)
  1. 도메인 변경 사전 안내 및 네임스페이스 변경에 대한 안내
  • 기존 도메인 종료에 대한 상세 일정은 3월 10일 전후 공지에서 다시 안내
  • 서비스 중단 방지를 위해 사전 점검 및 점진적 전환을 권장
2