惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
C
Cisco Blogs
博客园 - 叶小钗
P
Privacy International News Feed
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
T
Threatpost
IT之家
IT之家
博客园 - 聂微东
Know Your Adversary
Know Your Adversary
Help Net Security
Help Net Security
罗磊的独立博客
I
Intezer
S
Schneier on Security
博客园_首页
C
CERT Recently Published Vulnerability Notes
雷峰网
雷峰网
Cisco Talos Blog
Cisco Talos Blog
宝玉的分享
宝玉的分享
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Webroot Blog
Webroot Blog
TaoSecurity Blog
TaoSecurity Blog
MyScale Blog
MyScale Blog
P
Privacy & Cybersecurity Law Blog
T
The Exploit Database - CXSecurity.com
PCI Perspectives
PCI Perspectives
Security Latest
Security Latest
H
Heimdal Security Blog
S
Secure Thoughts
Hacker News: Ask HN
Hacker News: Ask HN
Y
Y Combinator Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Microsoft Security Blog
Microsoft Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
SecWiki News
SecWiki News
The GitHub Blog
The GitHub Blog
A
Arctic Wolf
A
About on SuperTechFans
aimingoo的专栏
aimingoo的专栏
T
Threat Research - Cisco Blogs
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders How to Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A Mac Studio for Local AI — 6 Months Later A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
GitHub - budhasantosh010/ai-coding-project-templates: Stop Claude Code and Codex forgetting your project mid-build. Drop-in memory + governance templates that write your decisions to disk and inject them back every session, even after a context compaction.
realsanb · 2026-06-24 · via Hacker News - Newest: "AI"

A coding agent forgets. Halfway through a build the context compacts, and suddenly it's re-asking things you settled an hour ago or quietly ignoring a rule you set on day one. These are two drop-in templates — one for Claude Code, one for Codex — that fix that by keeping the project's memory in files and feeding it back to the agent automatically.

ai-coding-project-templates/
├─ claude-project-template/   for Claude Code   (rulebook = CLAUDE.md,  hook via .claude/settings.json)
└─ codex-project-template/    for OpenAI Codex  (rulebook = AGENTS.md,  hook via .codex/hooks.json)

Both folders are the same system. The only differences are the rulebook filename and how each agent registers hooks.

Table of contents

  • What problem do these solve?
  • Pick your agent
  • Install (per project)
  • How recall is forced, not hoped-for
  • Looking things up by meaning (recall)
  • Staying pointed at the goal
  • The decision tree (see it, and roll back to it)
  • What's inside each template
  • Optional companion: graphify
    • Does graphify auto-fire from these templates?
    • Install once, build per project
    • Does it cost money?
    • You probably don't need the paid step
  • License

What problem do these solve?

Four things that go wrong on any long-running agent session, and what the template does about each:

Without                                 With
───────                                 ────
Forgets between sessions; you           Every message, decision and change lands in DOCS/,
re-explain the project constantly.      so a fresh session reloads the full context.

"Done" means "the code exists,"         "Done" means a passing test or a real run (E0–E5),
even if it never ran.                   not just code that imports.

Same error retried forever.             Three strikes on the same failure → stop and diagnose.

Silent fallbacks; lost reasoning.       Fallbacks must be stated. Decisions and failures are
                                        logged with the test that stops them returning.

Pick your agent

You use Open this folder Rulebook
Claude Code (CLI / VS Code / desktop) claude-project-template/ CLAUDE.md
OpenAI Codex (CLI / VS Code / desktop) codex-project-template/ AGENTS.md

Install (per project)

Do this once per project, when you copy the template in:

  1. Copy your folder's contents into the project root.
  2. Fill in the <PROJECT_NAME> / <PROJECT_ROOT> / <OWNER> / <DATE> placeholders.
  3. Open the project in your agent and trust its hooks.
  4. Run both hooks/verify_*.ps1 checks — they should all pass.
  5. Paste the first-session block from DOCS/STARTUP_MESSAGE.md into the first chat. (The prompts are also collected in START_HERE.md.)

