[cc] Claude Code Practice
工作流介绍
Step 1: 项目初始化
↓ 描述项目目标 → AI 生成项目骨架
Step 2: 建立 CLAUDE.md(项目上下文)
↓ 可运行 /init 让 AI 自动生成
Step 3: 配置权限与默认模式
↓ .claude/settings.json,复杂项目可默认 plan 模式
Step 4: 功能开发
↓ 一次一个功能,逐个 Explore → Plan → Implement
Step 5: 代码审查与测试
↓ 用 /review 让 AI 生成测试并跑起来
Step 6: 提交代码
↓ git commit 保存进度

“使用 node.js 构建一个前端页面,显示出 Hello ai coding 几个字”
模型给出 Planning 的预览草稿。
确定后即可让模型开始实现。
最佳实践
1. 需求尽量详尽
2. 有参考最好
3. 显式列出计划
4. 一件一件去做(一件最好不大于5个文件,200行代码)
死记硬背如下


MCP 集散地: https://www.modelscope.cn/mcp/servers/@amap/amap-maps
现代编程
CodeGeex 针对某个方法,类这个级别,免费且可用。
Ubuntu Install Claude Code. 在 vscode 里安装插件即可。
若报错:先试最简单的:Cmd/Ctrl+Shift+P 打开命令面板,输入并执行 'Developer: Reload Window'。有时候只是扩展加载时序问题,重载就好了。

{
"permissions": {
"allow": [
"Read", // 允许 Claude Code 读取项目中的文件
"Write", // 允许 Claude Code 创建或修改文件
"Bash(npm *)", // 允许执行所有 npm 命令,例如 npm install、npm test
"Bash(git *)", // 允许执行所有 git 命令,例如 git status、git diff、git commit
"Bash(node *)" // 允许执行 node 命令,例如 node app.js
],
"deny": [
"Bash(rm -rf *)" // 明确禁止执行 rm -rf,防止递归强制删除文件或目录
]
},
"autoCompactThreshold": 80
// 当上下文使用量达到设定阈值时,触发自动压缩,
// 避免长时间对话持续占用 Context Window
}
PLAN First.
得到了结果,效果很炸裂,如下。


CC Switch
cc-switch 不是 Anthropic 官方工具,是一个第三方开源项目(GitHub: farion1231/cc-switch),用来在 Claude Code / Codex / Gemini CLI 等多个 AI 编码工具之间快速切换 API 供应商配置(比如在官方 Anthropic API 和第三方中转服务之间切换)。
本质上 是帮你自动改写 ~/.claude/settings.json 里的 ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN,不用手动改文件。

切换到 DeepSeek v4 pro后,继续升级后的效果。


需求越细,单位任务越简单,能使用 更便宜的模型,结果会得到更便宜的成本。
2026 年 4 月 The Information 报道的 Meta 内部 “tokenmaxxing” 事件
Codex
最好是选择一个已有文件夹,而非新建。
权限定义如下:

~/.codex/config.toml
Codex 用户级配置 模型、sandbox、approval、MCP、multi-agent 等。
.codex/config.toml
项目级配置。
#:schema https://developers.openai.com/codex/config-schema.json
# Codex project configuration for the Finance Tracker repository.
#
# This file is committed with the project and applies only when Codex trusts
# this repository. User-wide defaults remain in ~/.codex/config.toml.
# Never place API keys, passwords, or other secrets in this file.
# Ask before commands need permissions beyond the configured sandbox.
approval_policy = "on-request"
# Allow edits inside this repository while protecting paths outside it.
sandbox_mode = "workspace-write"
# Optional project overrides -------------------------------------------------
# Uncomment these only if every contributor should use the same defaults.
# Command-line flags and IDE selections can still take precedence.
# model = "gpt-5.6"
# model_reasoning_effort = "medium"
# Network access is disabled by default in the workspace-write sandbox.
# Enable this only if project commands must download packages or call APIs.
#
# [sandbox_workspace_write]
# network_access = true
./AGENTS.md
项目级 Instructions。
# Finance Tracker — Codex Instructions
## Project overview
- This repository is a single-page personal expense tracker.
- The stack is Python 3, Streamlit, SQLite, pandas, and Altair.
- The user interface and source comments are primarily Chinese.
- Preserve the existing dark visual theme and accessible interaction patterns.
## Architecture
- `app.py` initializes Streamlit, renders the sidebar and dashboard, and routes tabs.
- `database.py` owns SQLite schema and data-access operations. Keep Streamlit calls out of it.
- `tabs/` contains one UI module per application tab.
- `styles.py` contains shared Streamlit CSS.
- `visual_3d.py` contains the isolated interactive 3D hero component.
- `config.py` is the source of truth for categories, colors, emoji, and database constants.
- `utils.py` contains presentation helpers and calculated dashboard metrics.
## Working conventions
- Keep changes small and preserve existing behavior unless the task requires otherwise.
- Reuse category constants from `config.py`; do not duplicate category definitions.
- Use parameterized SQL and keep all database operations inside `database.py`.
- Keep tab modules focused on rendering and call the database layer for persistence.
- Match the surrounding Chinese copy and comments when changing user-facing UI.
- Do not add a production dependency when the standard library or current stack is sufficient.
- Never commit credentials, local secrets, generated databases, or environment-specific settings.
## Verification
After modifying Python code, run:
```bash
python -m py_compile app.py config.py database.py styles.py utils.py visual_3d.py tabs/*.py
```
For UI changes, also smoke-test the app when the environment permits:
```bash
streamlit run app.py --server.headless true
```
Before finishing, run:
```bash
git diff --check
git status --short
```
Report any check that could not be run. Do not commit changes unless the user asks.
## Data safety
- Treat `finance.db` as user data.
- Do not delete or recreate the database unless explicitly requested.
- Preserve backward compatibility when changing the schema; use a migration when needed.
- Confirm the exact record and intent before performing destructive data operations.
## Code review rules
- Flag SQL assembled from user-provided strings instead of parameters.
- Flag UI changes that bypass `config.py` category definitions.
- Flag database writes performed directly from `app.py` or `tabs/`.
- Flag changes that can erase or silently rewrite existing finance records.
- Flag new animations that ignore `prefers-reduced-motion`.
最直观的对应关系:
| Claude Code | Codex |
|---|---|
CLAUDE.md |
AGENTS.md |
~/.claude/settings.json |
~/.codex/config.toml |
.claude/settings.local.json |
.codex/config.toml 中相应配置 |
| Claude Skills | Codex Skills |
| Claude MCP config | Codex MCP config |
Codex 能读懂这个 .claude/settings.local.json 文件的内容,并不等于:
Codex 会按照 Claude Code 的 settings schema 来执行它。

浙公网安备 33010602011771号