# Edit code and add custom nodes

The Home workspace carries an explorer, a code editor and the assistant side by side. A Python file from your workspace opens in the editor; an edit the assistant proposes arrives as a diff you accept or reject line by line; a file saved under custom_nodes becomes a node of the catalogue.

## A file open in the editor

The explorer on the left lists the workspace folders: the catalogue, your custom nodes, your sessions. A click on a Python file opens it in the editor with line numbers and syntax colouring. The assistant on the right reads the file that is open; its answers quote the lines they rest on.

[Screenshot: A real generated Pine Script strategy opened in the app code editor. The source and its scope remain inspectable.](https://stochastly.com/screenshots-current/product-editor--an-exported-strategy-open-for-inspection.png)

A real generated Pine Script strategy opened in the app code editor. The source and its scope remain inspectable.

## An edit is a diff before it is a file

When the assistant proposes a change to the open file, the disk is left as it was. The editor shows the proposal as a diff over the current text: removed lines in red, added lines in green, with the count of additions and deletions in the bar above. Accept writes the file; Reject restores the text as it was. The keyboard does both: Alt+Enter accepts, Alt+Backspace rejects.

- what writes the file: your Accept; a rejected proposal leaves the file as it was
- what the assistant can do without you: read the open file and propose; the write goes through the review bar

## A custom node, from a sentence to the catalogue

Ask for a node and the assistant writes a Python file under custom_nodes. The file follows the node contract: a signal function that returns the position series, parameters declared at the top. Once saved, the node appears in the Add node menu of the composer under Custom, with the parameters it declared, and it runs through the same engine and the same gates as the shipped kernels.

- where the file lives: custom_nodes in your workspace folder, plain Python, yours to edit
- what runs it: the same engine as the catalogue kernels, under the same causality probe

## Any file, reopened from the explorer

The explorer keeps the workspace files at hand: a click reopens a node, a saved session or a data file in the editor. The tab bar holds the open files; the size beside each name is the size on disk.

[Screenshot: The generated Python strategy is a real file in the code editor. Syntax highlighting and line numbers let you inspect the implementation after its scope header.](https://stochastly.com/screenshots-current/product-editor--inspect-the-generated-trading-logic.png)

The generated Python strategy is a real file in the code editor. Syntax highlighting and line numbers let you inspect the implementation after its scope header.

## Where it stops

### A proposal is not a verification

Scope: the edits and the custom nodes the assistant writes
Effect: the file compiles or it does not; whether the signal has an edge is decided by a run through the gates, not by the editor
Control: the causality probe of the engine rejects a kernel that reads ahead of itself, custom or shipped

[the assistant](https://stochastly.com/product/assistant): what it can read and write on the desk

[the node catalogue](https://stochastly.com/docs/nodes): where a custom node lands

---
Source: https://stochastly.com/product/editor
