How to Use Claude Code on an Existing TypeScript Project
Add Claude Code to a TypeScript repo you already have: a CLAUDE.md that matches your real build, permission rules that block dangerous commands, and a typecheck loop the agent runs itself.
Configure it once per repository, then judge it on the diffs it produces.
Claude Code is a terminal agent that reads and edits files, runs shell commands and iterates against your own tests. It attaches to a repository as it is — there is no index to build and no layout it expects.
Three files do the configuration. CLAUDE.md at the repository root describes
how the project actually builds and is loaded into every session.
.claude/settings.json holds permission rules and hooks and is committed.
.claude/settings.local.json holds personal overrides and is not.
Reach for it when a task is specifiable and mechanically verifiable, and when you can run the whole test suite in under a couple of minutes. That feedback loop is what makes the difference between output you can trust and output you have to trace by hand.
What goes wrong is nearly always configuration. A CLAUDE.md that describes
what a project usually looks like rather than what yours does sends the agent
after commands that do not exist. Permission rules that are absent produce
approval fatigue, which produces overly broad rules a week later. And a session
that has been running for two hours has accumulated context you cannot audit,
which shows up as later edits being worse than early ones.
The version detail matters here more than with most tools: settings keys and
hook schemas have changed between major releases. Check claude --version
before copying configuration from anywhere, including from here, and treat a
rejected key as a documentation question rather than a syntax error.
Start here
Add Claude Code to a TypeScript repo you already have: a CLAUDE.md that matches your real build, permission rules that block dangerous commands, and a typecheck loop the agent runs itself.
A reading order that builds Claude Code knowledge in the sequence it is actually needed.
Add Claude Code to a TypeScript repo you already have: a CLAUDE.md that matches your real build, permission rules that block dangerous commands, and a typecheck loop the agent runs itself.
Failure modes that come up repeatedly with Claude Code, and where each one is solved.
Add Claude Code to a TypeScript repo you already have: a CLAUDE.md that matches your real build, permission rules that block dangerous commands, and a typecheck loop the agent runs itself.
A working loop for running a coding agent on a real codebase — task scoping, branch isolation, tests as the contract, and the review discipline that stops unreviewed code reaching main.
Add Claude Code to a TypeScript repo you already have: a CLAUDE.md that matches your real build, permission rules that block dangerous commands, and a typecheck loop the agent runs itself.
Project settings in `.claude/settings.json`, committed to git. Personal overrides in `.claude/settings.local.json`, which should be gitignored. Memory and conventions go in `CLAUDE.md` at the repository root.
Yes. It is shared project knowledge and belongs next to the code it describes, reviewed like any other file. A widened permission allow list in the same directory is a security change and deserves the same scrutiny.
Yes. It reads the instructions file in the current working directory and walks up toward the repository root, so a short root file plus a per-package file gives you shared conventions and local specifics.