How recall is forced, not hoped-for

Saving context to a file is the easy half. The hard half is getting the agent to actually look at it once the conversation has moved on. Telling it "check DECISIONS.md when unsure" is a sign on the wall — it can walk right past it.

So the templates don't rely on that. Three hooks read your files and push the relevant bits back into the agent's view at the moments it tends to forget:

when                            hook                      what it puts back
────                            ────                      ─────────────────
session starts or compacts      inject_context            CURRENT_STATE + the DEC/REQ/FAIL list
you send a message              inject_on_prompt          the active rules + "read the transcript"
right before an edit            inject_decisions_preedit  the active DEC/REQ rules, at the edit

The point: "we use pnpm, not npm" stops depending on the model remembering it. The rule is on screen at session start, on every message, and again right before the agent writes the install command. A hook can't be skipped, so the information is guaranteed to be there. And they all fail safe — if a hook errors it prints nothing and never blocks your session.

Looking things up by meaning (recall)

Re-injecting your rules handles the recent stuff. But what about "what did we decide about pricing three months ago?" — buried in a long transcript, maybe phrased with different words. That's what the recall hook (recall.ps1, on every message) does, and it's built to cost almost nothing:

1. Does the message even look back? ("remember…", "earlier", "that bug", "it/this")
   No  → do nothing. 0 tokens. (most messages)
   Yes → continue.
2. Resolve vague words: "find it" → the most-mentioned recent thing.
3. Search, cheapest first:
     tier 1  keyword over decisions + transcript        (free, instant)
     tier 2  semantic by meaning — ONLY if tier 1 weak  (local model; "login" finds "auth")
4. Verify: if the hit names a file, grep the CURRENT file → CONFIRMED or STALE.
5. Inject a tiny cited pointer (~40 tokens): "DEC-004 (msg 7): pnpm only [CONFIRMED]"
     …or, if nothing matched: "not found" — so the agent says so instead of inventing an answer.

Two things make this trustworthy: it cites where the answer came from (decision id, message number, file), and it admits when it doesn't know rather than hallucinating. The expensive semantic step only runs when the cheap keyword step comes up short — so on a normal message the recall layer is silent and free.

Semantic search is optional. It switches on only if you install one library (uv pip install sentence-transformers, or pip install --user sentence-transformers). Without it, recall works in keyword mode and everything still runs. The embedding model runs locally on your CPU — zero API cost either way.

Staying pointed at the goal

A separate hook (goal_convergence.ps1, after each turn) keeps score against your ROOT goal. It reads the active decisions, open blockers, and whether recent work still overlaps the goal, then writes a one-line status — ON-TRACK, DRIFTING, or BLOCKED — to DOCS/GOAL_STATUS.md, and surfaces it only when it changes. It's a cheap code proxy (zero tokens), so it's an early-warning flag, not a verdict; for the real "are we actually there?" judgment you ask the agent directly at a milestone.

The decision tree

A long project is really a tree of decisions: one goal, a fork with a few options, you pick one, that becomes the new trunk, it forks again. Markdown is a bad shape for reading that — a flattened list loses which branch came from which fork. So the template also keeps the decisions as a tree you can actually look at.

Every real decision the agent makes is appended to DOCS/_raw/decisions.jsonl (with the user message number it came from, the options that were on the table, which was chosen, and the git commit at that moment). After each turn a hook redraws three views — all pure scripting, zero model tokens:

DOCS/decision_tree.txt        the big picture as text: a left "main goal" spine, every
                              decision branching off it, options fanning out, the picked one
                              marked, down to a goal-check box. Code-drawn, so the layout is
                              exact and never shifts.
