Memory
Records project-specific technical discoveries and gotchas about CLI JSON output, proxy configuration, and Feishu integration.
What this file does
Records project-specific technical discoveries and gotchas about CLI JSON output, proxy configuration, and Feishu integration.
When to use it
- Building a non-interactive wrapper around codex or Claude CLI
- Debugging proxy support for discord.js on Node
- Handling Feishu long-connection events with async work
- Adding a new third-party endpoint that needs permissions
Assumes this stack
Memory
2026-03-08
codex exec --jsonemits machine-readable JSONL that includesthread.started.thread_id,item.completedentries for agent messages, andturn.completed.usage.codex exec resume --json <thread_id> <prompt>can continue the same Codex session non-interactively.- When integrating with CLI JSONL output, keep a line buffer across stdout chunks; splitting each data chunk independently can corrupt partial JSON lines.
2026-03-09
- In modern Node,
http.Agent/https.Agentcan be created withproxyEnvso libraries that use corehttp(s)without an explicit proxy agent can inherit proxy behavior via the global agents. discord.json Node usesundicifor REST andwsfor the gateway, so full proxy support may require configuring both anundicidispatcher and corehttp(s)agents instead of relying on only one transport hook.codex exec --jsonfailures do not always put the real user-facing error on stderr; sometimes stderr only has an internal warning while the actionable error is printed on stdout, so wrappers should inspect both.- Claude Code CLI stream-json integrations should keep a line buffer across stdout chunks and inspect both structured result events and stderr, because session ids, final text, and surfaced errors may arrive in different events.
- Claude Code
--output-format stream-jsonin--printmode also requires--verbose; without it, the CLI can fail before the actual model/backend error is reached. - Claude stores per-project local session logs under
~/.claude/projects/<absolute-path-with-slashes-replaced-by-dashes>/, and assistant events there can include both usage metadata and human-readable limit text such asYou've hit your limit .... - Claude interactive slash commands can be scripted over stdin; for example,
printf '/usage\n/exit\n' | claudereturns the same human-readable usage/limit text shown in the interactive CLI. - If real behavior or the correct data source is still uncertain after a few probes, stop self-looping, ask the human for help/context, and avoid speculative production-code changes first.
2026-03-11
codexCLI marks--ask-for-approval on-failureas deprecated; for non-interactivecodex execwrappers, prefer--ask-for-approval neverand pair it with an explicit sandbox mode instead of relying on older approval behavior.
2026-03-12
- Feishu long-connection event handlers still need to finish within 3 seconds; if the real work is a long-running CLI turn, acknowledge the event immediately and continue the job asynchronously, otherwise Feishu can retry the same event.
- Feishu long-connection delivery is cluster-mode, not broadcast: if the same app is connected from multiple runtimes, only one client receives a given event.
2026-03-13
- When an integration starts using a new third-party endpoint or platform capability, treat the required permissions/scopes as part of the feature itself and update setup docs in the same change instead of letting runtime permission errors surface the requirement later.
What's inside
7 dated entries, each containing 1-3 factual notes about CLI behavior, proxy setup, or platform quirks
Change this for your project
- Replace
cnrpman/no-clawwith your own repository name - Replace
~/.claude/projects/<absolute-path-with-slashes-replaced-by-dashes>/with your own Claude project log path
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Treating permissions as part of the feature and updating docs in the same change
- Inspecting both stdout and stderr when a CLI's error output is unpredictable
Related Documents
Zig 0.16.0 Context Document for LLMs
Documents breaking changes from Zig 0.13/0.14 to 0.16.0, covering syntax, I/O, build system, and standard library updates.
绘制对比图片 KITTI
Documents the topic remapping and data flow needed to connect Fast-LIO2 frontend with SC-PGO backend for KITTI evaluation.
Beads Workflow Context
Guides when to use bd graph-based issue tracker versus TodoWrite for session vs multi-session work, with commands and workflows.
EPIC: usda-data-crush-stats
Maps a multi-year USDA grape crush data pipeline from raw downloads through bronze, silver, and gold layers to final CSV fact and dimension tables.