DOCS/decision_tree/msg_*.svg  one small clean picture PER message (renders cleanly because
                              it's small). Append-only — the folder IS your history.
DOCS/decision_tree_FULL.txt   every user message in tree shape, each tagged with the decision
                              it produced or "(no decision)". The complete timeline.
DOCS/decision_tree_history/   timestamped snapshots of the text views before each redraw.

The text big-picture looks like this:

[ROOT] MAIN GOAL: never lose work across sessions
  |
  +-- {MSG 3}  session recovery     ( manual-copy )  <PICKED: bridge-tool>  ( ignore )
  +-- {MSG 7}  template strategy     ( memory-only )  <PICKED: governance>   ( hybrid )
  +-- {MSG 12} fix recall            ( instructions ) <PICKED: injection-hooks>
  v
[ROOT] EXPECTED FINAL GOAL  →  |GOAL CHECK| how close are we?

(The tree shows only the messages where a real decision was made — the forks. Every message, decision or not, is still in DOCS/_raw/user_messages.txt and in the FULL timeline.)

The picture is for you. But it's also how you direct the agent without ambiguity. Instead of "go back to where we decided that thing," you point at a node:

You:   "DEC-003 was the wrong call — roll back to it."
Agent: hooks/rollback_to_decision.ps1 -Id DEC-003 -Apply
       → git-reverts to that decision's stored commit, redraws the tree, marks later
         decisions superseded. Deterministic — the commit hash is the single source of truth.

You can point by decision id (-Id DEC-003) or by message number (-Msg 48) — both resolve to one exact commit, so there's nothing for the agent to guess. (Rollback needs git in the project; the agent always previews before applying.)

What's inside each template

<root>/
├─ CLAUDE.md / AGENTS.md   the rulebook the agent auto-loads
├─ .claude/ or .codex/     wires up the logging + injection hooks
├─ hooks/
│   ├─ log_user_message.ps1          saves every message word-for-word (+ numbers them)
│   ├─ inject_context.ps1            re-injects the spine on start / after compaction
│   ├─ inject_on_prompt.ps1          injects active rules with every message
│   ├─ inject_decisions_preedit.ps1  injects active rules right before an edit
│   ├─ recall.ps1                    looks up the past on a look-back message (keyword + semantic)
│   ├─ embed.py                      optional local semantic embedder ($0, by-meaning search)
│   ├─ index_semantic.ps1            incrementally indexes new content for semantic recall
│   ├─ record_decision.ps1           logs a decision (msg#, options, chosen, git commit)
│   ├─ render_decision_tree.ps1      draws the text + per-message SVG + FULL timeline
│   ├─ rollback_to_decision.ps1      "roll back to DEC-X" → git-revert + re-route tree
│   ├─ goal_convergence.ps1          scores progress vs the ROOT goal
│   ├─ verify_project_setup.ps1      checks every required file exists
│   └─ verify_governance.ps1         checks the rules haven't been gutted
└─ DOCS/
   ├─ INDEX.md             map of all docs + which one wins in a conflict
   ├─ CURRENT_STATE.md     what's verified true right now (+ the E0–E5 legend)
   ├─ REQUIREMENTS.md      testable user needs (REQ-XXX)
   ├─ DECISIONS.md         architecture choices and why (DEC-XXX)
   ├─ FAILURE_REGISTRY.md  recurring bugs + the regression test (FAIL-XXX)
   ├─ ANTI_DRIFT_PROTOCOL.md  short loop, three-strike, no silent fallback
   ├─ CHANGE_POLICY.md     raw request → REQ → evidence → one commit → record
   ├─ CHANGE_RECORD_TEMPLATE.md
   ├─ GIT_RUNBOOK.md       safe commit / branch / rollback
   ├─ HANDOVER_RUNBOOK.md  zero-context operator guide
   ├─ STARTUP_MESSAGE.md   prompts to paste at session start
   ├─ BOOTSTRAP_PROMPT.md  prompt to install this system into a fresh project
   ├─ PROJECT_LOG.md       append-only history
   ├─ BUILD_TRACKER.md     status board
   ├─ STATECHART.md        optional visual
   ├─ plans/ changes/ runs/
   └─ _raw/user_messages.txt   exact word-for-word transcript

Optional companion: graphify

The templates remember what you said and decided. They don't map where your code lives. On a big repo that second kind of memory matters too, and graphify already does it well — it builds a queryable graph of your code so the agent looks things up instead of grepping through 200 files.

these templates                         graphify
───────────────                         ────────
what did we decide / say / try?         where is the auth code, what calls it?
a diary                                 a map

Different jobs, no overlap. If you want both, here's how they fit — but a few things trip people up, so they're worth spelling out.

Does graphify auto-fire from these templates?

No. They're separate. Nothing in these templates installs or calls graphify, and copying a template in does not pull it in.

template on its own       graphify isn't there, nothing happens
+ graphify install        the agent starts using the graph during a session
+ graphify hook install   the map rebuilds itself on every git commit

graphify only starts doing anything after you run its own commands in a project. It never fires on its own from this repo.

Install once, build per project

People run these together as one step and then wonder why the map is stale. They're four separate things:

1. install the tool       once per laptop, forever     uv tool install graphifyy
2. wire it into a project  once per project             graphify install   (or --platform codex)
3. build the first map     once per project             graphify .
4. auto-refresh the map    once per project             graphify hook install

Step 4 is the one most people skip, and it's why "install once and it runs itself" is only half true. The tool installs once. But the map doesn't rebuild on its own until you add the post-commit hook in step 4 — until then, every code change leaves it a little more out of date.

So per project it's three quick commands:

graphify install        # agent uses the graph
graphify .              # build the first map
graphify hook install   # rebuild on every commit, then forget about it

Commit the graphify-out/ folder so teammates start with the map already built, and query it whenever you want:

graphify query "what connects auth to the database?"

On a real task the two systems hand off cleanly — the template supplies the rules, graphify supplies the map:

"add rate-limiting to the login route"
   ├─ template:  DEC-004 pnpm only · REQ-002 needs an integration test
   └─ graphify:  login route → AuthService → RateLimiter → Redis

Does it cost money?

Building the map is two jobs, and only one of them costs anything.

Reading code structure — functions, files, what calls what — runs locally with tree-sitter. That's free; nothing leaves your machine. Understanding meaning (tying docs and PDFs to code, naming concepts, summarizing) is sent to an LLM, and that's the part that costs tokens, because an actual model has to read it.

That split is also why the refresh runs on commit instead of constantly in the background — each rebuild spends a little on that LLM, so it waits for your commit rather than burning money while you sleep. You decide when it costs anything. And if you'd rather it cost nothing, point it at a local model (--backend ollama) and even the meaning step stays on your machine.

(graphify is a separate project, not affiliated with this repo. The PyPI package is graphifyy with a double y. Add graphify-out/cost.json to your .gitignore.)

You probably don't need the paid step

For "just map my code so the agent finds things fast," the free structural map is enough on its own. It already answers the questions you actually ask: where is UserService defined, what calls login(), what does auth.ts import, what breaks if I change this.

The reason the paid meaning layer is mostly redundant is simple — your coding agent is already a model. It reads the structural map and works out the meaning itself, on the fly. Paying a second LLM up front to pre-chew that is doing a job your agent does for free as it goes.

What you give up by skipping it: understanding non-code files like PDFs and design docs, inferred conceptual links that aren't written literally in the code, nicely-named clusters, and the "why" pulled out of comments. All nice to have, none of it needed to navigate code. It earns its keep when you've got a lot of docs to tie to the code, or a huge repo where the connections aren't obvious, or you're onboarding people who need the reasoning. Otherwise: structural map plus a capable agent is plenty.

License

MIT. Use it, fork it, ship it.